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

Migrate OSC ownership, branch joins and borrow lifecycles to Omega

open c8279ea07d5d2c98 opened 2026-11-20 by z6MktvMGgxSZ19NQ...

3 commits · 12 files · 95469 bytes. Base c0d90d3a3b7ae0ea13d545d0dfad60ac31815faa. Applied head 35a7b2d26ceb5f0254d6ae6d044570579b1243ef: the last commit this forge's own git am made on the base. It is in no repository; the owner applies the patch by hand.

The AArch64 Linux full compiler suite passed on the branch-join and borrow-lifecycle commits on both Interplane histories. The final public Git commit is 9b69f6e97f606b77e4392dac6fce3c7c722462d9. The corresponding owner-store commit is 7c8fb257dda17c39a0831276bb7afc415c5fcb18.

This complete three-commit series includes the ownership-access commit from patch bf33dea92e7e9a08. Apply the series once to its stated base. The next two commits migrate owner state at branch joins, handle provenance, definite frees and the initialization, opening and closing of direct and nested borrows. The checker still manages snapshot storage, AST traversal, diagnostics and trace recording in C.

Clean-checkout commands for each new commit, using that history's pinned compiler and bridge:

    sh om/units.sh --check
    AIEN_BASE_REF=HEAD^ tests/gates/run.sh evidence-immutable
    tests/gates/run.sh zero-disk-secrets
    make -s -j5 PHYSICS_DIR=/nonexistent PHYSICS_LOCK_CHECK=0 test-compiler-full

Each full suite reported test-compiler: PASS. The generated bindings reproduced byte for byte and both mandatory gates passed. Across 200 fixtures and 256 generated programs, the original C compiler and the final compiler agreed on exit status, stdout, stderr, IR, machine code and entry tables. Both final units passed 1,110 state cases and compiled to the same machine code. Two deliberate mutations were caught. Preserving the wrong move line failed the branch-state check. Clearing every shared child when closing one caused the compiler to accept a write that the regression fixture rejects. A local integration with the earlier parser series passed its parser and scalar parity suites and the focused compiler suite.

Host receipt: osc-semantic-series.ac43618bcfbfeb0fe4854b5eff8797d8ec698e7f17c9a3b4ff7f5b4c7c75779f.json

Apply it

git checkout -b patch-c8279ea07d5d2c98 c0d90d3a3b7ae0ea13d545d0dfad60ac31815faa
curl -fsSL https://interplane.io/drakestapleton/omega-mv/patches/c8279ea07d5d2c98.patch | git am

Raw patch (mbox) · Diff

Signature

The author's key did:key:z6MktvMGgxSZ19NQkrvXG6aRzjbFA1yBa2KJmmA9pSTJCiEZ signed this statement with ssh-keygen -Y sign -n interplane-patch; the forge checked the signature before it kept the patch. The lines are: format, repository, base, SHA-256 of the mbox, SHA-256 of the title, a line feed and the description.

interplane-patch 1
drakestapleton/omega-mv
c0d90d3a3b7ae0ea13d545d0dfad60ac31815faa
a694a4cfa09be00442fb99445834d2e56b6cdea6cf1992612f01221fbf40dd6a
dbd8648f402d162212e9f5c5f0d05619177243501fa917c037c9a928a720f818
-----BEGIN SSH SIGNATURE-----
U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAg1vQ1KtWtuW5PISxEahQt4AgcBw
syuwQ4l2Qd7RBTSZ4AAAAQaW50ZXJwbGFuZS1wYXRjaAAAAAAAAAAGc2hhNTEyAAAAUwAA
AAtzc2gtZWQyNTUxOQAAAECDhGfsy5B1V+whlhqgJ70JGlXtYzZcEx3o4UaWxBPAnU25QL
ZgSa7/5F0fJVNX+rZGi3aLQw9FXPRWu3DQ1ZgH
-----END SSH SIGNATURE-----

Changes

diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 29fa863f755f056500d4ff1ca6786805e112c921..feeb5f9026ffa9b66b35cbea33c564fb7802042d 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -7,6 +7,7 @@ The current development method is [Human-Directed Agentic Engineering (HDAE)](RE
 
 | Model | What it did |
 |---|---|
+| OpenAI Codex (OSC semantic checker) | Ported the owner access, borrow, reborrow and move decisions to seeded Omega. Ported branch joins for ownership, handle provenance and definite frees. Migrated owner initialization and direct and nested borrow lifecycles. |
 | OpenAI Codex | Brought the bundle corpus builder and compiler feedback harness from aien-train into Omega LLM with their original Git history. |
 | Gemini 4 Neon (via Antigravity) | Closed remaining OM-2 Blackwell IR boundary gaps: `omega_bw_ir_from_om` (`src/omega_bw_om_ir.h`) now clears `prog` via `omega_bw_ir_init` on every error path (preventing partial-program residue), all remaining OM-2 codegen wrappers (`bf16`, `moe2`, `pf`, `pfhost`, `qmma`) zero-initialize `ins`/`meta` and init `prog`, and `tests/test_bw_om_codegen_bounds.c` adds partial-residue checks, `qmma`/`pfhost` invalid-spec sweeps, and max-size legal input headroom checks (173/173 PASS on Spark AArch64; zero calls to aborting `apic` GPU/codegen wrappers in `src/`). Completed live GB10 silicon validation (`spark-window 20261119T233031Z-d8ecb9`, exclusive, quiet machine): `gpu_qmma_probe_test` PASS (262,144/262,144 exact, 238.47 TFLOPS peak, 1,048,576/1,048,576 F2E4 exact), `gpu_pfhost_test --chip` PASS (router `rl` 0/262,144 diffs 0.314 ms, combine `mc` 0/4,194,304 diffs 0.818 ms, mutants 1..2 caught), `gpu_fp8gemm_test` 36/36 PASS (bit-identical, 1.90–2.78× vs GEMV), `gpu_moe_window_test --small` 101/101 PASS. |
 | Gemini 4 Neon (via Antigravity) | Hardened the pure-OM-2 Blackwell IR boundary (`src/omega_bw_om_ir.h` validates `meta[5]`, instruction/vreg/uvreg/loop bounds, vreg/uvreg widths, opcode range, register/subregister/barrier/flag bounds; `*_patch` in `cg_{bf16,gemm,moe,moe2}.om` guards `pos < 1024`; `gemm`/`moe` wrappers zero-init buffers and reset `prog` on any failure) and added host boundary + kernel-metrics test `tests/test_bw_om_codegen_bounds.c` (76/76 PASS; 10/10 compiled kernels byte-for-byte identical SM121 SASS SHA-256, GPRs, occupancy, and avg stalls vs C parent `3d0cb3500`). Re-verified on live GB10 silicon (`spark-window 20261119T231305Z-1a8c84`, exclusive): `gpu_q38_graph_test` 22/22 PASS, `gpu_q38_stroke_exact_test` 71/71 PASS, 4-layer 27B `q38_stress_bench` PASS (`N=8` batched `plain bf16` 33.919 ms / 4.16×, `64x8` sustained `bat_exact` mean 41.826 ms / 191.27 tok/s). |
diff --git a/om/compiler/osc_ownership.om b/om/compiler/osc_ownership.om
new file mode 100644
index 0000000000000000000000000000000000000000..5b60594cfb610ab2c92fa89dc7e9f667566515a5
--- /dev/null
+++ b/om/compiler/osc_ownership.om
@@ -0,0 +1,170 @@
+note SPDX-License-Identifier: Apache-2.0
+note OSC semantic decisions. The checker supplies the live counts for the owner
+note or, for a reborrow, the live child counts for its parent borrow.
+note bridge c-define OSC_OWN_ALLOWED 0
+note bridge c-define OSC_OWN_MOVED 1
+note bridge c-define OSC_OWN_ALIAS 2
+note bridge c-define OSC_OWN_READ_ONLY 3
+note bridge c-define OSC_OWN_LOOP_MOVE 4
+note bridge c-type oscowner OscCheckedOwner
+note bridge c-type oscbor OscCheckedBorrow
+om2
+
+note The checker snapshots this record at each branch. sym is the owning
+note symbol or -1, and arena1 is the arena symbol plus one or zero.
+layout oscowner 20
+field moved uchar at 0 little
+field n_shared ushort at 2 little
+field n_mut ushort at 4 little
+field moveline uint at 8 little
+field sym int at 12 little
+field arena1 int at 16 little
+end
+
+note parent is -1 for a direct borrow. Nested borrows count against
+note the parent borrow, direct borrows count against the owner.
+layout oscbor 24
+field live uchar at 0 little
+field mut uchar at 1 little
+field obj int at 4 little
+field parent int at 8 little
+field n_shared ushort at 12 little
+field n_mut ushort at 14 little
+field line uint at 16 little
+field sym int at 20 little
+end
+
+const owner_live uchar 0
+const owner_moved uchar 1
+const owner_maybe uchar 3
+
+const allowed ulong 0
+const moved_owner ulong 1
+const mutable_alias ulong 2
+const read_only ulong 3
+const loop_move ulong 4
+
+fn check_alias exclusive ulong shared_count ulong mut_count ulong to ulong
+  if or ne mut_count 0 and ne exclusive 0 ne shared_count 0
+    ret mutable_alias
+  end
+  ret allowed
+end
+
+export fn osc_owner_access moved ulong exclusive ulong shared_count ulong mut_count ulong to ulong
+  if ne moved 0
+    ret moved_owner
+  end
+  ret check_alias exclusive shared_count mut_count
+end
+
+export fn osc_borrow_access writable ulong exclusive ulong shared_count ulong mut_count ulong to ulong
+  if and ne exclusive 0 eq writable 0
+    ret read_only
+  end
+  ret check_alias exclusive shared_count mut_count
+end
+
+export fn osc_owner_move moved ulong shared_count ulong mut_count ulong declaration_depth long loop_depth long to ulong
+  decision = osc_owner_access moved 1 shared_count mut_count
+  if ne decision allowed
+    ret decision
+  end
+  if lt declaration_depth loop_depth
+    ret loop_move
+  end
+  ret allowed
+end
+
+note Join two paths that reach the same point. Keep the diagnostic line from
+note the already maybe-moved path when the other path definitely moved.
+note Return one when the declaration needs a conditional release.
+export fn osc_join_owner taken view oscowner remaining edit oscowner to ulong
+  first = get taken moved
+  second = get remaining moved
+  if eq first second
+    ret 0
+  end
+  if or eq second owner_live and eq second owner_moved eq first owner_maybe
+    put remaining moveline get taken moveline
+  end
+  put remaining moved owner_maybe
+  ret 1
+end
+
+note Handle provenance is definite only while every surviving path retains
+note its original allocation. For a single surviving path pass before as other.
+export fn osc_join_handle before long current long other long to long
+  if or ne current before ne other before
+    ret -1
+  end
+  ret before
+end
+
+note A provenance is definitely freed only when it was freed on both paths.
+export fn osc_join_frees taken view uchar * remaining edit uchar * to void
+requires eq len taken len remaining
+  for i ulong len remaining
+    if and ne get taken i 0 ne get remaining i 0
+      put remaining i 1
+    else
+      put remaining i 0
+    end
+  end
+end
+
+export fn osc_init_owner item edit oscowner symbol long to void
+  put item moved owner_live
+  put item n_shared 0
+  put item n_mut 0
+  put item moveline 0
+  put item sym int symbol
+  put item arena1 0
+end
+
+fn init_borrow child edit oscbor object long parent_id long mutable ulong source_line ulong to void
+  put child live 1
+  put child mut uchar mutable
+  put child obj int object
+  put child parent int parent_id
+  put child n_shared 0
+  put child n_mut 0
+  put child line uint source_line
+  put child sym -1
+end
+
+export fn osc_open_borrow owner edit oscowner child edit oscbor object long mutable ulong source_line ulong to void
+  init_borrow child object -1 mutable source_line
+  if ne mutable 0
+    put owner n_mut add get owner n_mut 1
+  else
+    put owner n_shared add get owner n_shared 1
+  end
+end
+
+export fn osc_open_reborrow parent edit oscbor child edit oscbor object long parent_id long mutable ulong source_line ulong to void
+  init_borrow child object parent_id mutable source_line
+  if ne mutable 0
+    put parent n_mut add get parent n_mut 1
+  else
+    put parent n_shared add get parent n_shared 1
+  end
+end
+
+export fn osc_close_borrow owner edit oscowner child edit oscbor to void
+  put child live 0
+  if ne get child mut 0
+    put owner n_mut sub get owner n_mut 1
+  else
+    put owner n_shared sub get owner n_shared 1
+  end
+end
+
+export fn osc_close_reborrow parent edit oscbor child edit oscbor to void
+  put child live 0
+  if ne get child mut 0
+    put parent n_mut sub get parent n_mut 1
+  else
+    put parent n_shared sub get parent n_shared 1
+  end
+end
diff --git a/om/units.sh b/om/units.sh
index 43b622c650cd1bbbce8c81eea735fd762f89420d..289c30e63262e589d1e0ddefbc5582d49d080ff0 100755
--- a/om/units.sh
+++ b/om/units.sh
@@ -28,7 +28,7 @@ NATIVE_PIN=2c1bf63798336e899704217d98f909b31e567289650751a55d83255c7eb8f27d
 ROOT=$(cd "$(dirname "$0")/.." && pwd)
 # One generated library for all units: the bindings share one ABI runtime (ombr_enter).
 # om/encoder/bw_enc_sm121.om: the sm_121 instruction encoder, twin of aien-dev/CUDApp's (mk/om-encoder.mk).
-UNITS="${OMEGA_UNITS:-om/sha256/sha256-om2.om om/blake3/b3unit.om om/encoder/bw_enc_sm121.om om/gpu/bw_qmd.om om/gpu/bw_sched.om om/gpu/q38_plan.om om/gpu/cg_pf.om om/gpu/cg_bf16.om om/gpu/cg_gemm.om om/gpu/cg_moe2.om om/gpu/cg_moe.om om/gpu/cg_qmma.om om/gpu/cg_pfhost.om om/gpu/cg_gpu_attn.om om/runtime/rx_regulate.om om/runtime/rx_mid.om om/runtime/rx_cortex_rec.om om/runtime/rx_plan_core.om om/runtime/rx_projection.om om/runtime/rx_capq_core.om om/runtime/rx_costmodel_core.om om/runtime/rx_route_core.om om/runtime/rx_world_core.om om/runtime/rx_skillroute_core.om om/runtime/rx_fusion_core.om om/compiler/osc_literal.om}"
+UNITS="${OMEGA_UNITS:-om/sha256/sha256-om2.om om/blake3/b3unit.om om/encoder/bw_enc_sm121.om om/gpu/bw_qmd.om om/gpu/bw_sched.om om/gpu/q38_plan.om om/gpu/cg_pf.om om/gpu/cg_bf16.om om/gpu/cg_gemm.om om/gpu/cg_moe2.om om/gpu/cg_moe.om om/gpu/cg_qmma.om om/gpu/cg_pfhost.om om/gpu/cg_gpu_attn.om om/runtime/rx_regulate.om om/runtime/rx_mid.om om/runtime/rx_cortex_rec.om om/runtime/rx_plan_core.om om/runtime/rx_projection.om om/runtime/rx_capq_core.om om/runtime/rx_costmodel_core.om om/runtime/rx_route_core.om om/runtime/rx_world_core.om om/runtime/rx_skillroute_core.om om/runtime/rx_fusion_core.om om/compiler/osc_literal.om om/compiler/osc_ownership.om}"
 # The units the freestanding GPU link needs (the encoder, codegen, matmul and realize files hash with sha256_*; qmd packs QMDs).
 FS_UNITS="om/sha256/sha256-om2.om om/gpu/bw_qmd.om om/gpu/cg_gpu_attn.om"
 DEST="${OMEGA_UNITS_DEST:-$ROOT/src}"
diff --git a/src/compiler/osc_check.c b/src/compiler/osc_check.c
index 3e33434a6f29753f058d72bdc11bbaecfe8f2161..b2562b62b5eff3b7f2f63569f314674aa9a12fe6 100644
--- a/src/compiler/osc_check.c
+++ b/src/compiler/osc_check.c
@@ -22,6 +22,7 @@
  */
 #include "osc_alloc.h"
 #include "osc_check.h"
+#include "omega_api_decl.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -73,21 +74,9 @@ typedef struct {
  * borrowed or moved; at scope end its release is guarded by a drop flag. */
 enum { OM_LIVE = 0, OM_MOVED = 1, OM_GONE = 2 /* released (scope gone) */, OM_MAYBE = 3 };
 
-typedef struct {
-    uint8_t moved;   /* OM_* */
-    uint16_t n_shared, n_mut;
-    uint32_t move_line;
-    int sym;   /* owning symbol or -1 (stand-in / dummy) */
-    int arena1; /* OSC-2: arena symbol + 1 for an arena object, 0 for a unique owner */
-} Obj;
+typedef OscCheckedOwner Obj;
 
-typedef struct {
-    uint8_t live, mut;
-    int obj, parent;
-    uint16_t kids_shared, kids_mut;
-    uint32_t line;
-    int sym;   /* binding symbol or -1 (call argument) */
-} Bor;
+typedef OscCheckedBorrow Bor;
 
 typedef struct {
     Obj obj[OSC_CHECK_MAX_OBJS];
@@ -215,8 +204,7 @@ static int new_obj(C *c, int sym, uint32_t line)
 {
     if (c->nobj >= OSC_CHECK_MAX_OBJS) return cap_fail(c, line, "owner capacity");
     Obj *o = &c->obj[c->nobj];
-    memset(o, 0, sizeof *o);
-    o->sym = sym;
+    osc_init_owner(o, sym);
     return c->nobj++;
 }
 
@@ -224,18 +212,10 @@ static int new_bor(C *c, int obj, int parent, int mut, uint32_t line)
 {
     if (c->nbor >= OSC_CHECK_MAX_BORS) return cap_fail(c, line, "borrow capacity");
     Bor *b = &c->bor[c->nbor];
-    memset(b, 0, sizeof *b);
-    b->live = 1;
-    b->mut = (uint8_t)mut;
-    b->obj = obj;
-    b->parent = parent;
-    b->line = line;
-    b->sym = -1;
-    if (parent >= 0) {
-        if (mut) c->bor[parent].kids_mut++; else c->bor[parent].kids_shared++;
-    } else {
-        if (mut) c->obj[obj].n_mut++; else c->obj[obj].n_shared++;
-    }
+    if (parent >= 0)
+        osc_open_reborrow(&c->bor[parent], b, obj, parent, mut, line);
+    else
+        osc_open_borrow(&c->obj[obj], b, obj, mut, line);
     return c->nbor++;
 }
 
@@ -243,12 +223,10 @@ static void end_bor(C *c, int b, uint32_t line)
 {
     Bor *x = &c->bor[b];
     tr_ev(c, OSC_EV_END_BORROW, -1, -1, b, -1, line, 0);
-    x->live = 0;
-    if (x->parent >= 0) {
-        if (x->mut) c->bor[x->parent].kids_mut--; else c->bor[x->parent].kids_shared--;
-    } else {
-        if (x->mut) c->obj[x->obj].n_mut--; else c->obj[x->obj].n_shared--;
-    }
+    if (x->parent >= 0)
+        osc_close_reborrow(&c->bor[x->parent], x);
+    else
+        osc_close_borrow(&c->obj[x->obj], x);
 }
 
 /* describe a live borrow conflicting on object o (direct) or as a child of borrow p */
@@ -280,7 +258,7 @@ static int diag_own(C *c, OscDiagKind k, uint32_t line, uint32_t col, int s, con
 static int maybe_path(C *c, const Sym *y)
 {
     if (c->obj[y->obj].moved != OM_MAYBE) return 0;
-    tr_ev(c, OSC_EV_MOVE, y->obj, -1, -1, -1, c->obj[y->obj].move_line, 0);
+    tr_ev(c, OSC_EV_MOVE, y->obj, -1, -1, -1, c->obj[y->obj].moveline, 0);
     return 1;
 }
 
@@ -292,13 +270,14 @@ static int access(C *c, int s, int wr, uint32_t line, uint32_t col)
     if (y->kind == SK_OWNER) {
         Obj *o = &c->obj[y->obj];
         uint32_t k = wr ? OSC_EV_USE_WRITE : OSC_EV_USE_READ;
-        if (o->moved) {
+        uint64_t decision = osc_owner_access(o->moved, wr, o->n_shared, o->n_mut);
+        if (decision == OSC_OWN_MOVED) {
             int mb = maybe_path(c, y);
             tr_ev(c, k, y->obj, -1, -1, -1, line, 1);
-            snprintf(msg, sizeof msg, mb ? "'%s' used after it may have been moved at line %u (moved on some path of an 'if')" : "'%s' used after it was moved at line %u", y->name, o->move_line);
+            snprintf(msg, sizeof msg, mb ? "'%s' used after it may have been moved at line %u (moved on some path of an 'if')" : "'%s' used after it was moved at line %u", y->name, o->moveline);
             return diag_own(c, OSC_DIAG_USE_AFTER_MOVE, line, col, s, NULL, mb ? "use after maybe-move" : "use after move", msg);
         }
-        if (o->n_mut || (wr && o->n_shared)) {
+        if (decision == OSC_OWN_ALIAS) {
             conflict_name(c, y->obj, -1, !wr, other, sizeof other);
             tr_ev(c, k, y->obj, -1, -1, -1, line, 1);
             snprintf(msg, sizeof msg, "direct %s of '%s' while %s is live", wr ? "store" : "read", y->name, other);
@@ -312,12 +291,13 @@ static int access(C *c, int s, int wr, uint32_t line, uint32_t col)
     int b = y->bor;
     Bor *x = &c->bor[b];
     uint32_t k = wr ? OSC_EV_USE_WRITE : OSC_EV_USE_READ;
-    if (wr && !x->mut) {
+    uint64_t decision = osc_borrow_access(x->mut, wr, x->n_shared, x->n_mut);
+    if (decision == OSC_OWN_READ_ONLY) {
         tr_ev(c, k, x->obj, -1, -1, b, line, 1);
         snprintf(msg, sizeof msg, "store through shared borrow '%s' (read only)", y->name);
         return diag_own(c, OSC_DIAG_READ_ONLY_BORROW, line, col, s, NULL, "write through shared borrow", msg);
     }
-    if (x->kids_mut || (wr && x->kids_shared)) {
+    if (decision == OSC_OWN_ALIAS) {
         conflict_name(c, -1, b, !wr, other, sizeof other);
         tr_ev(c, k, x->obj, -1, -1, b, line, 1);
         snprintf(msg, sizeof msg, "use of '%s' while its reborrow %s is live", y->name, other);
@@ -336,13 +316,14 @@ static int take_borrow(C *c, int s, int mut, uint32_t line, uint32_t col)
     uint32_t k = mut ? OSC_EV_BORROW_MUT : OSC_EV_BORROW_SHARED;
     if (y->kind == SK_OWNER) {
         Obj *o = &c->obj[y->obj];
-        if (o->moved) {
+        uint64_t decision = osc_owner_access(o->moved, mut, o->n_shared, o->n_mut);
+        if (decision == OSC_OWN_MOVED) {
             int mb = maybe_path(c, y);
             tr_ev(c, k, y->obj, -1, c->nbor, -1, line, 1);
-            snprintf(msg, sizeof msg, mb ? "borrow of '%s' after it may have been moved at line %u (moved on some path of an 'if')" : "borrow of '%s' after it was moved at line %u", y->name, o->move_line);
+            snprintf(msg, sizeof msg, mb ? "borrow of '%s' after it may have been moved at line %u (moved on some path of an 'if')" : "borrow of '%s' after it was moved at line %u", y->name, o->moveline);
             return diag_own(c, OSC_DIAG_USE_AFTER_MOVE, line, col, s, NULL, mb ? "use after maybe-move" : "use after move", msg);
         }
-        if (o->n_mut || (mut && o->n_shared)) {
+        if (decision == OSC_OWN_ALIAS) {
             conflict_name(c, y->obj, -1, !mut, other, sizeof other);
             tr_ev(c, k, y->obj, -1, c->nbor, -1, line, 1);
             snprintf(msg, sizeof msg, "%s of '%s' while %s is live", mut ? "&mut" : "&", y->name, other);
@@ -357,12 +338,13 @@ static int take_borrow(C *c, int s, int mut, uint32_t line, uint32_t col)
     }
     int p = y->bor;
     Bor *x = &c->bor[p];
-    if (mut && !x->mut) {
+    uint64_t decision = osc_borrow_access(x->mut, mut, x->n_shared, x->n_mut);
+    if (decision == OSC_OWN_READ_ONLY) {
         tr_ev(c, k, x->obj, -1, c->nbor, p, line, 1);
         snprintf(msg, sizeof msg, "&mut reborrow through shared borrow '%s' (read only)", y->name);
         return diag_own(c, OSC_DIAG_READ_ONLY_BORROW, line, col, s, NULL, "borrow_mut through shared borrow", msg);
     }
-    if (x->kids_mut || (mut && x->kids_shared)) {
+    if (decision == OSC_OWN_ALIAS) {
         conflict_name(c, -1, p, !mut, other, sizeof other);
         tr_ev(c, k, x->obj, -1, c->nbor, p, line, 1);
         snprintf(msg, sizeof msg, "reborrow of '%s' while %s is live", y->name, other);
@@ -381,19 +363,20 @@ static int do_move(C *c, int s, int dest, uint32_t line, uint32_t col)
     Sym *y = &c->sym[s];
     Obj *o = &c->obj[y->obj];
     char other[64], msg[160];
-    if (o->moved) {
+    uint64_t decision = osc_owner_move(o->moved, o->n_shared, o->n_mut, y->loop_depth, c->loop_depth);
+    if (decision == OSC_OWN_MOVED) {
         int mb = maybe_path(c, y);
         tr_ev(c, OSC_EV_MOVE, y->obj, dest, -1, -1, line, 1);
-        snprintf(msg, sizeof msg, mb ? "'%s' moved again after it may have been moved at line %u (moved on some path of an 'if')" : "'%s' moved again after it was moved at line %u", y->name, o->move_line);
+        snprintf(msg, sizeof msg, mb ? "'%s' moved again after it may have been moved at line %u (moved on some path of an 'if')" : "'%s' moved again after it was moved at line %u", y->name, o->moveline);
         return diag_own(c, OSC_DIAG_USE_AFTER_MOVE, line, col, s, NULL, mb ? "use after maybe-move" : "use after move", msg);
     }
-    if (o->n_shared || o->n_mut) {
+    if (decision == OSC_OWN_ALIAS) {
         conflict_name(c, y->obj, -1, 0, other, sizeof other);
         tr_ev(c, OSC_EV_MOVE, y->obj, dest, -1, -1, line, 1);
         snprintf(msg, sizeof msg, "move of '%s' while %s is live", y->name, other);
         return diag_own(c, OSC_DIAG_MUTABLE_ALIAS, line, col, s, other, "move while borrowed", msg);
     }
-    if (y->loop_depth < c->loop_depth) {
+    if (decision == OSC_OWN_LOOP_MOVE) {
         /* first iteration moves, the next iteration would use a moved owner */
         tr_ev(c, OSC_EV_MOVE, y->obj, dest, -1, -1, line, 0);
         int d2 = -1;
@@ -405,7 +388,7 @@ static int do_move(C *c, int s, int dest, uint32_t line, uint32_t col)
     }
     tr_ev(c, OSC_EV_MOVE, y->obj, dest, -1, -1, line, 0);
     o->moved = 1;
-    o->move_line = line;
+    o->moveline = line;
     return 0;
 }
 
@@ -557,7 +540,8 @@ static void hs_settle(C *c, const HSave *before, const HSave *other, uint32_t li
 {
     for (int i = 0; i < before->nsym; i++) {
         if (c->sym[i].kind != SK_HANDLE) continue;
-        if (c->sym[i].prov != before->hprov[i] || (other && other->hprov[i] != before->hprov[i])) c->sym[i].prov = -1;
+        int initial = before->hprov[i];
+        c->sym[i].prov = (int)osc_join_handle(initial, c->sym[i].prov, other ? other->hprov[i] : initial);
     }
     for (int p = 0; p < before->nprov; p++)
         if (c->pfreed[p] && !before->pfreed[p] && c->pmhnd[p])
@@ -1809,7 +1793,7 @@ static int chk_if(C *c, int i)
         hs_restore(c, h1);
     } else if (!t1) {
         /* OSC-3 item 2: freed only if freed on both paths */
-        for (int p = 0; p < h0->nprov; p++) c->pfreed[p] = (uint8_t)(c->pfreed[p] && h1->pfreed[p]);
+        osc_join_frees(h1->pfreed, h0->nprov, c->pfreed, h0->nprov);
         /* OSC-3 item 3 (drop flags): an owner moved on one path and not (or
          * only maybe) on the other is maybe-moved after the `if`. Its
          * declaration gets a drop flag: set at the declaration, cleared at
@@ -1817,10 +1801,7 @@ static int chk_if(C *c, int i)
          * definitely moved (no flag). Neither: unchanged. Pre-existing
          * objects are never OM_GONE on a path that falls through. */
         for (int o = 0; o < nobj0; o++) {
-            int m1 = s1->obj[o].moved, m2 = c->obj[o].moved;
-            if (m1 == m2) continue;
-            if (m2 == OM_LIVE || (m2 == OM_MOVED && m1 == OM_MAYBE)) c->obj[o].move_line = s1->obj[o].move_line;
-            c->obj[o].moved = OM_MAYBE;
+            if (!osc_join_owner(&s1->obj[o], &c->obj[o])) continue;
             int sym = c->obj[o].sym;
             if (sym >= 0) NODE(c->sym[sym].decl)->dflag = 1;
         }
@@ -1829,7 +1810,7 @@ static int chk_if(C *c, int i)
     /* re-emit moves that hold after the if */
     for (int o = 0; o < nobj0; o++)
         if (c->obj[o].moved == 1 && s0->obj[o].moved != 1)
-            tr_ev(c, OSC_EV_MOVE, o, -1, -1, -1, c->obj[o].move_line, 0);
+            tr_ev(c, OSC_EV_MOVE, o, -1, -1, -1, c->obj[o].moveline, 0);
     hs_settle(c, h0, t1 || t2 ? NULL : h1, n->line);
     rc = 0;
 out:
@@ -1866,15 +1847,10 @@ static int chk_loop_body(C *c, OscNode *n, int is_for)
     c->loop_depth--;
     tr_restore(c, n->line);
     snap_restore(c, s0);
-    {
-        /* OSC-3 item 2: frees in the body are not definite after the loop;
-         * handles assigned in the body become unknown */
-        int keep[OSC_CHECK_MAX_SYMS];
-        for (int k = 0; k < h0->nsym; k++) keep[k] = c->sym[k].prov;
-        hs_restore(c, h0);
-        for (int k = 0; k < h0->nsym; k++) c->sym[k].prov = keep[k];
-        hs_settle(c, h0, NULL, n->line);
-    }
+    /* A loop can run zero times. Restore the definite frees from before
+     * entry, then settle handle assignments against the body that ran. */
+    memcpy(c->pfreed, h0->pfreed, (size_t)h0->nprov);
+    hs_settle(c, h0, NULL, n->line);
     c->term = 0;
     rc = 0;
 out:
@@ -2056,7 +2032,7 @@ static int chk_stmt(C *c, int i)
             return -1;
         }
         Bor *old = &c->bor[y->bor];
-        if (old->kids_shared || old->kids_mut) {
+        if (old->n_shared || old->n_mut) {
             char other[64];
             conflict_name(c, -1, y->bor, 0, other, sizeof other);
             tr_ev(c, OSC_EV_END_BORROW, -1, -1, y->bor, -1, n->line, 1);
diff --git a/src/omega_api_decl.h b/src/omega_api_decl.h
index dd89def5f4d60eb84f21a69be54f393da9ca2988..1fbadd38c182b008e04af6358689fc46f26c95ee 100644
--- a/src/omega_api_decl.h
+++ b/src/omega_api_decl.h
@@ -170,6 +170,70 @@ uint64_t rx_fus_eligible_kind(uint64_t o_k);
 #define OSC_LITERAL_OVERFLOW 2
 /* export fn osc_parse_literal spelling view uchar * value out ulong 1 to ulong */
 uint64_t osc_parse_literal(const uint8_t *o_spelling, size_t o_spelling_len, uint64_t o_value[1]);
+#define OSC_OWN_ALLOWED 0
+#define OSC_OWN_MOVED 1
+#define OSC_OWN_ALIAS 2
+#define OSC_OWN_READ_ONLY 3
+#define OSC_OWN_LOOP_MOVE 4
+typedef struct {
+    uint8_t moved;
+    uint8_t ombr_pad1[1];
+    uint16_t n_shared;
+    uint16_t n_mut;
+    uint8_t ombr_pad6[2];
+    uint32_t moveline;
+    int32_t sym;
+    int32_t arena1;
+} OscCheckedOwner;
+OMBR_ASSERT(sizeof(OscCheckedOwner) == 20, "layout oscowner size");
+OMBR_ASSERT(offsetof(OscCheckedOwner, moved) == 0, "layout oscowner field moved");
+OMBR_ASSERT(offsetof(OscCheckedOwner, n_shared) == 2, "layout oscowner field n_shared");
+OMBR_ASSERT(offsetof(OscCheckedOwner, n_mut) == 4, "layout oscowner field n_mut");
+OMBR_ASSERT(offsetof(OscCheckedOwner, moveline) == 8, "layout oscowner field moveline");
+OMBR_ASSERT(offsetof(OscCheckedOwner, sym) == 12, "layout oscowner field sym");
+OMBR_ASSERT(offsetof(OscCheckedOwner, arena1) == 16, "layout oscowner field arena1");
+typedef struct {
+    uint8_t live;
+    uint8_t mut;
+    uint8_t ombr_pad2[2];
+    int32_t obj;
+    int32_t parent;
+    uint16_t n_shared;
+    uint16_t n_mut;
+    uint32_t line;
+    int32_t sym;
+} OscCheckedBorrow;
+OMBR_ASSERT(sizeof(OscCheckedBorrow) == 24, "layout oscbor size");
+OMBR_ASSERT(offsetof(OscCheckedBorrow, live) == 0, "layout oscbor field live");
+OMBR_ASSERT(offsetof(OscCheckedBorrow, mut) == 1, "layout oscbor field mut");
+OMBR_ASSERT(offsetof(OscCheckedBorrow, obj) == 4, "layout oscbor field obj");
+OMBR_ASSERT(offsetof(OscCheckedBorrow, parent) == 8, "layout oscbor field parent");
+OMBR_ASSERT(offsetof(OscCheckedBorrow, n_shared) == 12, "layout oscbor field n_shared");
+OMBR_ASSERT(offsetof(OscCheckedBorrow, n_mut) == 14, "layout oscbor field n_mut");
+OMBR_ASSERT(offsetof(OscCheckedBorrow, line) == 16, "layout oscbor field line");
+OMBR_ASSERT(offsetof(OscCheckedBorrow, sym) == 20, "layout oscbor field sym");
+/* export fn osc_owner_access moved ulong exclusive ulong shared_count ulong mut_count ulong to ulong */
+uint64_t osc_owner_access(uint64_t o_moved, uint64_t o_exclusive, uint64_t o_shared_count, uint64_t o_mut_count);
+/* export fn osc_borrow_access writable ulong exclusive ulong shared_count ulong mut_count ulong to ulong */
+uint64_t osc_borrow_access(uint64_t o_writable, uint64_t o_exclusive, uint64_t o_shared_count, uint64_t o_mut_count);
+/* export fn osc_owner_move moved ulong shared_count ulong mut_count ulong declaration_depth long loop_depth long to ulong */
+uint64_t osc_owner_move(uint64_t o_moved, uint64_t o_shared_count, uint64_t o_mut_count, int64_t o_declaration_depth, int64_t o_loop_depth);
+/* export fn osc_join_owner taken view oscowner remaining edit oscowner to ulong */
+uint64_t osc_join_owner(const OscCheckedOwner *o_taken, OscCheckedOwner *o_remaining);
+/* export fn osc_join_handle before long current long other long to long */
+int64_t osc_join_handle(int64_t o_before, int64_t o_current, int64_t o_other);
+/* export fn osc_join_frees taken view uchar * remaining edit uchar * to void */
+void osc_join_frees(const uint8_t *o_taken, size_t o_taken_len, uint8_t *o_remaining, size_t o_remaining_len);
+/* export fn osc_init_owner item edit oscowner symbol long to void */
+void osc_init_owner(OscCheckedOwner *o_item, int64_t o_symbol);
+/* export fn osc_open_borrow owner edit oscowner child edit oscbor object long mutable ulong source_line ulong to void */
+void osc_open_borrow(OscCheckedOwner *o_owner, OscCheckedBorrow *o_child, int64_t o_object, uint64_t o_mutable, uint64_t o_source_line);
+/* export fn osc_open_reborrow parent edit oscbor child edit oscbor object long parent_id long mutable ulong source_line ulong to void */
+void osc_open_reborrow(OscCheckedBorrow *o_parent, OscCheckedBorrow *o_child, int64_t o_object, int64_t o_parent_id, uint64_t o_mutable, uint64_t o_source_line);
+/* export fn osc_close_borrow owner edit oscowner child edit oscbor to void */
+void osc_close_borrow(OscCheckedOwner *o_owner, OscCheckedBorrow *o_child);
+/* export fn osc_close_reborrow parent edit oscbor child edit oscbor to void */
+void osc_close_reborrow(OscCheckedBorrow *o_parent, OscCheckedBorrow *o_child);
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/omega_native.h b/src/omega_native.h
index ce0e42d18bcd36f923cede6bf9db5e22baddbee2..d06182492af9a998df792bef88f680666b7130d0 100644
--- a/src/omega_native.h
+++ b/src/omega_native.h
@@ -211,6 +211,30 @@ uint32_t omega2_rx_fus_eligible_kind(uint64_t *result, uint64_t o_k);
 const char *omega2_ident_osc_literal(void);
 /* export fn osc_parse_literal spelling view uchar * value out ulong 1 to ulong */
 uint32_t omega2_osc_parse_literal(uint64_t *result, const uint8_t *o_spelling, uint64_t o_spelling_len, uint64_t *o_value);
+#define OMEGA2_IDENT_osc_ownership "omega-ident 1 unit=osc_ownership abi=2 profile=OM-2 src=4057f369075c9ea7e8df9c208f640eb5361dacd2608138cb04b853db082c4d33 omc=b6129ed51e07dd8ef7f33e78fdff99d6c4d914e3bccdaf8b344043b95017d4f2"
+const char *omega2_ident_osc_ownership(void);
+/* export fn osc_owner_access moved ulong exclusive ulong shared_count ulong mut_count ulong to ulong */
+uint32_t omega2_osc_owner_access(uint64_t *result, uint64_t o_moved, uint64_t o_exclusive, uint64_t o_shared_count, uint64_t o_mut_count);
+/* export fn osc_borrow_access writable ulong exclusive ulong shared_count ulong mut_count ulong to ulong */
+uint32_t omega2_osc_borrow_access(uint64_t *result, uint64_t o_writable, uint64_t o_exclusive, uint64_t o_shared_count, uint64_t o_mut_count);
+/* export fn osc_owner_move moved ulong shared_count ulong mut_count ulong declaration_depth long loop_depth long to ulong */
+uint32_t omega2_osc_owner_move(uint64_t *result, uint64_t o_moved, uint64_t o_shared_count, uint64_t o_mut_count, uint64_t o_declaration_depth, uint64_t o_loop_depth);
+/* export fn osc_join_owner taken view oscowner remaining edit oscowner to ulong */
+uint32_t omega2_osc_join_owner(uint64_t *result, const uint8_t *o_taken, uint8_t *o_remaining);
+/* export fn osc_join_handle before long current long other long to long */
+uint32_t omega2_osc_join_handle(uint64_t *result, uint64_t o_before, uint64_t o_current, uint64_t o_other);
+/* export fn osc_join_frees taken view uchar * remaining edit uchar * to void */
+uint32_t omega2_osc_join_frees(uint64_t *result, const uint8_t *o_taken, uint64_t o_taken_len, uint8_t *o_remaining, uint64_t o_remaining_len);
+/* export fn osc_init_owner item edit oscowner symbol long to void */
+uint32_t omega2_osc_init_owner(uint64_t *result, uint8_t *o_item, uint64_t o_symbol);
+/* export fn osc_open_borrow owner edit oscowner child edit oscbor object long mutable ulong source_line ulong to void */
+uint32_t omega2_osc_open_borrow(uint64_t *result, uint8_t *o_owner, uint8_t *o_child, uint64_t o_object, uint64_t o_mutable, uint64_t o_source_line);
+/* export fn osc_open_reborrow parent edit oscbor child edit oscbor object long parent_id long mutable ulong source_line ulong to void */
+uint32_t omega2_osc_open_reborrow(uint64_t *result, uint8_t *o_parent, uint8_t *o_child, uint64_t o_object, uint64_t o_parent_id, uint64_t o_mutable, uint64_t o_source_line);
+/* export fn osc_close_borrow owner edit oscowner child edit oscbor to void */
+uint32_t omega2_osc_close_borrow(uint64_t *result, uint8_t *o_owner, uint8_t *o_child);
+/* export fn osc_close_reborrow parent edit oscbor child edit oscbor to void */
+uint32_t omega2_osc_close_reborrow(uint64_t *result, uint8_t *o_parent, uint8_t *o_child);
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/omega_om_units.c b/src/omega_om_units.c
index 535bd15af1b84d1976d1325f1fe348f4f9d43553..d2f71849e40dc4eade49d467b4cd649c1bdcda39 100644
--- a/src/omega_om_units.c
+++ b/src/omega_om_units.c
@@ -1971,6 +1971,253 @@ __attribute__((visibility("default"))) uint32_t omega2_osc_parse_literal(uint64_
         return OMEGA_BAD_ARG;
     return ombr2_run(ombr2_entry_osc_parse_literal, a, result, 1, ou, no);
 }
+__asm__(".section .text.omega_bridge,\"ax\",@progbits\n.balign 4\n.local ombr2_code_osc_ownership\n.hidden ombr2_code_osc_ownership\nombr2_code_osc_ownership:\n.byte 0x18,0x00,0x00,0x14,0x2b,0x00,0x00,0x14,0x42,0x00,0x00,0x14,0x60,0x00,0x00,0x14,0x79,0x00,0x00,0x14,0x81,0x00,0x00,0x14,0xad,0x00,0x00,0x14,0xe7,0x00,0x00,0x14,0x0a,0x01,0x00,0x14,0x2f,0x01,0x00,0x14,0x43,0x01,0x00,0x14,0x5f,0x00,0x00,0xf1,0xe3,0x07,0x9f,0x9a,0x1f,0x00,0x00,0xf1,0xe4,0x07,0x9f,0x9a,0x3f,0x00,0x00,0xf1,0xe5,0x07,0x9f,0x9a,0x86,0x00,0x05,0x8a,0x68,0x00,0x06,0xaa,0x68,0x00,0x00,0xb4,0x40,0x00,0x80,0xd2,0xc0,0x03,0x5f,0xd6,0x00,0x00,0x80,0xd2,0xc0,0x03,0x5f,0xd6,0x1f,0x00,0x00,0xf1,0x60,0x00,0x00,0x54,0x20,0x00,0x80,0xd2,0xc0,0x03,0x5f,0xd6,0xff,0xc3,0x00,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xfe,0x13,0x00,0xf9,0xe0,0x07,0x40,0xf9,0xe1,0x0b,0x40,0xf9,0xe2,0x0f,0x40,0xf9,0xe6,0xff,0xff,0x97,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xfe,0x13,0x40,0xf9,0xff,0xc3,0x00,0x91,0xc0,0x03,0x5f,0xd6,0x3f,0x00,0x00,0xf1,0xe4,0x07,0x9f,0x9a,0x1f,0x00,0x00,0xf1,0xe5,0x17,0x9f,0x9a,0x86,0x00,0x05,0x8a,0x66,0x00,0x00,0xb4,0x60,0x00,0x80,0xd2,0xc0,0x03,0x5f,0xd6,0xff,0xc3,0x00,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xfe,0x13,0x00,0xf9,0xe0,0x07,0x40,0xf9,0xe1,0x0b,0x40,0xf9,0xe2,0x0f,0x40,0xf9,0xce,0xff,0xff,0x97,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xfe,0x13,0x40,0xf9,0xff,0xc3,0x00,0x91,0xc0,0x03,0x5f,0xd6,0xff,0x03,0x01,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xfe,0x1b,0x00,0xf9,0xe0,0x03,0x40,0xf9,0x21,0x00,0x80,0xd2,0xe2,0x07,0x40,0xf9,0xe3,0x0b,0x40,0xf9,0xc8,0xff,0xff,0x97,0xe5,0x03,0x00,0xaa,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xfe,0x1b,0x40,0xf9,0xff,0x03,0x01,0x91,0xbf,0x00,0x00,0xf1,0x60,0x00,0x00,0x54,0xe0,0x03,0x05,0xaa,0xc0,0x03,0x5f,0xd6,0x7f,0x00,0x04,0xeb,0x6a,0x00,0x00,0x54,0x80,0x00,0x80,0xd2,0xc0,0x03,0x5f,0xd6,0x00,0x00,0x80,0xd2,0xc0,0x03,0x5f,0xd6,0x03,0x00,0x80,0xd2,0x02,0x68,0x63,0x38,0x04,0x00,0x80,0xd2,0x23,0x68,0x64,0x38,0x5f,0x00,0x03,0xeb,0x61,0x00,0x00,0x54,0x00,0x00,0x80,0xd2,0xc0,0x03,0x5f,0xd6,0x7f,0x00,0x00,0xf1,0xe4,0x17,0x9f,0x9a,0x7f,0x04,0x00,0xf1,0xe5,0x17,0x9f,0x9a,0x5f,0x0c,0x00,0xf1,0xe6,0x17,0x9f,0x9a,0xa8,0x00,0x06,0x8a,0x89,0x00,0x08,0xaa,0xa9,0x00,0x00,0xb4,0x04,0x01,0x80,0xd2,0x05,0x68,0x64,0xb8,0x06,0x01,0x80,0xd2,0x25,0x68,0x26,0xb8,0x64,0x00,0x80,0xd2,0x05,0x00,0x80,0xd2,0x24,0x68,0x25,0x38,0x20,0x00,0x80,0xd2,0xc0,0x03,0x5f,0xd6,0x3f,0x00,0x00,0xeb,0xe3,0x07,0x9f,0x9a,0x5f,0x00,0x00,0xeb,0xe4,0x07,0x9f,0x9a,0x65,0x00,0x04,0xaa,0x65,0x00,0x00,0xb4,0x00,0x00,0x80,0x92,0xc0,0x03,0x5f,0xd6,0xc0,0x03,0x5f,0xd6,0x3f,0x00,0x03,0xeb,0x41,0x05,0x00,0x54,0x04,0x00,0x80,0xd2,0x05,0x00,0x80,0xd2,0x9f,0x00,0x03,0xeb,0xc2,0x03,0x00,0x54,0x06,0x48,0x88,0xd2,0xe6,0x01,0xa0,0xf2,0xbf,0x00,0x06,0xeb,0x02,0x04,0x00,0x54,0xa5,0x04,0x00,0x91,0x9f,0x00,0x01,0xeb,0x62,0x03,0x00,0x54,0x06,0x68,0x64,0x38,0xdf,0x00,0x00,0xf1,0xe8,0x07,0x9f,0x9a,0x9f,0x00,0x03,0xeb,0xc2,0x02,0x00,0x54,0x49,0x68,0x64,0x38,0x3f,0x01,0x00,0xf1,0xea,0x07,0x9f,0x9a,0x0b,0x01,0x0a,0x8a,0xcb,0x00,0x00,0xb4,0x26,0x00,0x80,0xd2,0x9f,0x00,0x03,0xeb,0xc2,0x01,0x00,0x54,0x46,0x68,0x24,0x38,0x05,0x00,0x00,0x14,0x06,0x00,0x80,0xd2,0x9f,0x00,0x03,0xeb,0x22,0x01,0x00,0x54,0x46,0x68,0x24,0x38,0x84,0x04,0x00,0x91,0x9f,0x00,0x03,0xeb,0x83,0xfc,0xff,0x54,0xc0,0x03,0x5f,0xd6,0xe0,0x03,0x07,0xaa,0xf0,0x08,0x40,0xf9,0x00,0x02,0x1f,0xd6,0x61,0x00,0x80,0xd2,0xfc,0xff,0xff,0x17,0x81,0x00,0x80,0xd2,0xfa,0xff,0xff,0x17,0x21,0x01,0x80,0xd2,0xf8,0xff,0xff,0x17,0x02,0x00,0x80,0xd2,0x03,0x00,0x80,0xd2,0x02,0x68,0x23,0x38,0x02,0x00,0x80,0xd2,0x43,0x00,0x80,0xd2,0x02,0x68,0x23,0x78,0x02,0x00,0x80,0xd2,0x83,0x00,0x80,0xd2,0x02,0x68,0x23,0x78,0x02,0x00,0x80,0xd2,0x03,0x01,0x80,0xd2,0x02,0x68,0x23,0xb8,0x3f,0xc0,0x21,0xeb,0x41,0x01,0x00,0x54,0x82,0x01,0x80,0xd2,0x01,0x68,0x22,0xb8,0x02,0x00,0x80,0xd2,0x03,0x02,0x80,0xd2,0x02,0x68,0x23,0xb8,0xc0,0x03,0x5f,0xd6,0xe0,0x03,0x07,0xaa,0xf0,0x08,0x40,0xf9,0x00,0x02,0x1f,0xd6,0xa1,0x00,0x80,0xd2,0xfc,0xff,0xff,0x17,0x25,0x00,0x80,0xd2,0x06,0x00,0x80,0xd2,0x05,0x68,0x26,0x38,0x65,0xfc,0x48,0xd3,0x85,0x03,0x00,0xb5,0x26,0x00,0x80,0xd2,0x03,0x68,0x26,0x38,0x3f,0xc0,0x21,0xeb,0x01,0x03,0x00,0x54,0x85,0x00,0x80,0xd2,0x01,0x68,0x25,0xb8,0x5f,0xc0,0x22,0xeb,0x81,0x02,0x00,0x54,0x05,0x01,0x80,0xd2,0x02,0x68,0x25,0xb8,0x05,0x00,0x80,0xd2,0x86,0x01,0x80,0xd2,0x05,0x68,0x26,0x78,0x05,0x00,0x80,0xd2,0xc6,0x01,0x80,0xd2,0x05,0x68,0x26,0x78,0x85,0xfc,0x60,0xd3,0x45,0x01,0x00,0xb5,0x06,0x02,0x80,0xd2,0x04,0x68,0x26,0xb8,0x05,0x00,0x80,0x92,0x86,0x02,0x80,0xd2,0x05,0x68,0x26,0xb8,0xc0,0x03,0x5f,0xd6,0xe0,0x03,0x07,0xaa,0xf0,0x08,0x40,0xf9,0x00,0x02,0x1f,0xd6,0xa1,0x00,0x80,0xd2,0xfc,0xff,0xff,0x17,0xff,0xc3,0x00,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xfe,0x17,0x00,0xf9,0xe0,0x07,0x40,0xf9,0xe1,0x0b,0x40,0xf9,0x02,0x00,0x80,0x92,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xd2,0xff,0xff,0x97,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xfe,0x17,0x40,0xf9,0xff,0xc3,0x00,0x91,0x7f,0x00,0x00,0xf1,0x00,0x01,0x00,0x54,0x85,0x00,0x80,0xd2,0x06,0x68,0x65,0x78,0xc8,0x04,0x00,0x91,0x08,0x3d,0x40,0xd3,0x89,0x00,0x80,0xd2,0x08,0x68,0x29,0x78,0x07,0x00,0x00,0x14,0x45,0x00,0x80,0xd2,0x06,0x68,0x65,0x78,0xc8,0x04,0x00,0x91,0x08,0x3d,0x40,0xd3,0x49,0x00,0x80,0xd2,0x08,0x68,0x29,0x78,0xc0,0x03,0x5f,0xd6,0xff,0x03,0x01,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xfe,0x1b,0x00,0xf9,0xe0,0x07,0x40,0xf9,0xe1,0x0b,0x40,0xf9,0xe2,0x0f,0x40,0xf9,0xe3,0x13,0x40,0xf9,0xe4,0x17,0x40,0xf9,0xad,0xff,0xff,0x97,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x17,0x40,0xf9,0xfe,0x1b,0x40,0xf9,0xff,0x03,0x01,0x91,0x9f,0x00,0x00,0xf1,0x00,0x01,0x00,0x54,0xc6,0x01,0x80,0xd2,0x08,0x68,0x66,0x78,0x09,0x05,0x00,0x91,0x29,0x3d,0x40,0xd3,0xca,0x01,0x80,0xd2,0x09,0x68,0x2a,0x78,0x07,0x00,0x00,0x14,0x86,0x01,0x80,0xd2,0x08,0x68,0x66,0x78,0x09,0x05,0x00,0x91,0x29,0x3d,0x40,0xd3,0x8a,0x01,0x80,0xd2,0x09,0x68,0x2a,0x78,0xc0,0x03,0x5f,0xd6,0x02,0x00,0x80,0xd2,0x03,0x00,0x80,0xd2,0x22,0x68,0x23,0x38,0x22,0x00,0x80,0xd2,0x23,0x68,0x62,0x38,0x7f,0x00,0x00,0xf1,0x00,0x01,0x00,0x54,0x82,0x00,0x80,0xd2,0x03,0x68,0x62,0x78,0x64,0x04,0x00,0xd1,0x84,0x3c,0x40,0xd3,0x85,0x00,0x80,0xd2,0x04,0x68,0x25,0x78,0x07,0x00,0x00,0x14,0x42,0x00,0x80,0xd2,0x03,0x68,0x62,0x78,0x64,0x04,0x00,0xd1,0x84,0x3c,0x40,0xd3,0x45,0x00,0x80,0xd2,0x04,0x68,0x25,0x78,0xc0,0x03,0x5f,0xd6,0x02,0x00,0x80,0xd2,0x03,0x00,0x80,0xd2,0x22,0x68,0x23,0x38,0x22,0x00,0x80,0xd2,0x23,0x68,0x62,0x38,0x7f,0x00,0x00,0xf1,0x00,0x01,0x00,0x54,0xc2,0x01,0x80,0xd2,0x03,0x68,0x62,0x78,0x64,0x04,0x00,0xd1,0x84,0x3c,0x40,0xd3,0xc5,0x01,0x80,0xd2,0x04,0x68,0x25,0x78,0x07,0x00,0x00,0x14,0x82,0x01,0x80,0xd2,0x03,0x68,0x62,0x78,0x64,0x04,0x00,0xd1,0x84,0x3c,0x40,0xd3,0x85,0x01,0x80,0xd2,0x04,0x68,0x25,0x78,0xc0,0x03,0x5f,0xd6\n.previous\n");
+static const char ombr2_ident_osc_ownership[] = "omega-ident 1 unit=osc_ownership abi=2 profile=OM-2 src=4057f369075c9ea7e8df9c208f640eb5361dacd2608138cb04b853db082c4d33 omc=b6129ed51e07dd8ef7f33e78fdff99d6c4d914e3bccdaf8b344043b95017d4f2";
+__attribute__((visibility("default"))) const char *omega2_ident_osc_ownership(void)
+{
+    return ombr2_ident_osc_ownership;
+}
+__asm__(".section .text.omega_bridge,\"ax\",@progbits\n.balign 4\n.local ombr2_entry_osc_owner_access\n.hidden ombr2_entry_osc_owner_access\nombr2_entry_osc_owner_access:\nhint #34\nb ombr2_code_osc_ownership+0\n.previous\n");
+extern const unsigned char ombr2_entry_osc_owner_access[] __attribute__((visibility("hidden")));
+/* export fn osc_owner_access moved ulong exclusive ulong shared_count ulong mut_count ulong to ulong */
+__attribute__((visibility("default"))) uint32_t omega2_osc_owner_access(uint64_t *result, uint64_t o_moved, uint64_t o_exclusive, uint64_t o_shared_count, uint64_t o_mut_count)
+{
+    ombr_span sp[7];
+    unsigned ns = 0;
+    uint64_t a[6] = {0};
+    ombr2_out ou[6] = {{0, 0, 0}};
+    unsigned no = 0;
+    if (ombr_span_add(sp, &ns, result, 1u, 1u, 8u, 1))
+        return OMEGA_BAD_ARG;
+    a[0] = o_moved;
+    a[1] = o_exclusive;
+    a[2] = o_shared_count;
+    a[3] = o_mut_count;
+    if (ombr2_overlap(sp, ns))
+        return OMEGA_BAD_ARG;
+    return ombr2_run(ombr2_entry_osc_owner_access, a, result, 1, ou, no);
+}
+__asm__(".section .text.omega_bridge,\"ax\",@progbits\n.balign 4\n.local ombr2_entry_osc_borrow_access\n.hidden ombr2_entry_osc_borrow_access\nombr2_entry_osc_borrow_access:\nhint #34\nb ombr2_code_osc_ownership+4\n.previous\n");
+extern const unsigned char ombr2_entry_osc_borrow_access[] __attribute__((visibility("hidden")));
+/* export fn osc_borrow_access writable ulong exclusive ulong shared_count ulong mut_count ulong to ulong */
+__attribute__((visibility("default"))) uint32_t omega2_osc_borrow_access(uint64_t *result, uint64_t o_writable, uint64_t o_exclusive, uint64_t o_shared_count, uint64_t o_mut_count)
+{
+    ombr_span sp[7];
+    unsigned ns = 0;
+    uint64_t a[6] = {0};
+    ombr2_out ou[6] = {{0, 0, 0}};
+    unsigned no = 0;
+    if (ombr_span_add(sp, &ns, result, 1u, 1u, 8u, 1))
+        return OMEGA_BAD_ARG;
+    a[0] = o_writable;
+    a[1] = o_exclusive;
+    a[2] = o_shared_count;
+    a[3] = o_mut_count;
+    if (ombr2_overlap(sp, ns))
+        return OMEGA_BAD_ARG;
+    return ombr2_run(ombr2_entry_osc_borrow_access, a, result, 1, ou, no);
+}
+__asm__(".section .text.omega_bridge,\"ax\",@progbits\n.balign 4\n.local ombr2_entry_osc_owner_move\n.hidden ombr2_entry_osc_owner_move\nombr2_entry_osc_owner_move:\nhint #34\nb ombr2_code_osc_ownership+8\n.previous\n");
+extern const unsigned char ombr2_entry_osc_owner_move[] __attribute__((visibility("hidden")));
+/* export fn osc_owner_move moved ulong shared_count ulong mut_count ulong declaration_depth long loop_depth long to ulong */
+__attribute__((visibility("default"))) uint32_t omega2_osc_owner_move(uint64_t *result, uint64_t o_moved, uint64_t o_shared_count, uint64_t o_mut_count, uint64_t o_declaration_depth, uint64_t o_loop_depth)
+{
+    ombr_span sp[7];
+    unsigned ns = 0;
+    uint64_t a[6] = {0};
+    ombr2_out ou[6] = {{0, 0, 0}};
+    unsigned no = 0;
+    if (ombr_span_add(sp, &ns, result, 1u, 1u, 8u, 1))
+        return OMEGA_BAD_ARG;
+    a[0] = o_moved;
+    a[1] = o_shared_count;
+    a[2] = o_mut_count;
+    a[3] = o_declaration_depth;
+    a[4] = o_loop_depth;
+    if (ombr2_overlap(sp, ns))
+        return OMEGA_BAD_ARG;
+    return ombr2_run(ombr2_entry_osc_owner_move, a, result, 1, ou, no);
+}
+__asm__(".section .text.omega_bridge,\"ax\",@progbits\n.balign 4\n.local ombr2_entry_osc_join_owner\n.hidden ombr2_entry_osc_join_owner\nombr2_entry_osc_join_owner:\nhint #34\nb ombr2_code_osc_ownership+12\n.previous\n");
+extern const unsigned char ombr2_entry_osc_join_owner[] __attribute__((visibility("hidden")));
+/* export fn osc_join_owner taken view oscowner remaining edit oscowner to ulong */
+__attribute__((visibility("default"))) uint32_t omega2_osc_join_owner(uint64_t *result, const uint8_t *o_taken, uint8_t *o_remaining)
+{
+    ombr_span sp[7];
+    unsigned ns = 0;
+    uint64_t a[6] = {0};
+    ombr2_out ou[6] = {{0, 0, 0}};
+    unsigned no = 0;
+    if (ombr_span_add(sp, &ns, result, 1u, 1u, 8u, 1))
+        return OMEGA_BAD_ARG;
+    if (ombr2_fixed(sp, &ns, o_taken, 20u, 1u, 0))
+        return OMEGA_BAD_ARG;
+    a[0] = (uint64_t)(uintptr_t)o_taken;
+    if (ombr2_fixed(sp, &ns, o_remaining, 20u, 1u, 1))
+        return OMEGA_BAD_ARG;
+    a[1] = (uint64_t)(uintptr_t)o_remaining;
+    if (ombr2_overlap(sp, ns))
+        return OMEGA_BAD_ARG;
+    return ombr2_run(ombr2_entry_osc_join_owner, a, result, 1, ou, no);
+}
+__asm__(".section .text.omega_bridge,\"ax\",@progbits\n.balign 4\n.local ombr2_entry_osc_join_handle\n.hidden ombr2_entry_osc_join_handle\nombr2_entry_osc_join_handle:\nhint #34\nb ombr2_code_osc_ownership+16\n.previous\n");
+extern const unsigned char ombr2_entry_osc_join_handle[] __attribute__((visibility("hidden")));
+/* export fn osc_join_handle before long current long other long to long */
+__attribute__((visibility("default"))) uint32_t omega2_osc_join_handle(uint64_t *result, uint64_t o_before, uint64_t o_current, uint64_t o_other)
+{
+    ombr_span sp[7];
+    unsigned ns = 0;
+    uint64_t a[6] = {0};
+    ombr2_out ou[6] = {{0, 0, 0}};
+    unsigned no = 0;
+    if (ombr_span_add(sp, &ns, result, 1u, 1u, 8u, 1))
+        return OMEGA_BAD_ARG;
+    a[0] = o_before;
+    a[1] = o_current;
+    a[2] = o_other;
+    if (ombr2_overlap(sp, ns))
+        return OMEGA_BAD_ARG;
+    return ombr2_run(ombr2_entry_osc_join_handle, a, result, 1, ou, no);
+}
+__asm__(".section .text.omega_bridge,\"ax\",@progbits\n.balign 4\n.local ombr2_entry_osc_join_frees\n.hidden ombr2_entry_osc_join_frees\nombr2_entry_osc_join_frees:\nhint #34\nb ombr2_code_osc_ownership+20\n.previous\n");
+extern const unsigned char ombr2_entry_osc_join_frees[] __attribute__((visibility("hidden")));
+/* export fn osc_join_frees taken view uchar * remaining edit uchar * to void */
+__attribute__((visibility("default"))) uint32_t omega2_osc_join_frees(uint64_t *result, const uint8_t *o_taken, uint64_t o_taken_len, uint8_t *o_remaining, uint64_t o_remaining_len)
+{
+    ombr_span sp[7];
+    unsigned ns = 0;
+    uint64_t a[6] = {0};
+    ombr2_out ou[6] = {{0, 0, 0}};
+    unsigned no = 0;
+    if (ombr_span_add(sp, &ns, result, 1u, 1u, 8u, 1))
+        return OMEGA_BAD_ARG;
+    if (ombr2_view(sp, &ns, o_taken, o_taken_len, 1u, 0))
+        return OMEGA_BAD_ARG;
+    a[0] = (uint64_t)(uintptr_t)o_taken;
+    a[1] = o_taken_len;
+    if (ombr2_view(sp, &ns, o_remaining, o_remaining_len, 1u, 1))
+        return OMEGA_BAD_ARG;
+    a[2] = (uint64_t)(uintptr_t)o_remaining;
+    a[3] = o_remaining_len;
+    if (ombr2_overlap(sp, ns))
+        return OMEGA_BAD_ARG;
+    return ombr2_run(ombr2_entry_osc_join_frees, a, result, 0, ou, no);
+}
+__asm__(".section .text.omega_bridge,\"ax\",@progbits\n.balign 4\n.local ombr2_entry_osc_init_owner\n.hidden ombr2_entry_osc_init_owner\nombr2_entry_osc_init_owner:\nhint #34\nb ombr2_code_osc_ownership+24\n.previous\n");
+extern const unsigned char ombr2_entry_osc_init_owner[] __attribute__((visibility("hidden")));
+/* export fn osc_init_owner item edit oscowner symbol long to void */
+__attribute__((visibility("default"))) uint32_t omega2_osc_init_owner(uint64_t *result, uint8_t *o_item, uint64_t o_symbol)
+{
+    ombr_span sp[7];
+    unsigned ns = 0;
+    uint64_t a[6] = {0};
+    ombr2_out ou[6] = {{0, 0, 0}};
+    unsigned no = 0;
+    if (ombr_span_add(sp, &ns, result, 1u, 1u, 8u, 1))
+        return OMEGA_BAD_ARG;
+    if (ombr2_fixed(sp, &ns, o_item, 20u, 1u, 1))
+        return OMEGA_BAD_ARG;
+    a[0] = (uint64_t)(uintptr_t)o_item;
+    a[1] = o_symbol;
+    if (ombr2_overlap(sp, ns))
+        return OMEGA_BAD_ARG;
+    return ombr2_run(ombr2_entry_osc_init_owner, a, result, 0, ou, no);
+}
+__asm__(".section .text.omega_bridge,\"ax\",@progbits\n.balign 4\n.local ombr2_entry_osc_open_borrow\n.hidden ombr2_entry_osc_open_borrow\nombr2_entry_osc_open_borrow:\nhint #34\nb ombr2_code_osc_ownership+28\n.previous\n");
+extern const unsigned char ombr2_entry_osc_open_borrow[] __attribute__((visibility("hidden")));
+/* export fn osc_open_borrow owner edit oscowner child edit oscbor object long mutable ulong source_line ulong to void */
+__attribute__((visibility("default"))) uint32_t omega2_osc_open_borrow(uint64_t *result, uint8_t *o_owner, uint8_t *o_child, uint64_t o_object, uint64_t o_mutable, uint64_t o_source_line)
+{
+    ombr_span sp[7];
+    unsigned ns = 0;
+    uint64_t a[6] = {0};
+    ombr2_out ou[6] = {{0, 0, 0}};
+    unsigned no = 0;
+    if (ombr_span_add(sp, &ns, result, 1u, 1u, 8u, 1))
+        return OMEGA_BAD_ARG;
+    if (ombr2_fixed(sp, &ns, o_owner, 20u, 1u, 1))
+        return OMEGA_BAD_ARG;
+    a[0] = (uint64_t)(uintptr_t)o_owner;
+    if (ombr2_fixed(sp, &ns, o_child, 24u, 1u, 1))
+        return OMEGA_BAD_ARG;
+    a[1] = (uint64_t)(uintptr_t)o_child;
+    a[2] = o_object;
+    a[3] = o_mutable;
+    a[4] = o_source_line;
+    if (ombr2_overlap(sp, ns))
+        return OMEGA_BAD_ARG;
+    return ombr2_run(ombr2_entry_osc_open_borrow, a, result, 0, ou, no);
+}
+__asm__(".section .text.omega_bridge,\"ax\",@progbits\n.balign 4\n.local ombr2_entry_osc_open_reborrow\n.hidden ombr2_entry_osc_open_reborrow\nombr2_entry_osc_open_reborrow:\nhint #34\nb ombr2_code_osc_ownership+32\n.previous\n");
+extern const unsigned char ombr2_entry_osc_open_reborrow[] __attribute__((visibility("hidden")));
+/* export fn osc_open_reborrow parent edit oscbor child edit oscbor object long parent_id long mutable ulong source_line ulong to void */
+__attribute__((visibility("default"))) uint32_t omega2_osc_open_reborrow(uint64_t *result, uint8_t *o_parent, uint8_t *o_child, uint64_t o_object, uint64_t o_parent_id, uint64_t o_mutable, uint64_t o_source_line)
+{
+    ombr_span sp[7];
+    unsigned ns = 0;
+    uint64_t a[6] = {0};
+    ombr2_out ou[6] = {{0, 0, 0}};
+    unsigned no = 0;
+    if (ombr_span_add(sp, &ns, result, 1u, 1u, 8u, 1))
+        return OMEGA_BAD_ARG;
+    if (ombr2_fixed(sp, &ns, o_parent, 24u, 1u, 1))
+        return OMEGA_BAD_ARG;
+    a[0] = (uint64_t)(uintptr_t)o_parent;
+    if (ombr2_fixed(sp, &ns, o_child, 24u, 1u, 1))
+        return OMEGA_BAD_ARG;
+    a[1] = (uint64_t)(uintptr_t)o_child;
+    a[2] = o_object;
+    a[3] = o_parent_id;
+    a[4] = o_mutable;
+    a[5] = o_source_line;
+    if (ombr2_overlap(sp, ns))
+        return OMEGA_BAD_ARG;
+    return ombr2_run(ombr2_entry_osc_open_reborrow, a, result, 0, ou, no);
+}
+__asm__(".section .text.omega_bridge,\"ax\",@progbits\n.balign 4\n.local ombr2_entry_osc_close_borrow\n.hidden ombr2_entry_osc_close_borrow\nombr2_entry_osc_close_borrow:\nhint #34\nb ombr2_code_osc_ownership+36\n.previous\n");
+extern const unsigned char ombr2_entry_osc_close_borrow[] __attribute__((visibility("hidden")));
+/* export fn osc_close_borrow owner edit oscowner child edit oscbor to void */
+__attribute__((visibility("default"))) uint32_t omega2_osc_close_borrow(uint64_t *result, uint8_t *o_owner, uint8_t *o_child)
+{
+    ombr_span sp[7];
+    unsigned ns = 0;
+    uint64_t a[6] = {0};
+    ombr2_out ou[6] = {{0, 0, 0}};
+    unsigned no = 0;
+    if (ombr_span_add(sp, &ns, result, 1u, 1u, 8u, 1))
+        return OMEGA_BAD_ARG;
+    if (ombr2_fixed(sp, &ns, o_owner, 20u, 1u, 1))
+        return OMEGA_BAD_ARG;
+    a[0] = (uint64_t)(uintptr_t)o_owner;
+    if (ombr2_fixed(sp, &ns, o_child, 24u, 1u, 1))
+        return OMEGA_BAD_ARG;
+    a[1] = (uint64_t)(uintptr_t)o_child;
+    if (ombr2_overlap(sp, ns))
+        return OMEGA_BAD_ARG;
+    return ombr2_run(ombr2_entry_osc_close_borrow, a, result, 0, ou, no);
+}
+__asm__(".section .text.omega_bridge,\"ax\",@progbits\n.balign 4\n.local ombr2_entry_osc_close_reborrow\n.hidden ombr2_entry_osc_close_reborrow\nombr2_entry_osc_close_reborrow:\nhint #34\nb ombr2_code_osc_ownership+40\n.previous\n");
+extern const unsigned char ombr2_entry_osc_close_reborrow[] __attribute__((visibility("hidden")));
+/* export fn osc_close_reborrow parent edit oscbor child edit oscbor to void */
+__attribute__((visibility("default"))) uint32_t omega2_osc_close_reborrow(uint64_t *result, uint8_t *o_parent, uint8_t *o_child)
+{
+    ombr_span sp[7];
+    unsigned ns = 0;
+    uint64_t a[6] = {0};
+    ombr2_out ou[6] = {{0, 0, 0}};
+    unsigned no = 0;
+    if (ombr_span_add(sp, &ns, result, 1u, 1u, 8u, 1))
+        return OMEGA_BAD_ARG;
+    if (ombr2_fixed(sp, &ns, o_parent, 24u, 1u, 1))
+        return OMEGA_BAD_ARG;
+    a[0] = (uint64_t)(uintptr_t)o_parent;
+    if (ombr2_fixed(sp, &ns, o_child, 24u, 1u, 1))
+        return OMEGA_BAD_ARG;
+    a[1] = (uint64_t)(uintptr_t)o_child;
+    if (ombr2_overlap(sp, ns))
+        return OMEGA_BAD_ARG;
+    return ombr2_run(ombr2_entry_osc_close_reborrow, a, result, 0, ou, no);
+}
 /* Generated by omega-bridge src/native.om: the definitions of the C API declared in
  * omega_api_decl.h (output apic). Each calls omega2_<name> and calls abort() on a nonzero status.
  * Regenerate it; do not edit it. */
@@ -2552,3 +2799,91 @@ uint64_t osc_parse_literal(const uint8_t *o_spelling, size_t o_spelling_len, uin
         abort();
     return r;
 }
+/* export fn osc_owner_access moved ulong exclusive ulong shared_count ulong mut_count ulong to ulong */
+uint64_t osc_owner_access(uint64_t o_moved, uint64_t o_exclusive, uint64_t o_shared_count, uint64_t o_mut_count)
+{
+    uint64_t r = 0;
+    if (omega2_osc_owner_access(&r, (uint64_t)o_moved, (uint64_t)o_exclusive, (uint64_t)o_shared_count, (uint64_t)o_mut_count) != OMEGA_OK)
+        abort();
+    return r;
+}
+/* export fn osc_borrow_access writable ulong exclusive ulong shared_count ulong mut_count ulong to ulong */
+uint64_t osc_borrow_access(uint64_t o_writable, uint64_t o_exclusive, uint64_t o_shared_count, uint64_t o_mut_count)
+{
+    uint64_t r = 0;
+    if (omega2_osc_borrow_access(&r, (uint64_t)o_writable, (uint64_t)o_exclusive, (uint64_t)o_shared_count, (uint64_t)o_mut_count) != OMEGA_OK)
+        abort();
+    return r;
+}
+/* export fn osc_owner_move moved ulong shared_count ulong mut_count ulong declaration_depth long loop_depth long to ulong */
+uint64_t osc_owner_move(uint64_t o_moved, uint64_t o_shared_count, uint64_t o_mut_count, int64_t o_declaration_depth, int64_t o_loop_depth)
+{
+    uint64_t r = 0;
+    if (omega2_osc_owner_move(&r, (uint64_t)o_moved, (uint64_t)o_shared_count, (uint64_t)o_mut_count, (uint64_t)o_declaration_depth, (uint64_t)o_loop_depth) != OMEGA_OK)
+        abort();
+    return r;
+}
+/* export fn osc_join_owner taken view oscowner remaining edit oscowner to ulong */
+uint64_t osc_join_owner(const OscCheckedOwner *o_taken, OscCheckedOwner *o_remaining)
+{
+    uint64_t r = 0;
+    if (omega2_osc_join_owner(&r, (const uint8_t *)o_taken, (uint8_t *)o_remaining) != OMEGA_OK)
+        abort();
+    return r;
+}
+/* export fn osc_join_handle before long current long other long to long */
+int64_t osc_join_handle(int64_t o_before, int64_t o_current, int64_t o_other)
+{
+    uint64_t r = 0;
+    if (omega2_osc_join_handle(&r, (uint64_t)o_before, (uint64_t)o_current, (uint64_t)o_other) != OMEGA_OK)
+        abort();
+    return (int64_t)r;
+}
+/* export fn osc_join_frees taken view uchar * remaining edit uchar * to void */
+void osc_join_frees(const uint8_t *o_taken, size_t o_taken_len, uint8_t *o_remaining, size_t o_remaining_len)
+{
+    uint64_t r = 0;
+    if (omega2_osc_join_frees(&r, o_taken, o_taken_len, o_remaining, o_remaining_len) != OMEGA_OK)
+        abort();
+    (void)r;
+}
+/* export fn osc_init_owner item edit oscowner symbol long to void */
+void osc_init_owner(OscCheckedOwner *o_item, int64_t o_symbol)
+{
+    uint64_t r = 0;
+    if (omega2_osc_init_owner(&r, (uint8_t *)o_item, (uint64_t)o_symbol) != OMEGA_OK)
+        abort();
+    (void)r;
+}
+/* export fn osc_open_borrow owner edit oscowner child edit oscbor object long mutable ulong source_line ulong to void */
+void osc_open_borrow(OscCheckedOwner *o_owner, OscCheckedBorrow *o_child, int64_t o_object, uint64_t o_mutable, uint64_t o_source_line)
+{
+    uint64_t r = 0;
+    if (omega2_osc_open_borrow(&r, (uint8_t *)o_owner, (uint8_t *)o_child, (uint64_t)o_object, (uint64_t)o_mutable, (uint64_t)o_source_line) != OMEGA_OK)
+        abort();
+    (void)r;
+}
+/* export fn osc_open_reborrow parent edit oscbor child edit oscbor object long parent_id long mutable ulong source_line ulong to void */
+void osc_open_reborrow(OscCheckedBorrow *o_parent, OscCheckedBorrow *o_child, int64_t o_object, int64_t o_parent_id, uint64_t o_mutable, uint64_t o_source_line)
+{
+    uint64_t r = 0;
+    if (omega2_osc_open_reborrow(&r, (uint8_t *)o_parent, (uint8_t *)o_child, (uint64_t)o_object, (uint64_t)o_parent_id, (uint64_t)o_mutable, (uint64_t)o_source_line) != OMEGA_OK)
+        abort();
+    (void)r;
+}
+/* export fn osc_close_borrow owner edit oscowner child edit oscbor to void */
+void osc_close_borrow(OscCheckedOwner *o_owner, OscCheckedBorrow *o_child)
+{
+    uint64_t r = 0;
+    if (omega2_osc_close_borrow(&r, (uint8_t *)o_owner, (uint8_t *)o_child) != OMEGA_OK)
+        abort();
+    (void)r;
+}
+/* export fn osc_close_reborrow parent edit oscbor child edit oscbor to void */
+void osc_close_reborrow(OscCheckedBorrow *o_parent, OscCheckedBorrow *o_child)
+{
+    uint64_t r = 0;
+    if (omega2_osc_close_reborrow(&r, (uint8_t *)o_parent, (uint8_t *)o_child) != OMEGA_OK)
+        abort();
+    (void)r;
+}
diff --git a/src/omega_om_units.ident b/src/omega_om_units.ident
index e86139fb7e2cd8bff4d29c7a4b20a89185c4894a..3649e17cded48642e34621fd9b30e9db83676a0a 100644
--- a/src/omega_om_units.ident
+++ b/src/omega_om_units.ident
@@ -24,3 +24,4 @@ omega-ident 1 unit=rx_world_core abi=2 profile=OM-2 src=fe6656a9770cd0721dd5d5e8
 omega-ident 1 unit=rx_skillroute_core abi=2 profile=OM-2 src=568e2a8345feaffe9d1c119697426be1564d2b2317f8bdd192ad7756c39a6c3d omc=b6129ed51e07dd8ef7f33e78fdff99d6c4d914e3bccdaf8b344043b95017d4f2 path=om/runtime/rx_skillroute_core.om
 omega-ident 1 unit=rx_fusion_core abi=2 profile=OM-2 src=aab22272005a4d65c2ada2b9754906cdaa7736ae127042f84457d548875d1ee6 omc=b6129ed51e07dd8ef7f33e78fdff99d6c4d914e3bccdaf8b344043b95017d4f2 path=om/runtime/rx_fusion_core.om
 omega-ident 1 unit=osc_literal abi=2 profile=OM-2 src=c61bdcbb9f71b01df86fba045b4206809091e709eba208939a4270b67dabbce2 omc=b6129ed51e07dd8ef7f33e78fdff99d6c4d914e3bccdaf8b344043b95017d4f2 path=om/compiler/osc_literal.om
+omega-ident 1 unit=osc_ownership abi=2 profile=OM-2 src=4057f369075c9ea7e8df9c208f640eb5361dacd2608138cb04b853db082c4d33 omc=b6129ed51e07dd8ef7f33e78fdff99d6c4d914e3bccdaf8b344043b95017d4f2 path=om/compiler/osc_ownership.om
diff --git a/tests/compiler/neg/h_freed_on_both_paths.osc b/tests/compiler/neg/h_freed_on_both_paths.osc
new file mode 100644
index 0000000000000000000000000000000000000000..49bf39f9f5f8c45a9739e32ed900b66a804418a5
--- /dev/null
+++ b/tests/compiler/neg/h_freed_on_both_paths.osc
@@ -0,0 +1,11 @@
+// expect: STALE_HANDLE object=h line=8
+// transition: read after free
+fn f(k: u8) -> i64 {
+    let mut result: i64 = 0;
+    pool p: [i64; 2] {
+        let h: handle p = p.alloc(7);
+        if k == 0 { p.free(h); } else { p.free(h); }
+        result = p[h];
+    }
+    return result;
+}
diff --git a/tests/compiler/neg/ma_move_in_loop_while_borrowed.osc b/tests/compiler/neg/ma_move_in_loop_while_borrowed.osc
new file mode 100644
index 0000000000000000000000000000000000000000..49f60000d550c3179cfe4e698bd6dfc2d4e3e19f
--- /dev/null
+++ b/tests/compiler/neg/ma_move_in_loop_while_borrowed.osc
@@ -0,0 +1,9 @@
+// expect: MUTABLE_ALIAS object=a line=7
+// transition: move while borrowed
+fn consume(value: own [u8; 2]) -> u8 { return value[0]; }
+fn f() -> u8 {
+    let a: own [u8; 2] = alloc(3);
+    let r: &[u8; 2] = &a;
+    for i in 0 .. 3 { let x: u8 = consume(a); }
+    return r[0];
+}
diff --git a/tests/compiler/neg/ma_one_reborrow_still_live.osc b/tests/compiler/neg/ma_one_reborrow_still_live.osc
new file mode 100644
index 0000000000000000000000000000000000000000..73178d19b1a7c1479cdc7af8f853feec570db5e3
--- /dev/null
+++ b/tests/compiler/neg/ma_one_reborrow_still_live.osc
@@ -0,0 +1,11 @@
+// expect: MUTABLE_ALIAS object=r line=9
+// transition: write while reborrowed
+fn f() -> i32 {
+    let a: own [i32; 1] = alloc(7);
+    let r: &mut [i32; 1] = &mut a;
+    let first: &[i32; 1] = &r;
+    { let second: &[i32; 1] = &r; let seen: i32 = second[0]; }
+
+    r[0] = 9;
+    return first[0];
+}
diff --git a/tests/compiler/progs/handles_loop_assignment.osc b/tests/compiler/progs/handles_loop_assignment.osc
new file mode 100644
index 0000000000000000000000000000000000000000..1aa3596fb83266e914a5713451492df06a748e7c
--- /dev/null
+++ b/tests/compiler/progs/handles_loop_assignment.osc
@@ -0,0 +1,13 @@
+// entry: f
+// expect-run: f 0 -> 9
+fn f(k: u8) -> i64 {
+    let mut result: i64 = 0;
+    pool p: [i64; 2] {
+        let mut h: handle p = p.alloc(7);
+        let old: handle p = h;
+        for i in 0 .. 1 { h = p.alloc(9); }
+        p.free(old);
+        result = p[h];
+    }
+    return result;
+}