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

branch main Branches Tags History

omega-mv / spec / semantic-communication.md

190 lines · 8901 bytes Raw Blame History Rendered
1# Semantic communication pruning (OMEGA_SEMANTIC_COMMUNICATION)
2
3Code: `src/runtime/rx_semcomm.{c,h}`. Test: `tests/runtime/rx_semantic_comm.c`,
4`make test-semantic-comm`. Receipt: `evidence/SEMANTIC_COMM/`.
5
6## Purpose
7
8Branches and cognitive workers exchange only the state the receiver needs.
9Nobody broadcasts an internal history or the whole J-space World. A receiver
10declares what it is about to do; Omega answers with the part of the World
11that operation needs, checked against the receiver's own authority; after the
12first delivery only what changed travels.
13
14## Boundaries
15
16| Party | Role here |
17|---|---|
18| Receiver (branch, worker) | declares an `InformationNeed`; holds its own capabilities |
19| Omega | computes the `SemanticProjection`, its encoding and deltas. No admin handle. Reads the World only. |
20| World (J-space) | objects, fields, per-field versions, writer crumbs (rx_world) |
21| Aienux | the only minter (native C capability authority) |
22
23`rx_semcomm.o` is linked alone first. The build fails if it references any
24`aienos_cap_*` admin operation, `rx_caproot_mint`/`revoke`, or a World write
25(`rx_world_publish*`, `create`, `retire`, `add_reaction`).
26
27## InformationNeed
28
29```
30RxInformationNeed {
31 receiver principal (capability subject)
32 operation INSPECT(field mask) | SUM(field) | MAX(field)
33 required_types[] 0 = any type
34 relevant_objects[] object references (id + generation); 0 = every object of the types
35 relevant_time_range [from_crumb, to_crumb] on each field's writer crumb; to 0 = open
36 evidence_requirement NONE | WRITER (crumb id) | DIGEST (crumb id + content digest)
37 uncertainty_requirement max ppm (0 = any) and whether to deliver the value
38}
39```
40
41Time is causal: a field's time is the id of the crumb that last wrote it
42(`rx_world_explain`). Crumb ids are dense and monotonic in one world.
43
44Uncertainty is declared, not estimated. A type may name one field as its
45producer's uncertainty in parts per million (`RxSemType.uncertainty_field`).
46Objects above the bound are left out; `deliver` adds that field.
47
48## SemanticProjection
49
50```
51RxSemanticProjection {
52 object_refs[] reference, type, resource, delivered field mask, conclusion flag
53 fields[] (object, field, value, version)
54 derived_values[] SUM or MAX computed by Omega (omega_eval_pure_binary_uint) instead of the inputs
55 evidence_refs[] (object, field, writer crumb [, crumb digest])
56}
57```
58
59Selection per live object, in id order:
60
611. type in `required_types`, reference in `relevant_objects`;
622. the fields the operation needs whose writer crumb is inside the time range;
63 none left means the object is out of scope;
643. READ on the object's resource, validated through the world's authority
65 view for the receiver's principal; otherwise withheld;
664. uncertainty bound;
675. fields the type marks private need READ on the private resource
68 (`resource | 1<<62`); otherwise those fields are withheld.
69
70INSPECT delivers the selected fields. SUM and MAX deliver the object
71references (provenance) and one derived value; the inputs do not travel.
72Evidence, when required, covers every field the operation used, delivered or
73folded into a derived value.
74
75## Authority
76
77A projection carries values and references. It carries no capability. A
78receiver that wants to write still needs its own WRITE capability, which the
79engine validates when the reaction starts and again at publication. The test
80tries three writes with nothing but a projection and a READ capability: an
81outside publication, a reaction that claims WRITE on the READ capability, and
82a reaction that declares READ honestly. All three are refused; a principal
83that really holds WRITE commits (control).
84
85Revocation is seen on the next delivery: the next projection no longer
86contains the object, so the delta carries an invalidation.
87
88## Encoding
89
90One canonical little-endian format for every mode, so byte counts compare.
91Header 21 bytes (magic `SCM1`, kind, receiver, sequence, record count).
92
93| Record | Bytes | Content |
94|---|---|---|
95| O object | 20 | id, generation, type, resource, conclusion flag |
96| F field | 20 | id, field, version, value |
97| E evidence | 12 | id, field, writer crumb |
98| D evidence + digest | 44 | as E, plus the crumb's SHA-256 |
99| V derived | 22 | slot, op, field, value, argument reference, input count |
100| X drop object | 8 | id, generation, reason |
101| Y drop field | 5 | id, field, reason |
102
103Kinds: FULL_STATE (broadcast baseline), PROJECTION (replaces the receiver's
104view), DELTA (edits it).
105
106## Delta delivery
107
108The sender keeps one cursor per receiver: which objects, generations, field
109versions and evidence crumbs it last delivered, and the derived values. A
110delta carries, in order:
111
112- invalidations: objects that left (reason RETIRED, AUTHORITY, UNCERTAIN or SCOPE);
113 a slot reused by a new generation drops the old one first;
114- new objects with all their fields and evidence; objects of a conclusion type
115 are new conclusions;
116- for objects already held: fields that left, fields whose version changed,
117 evidence whose writer crumb changed;
118- derived values that changed.
119
120Unchanged state never travels. With nothing changed a delta is a bare header.
121
122## Test (swarm simulation)
123
124World: 180 objects in 6 types over 12 capability domains, 16 teams (each READ
125on 4 domains, even teams also on one private resource), 24 rounds. Each round:
12612 objects get 1–3 field writes; every 4th round an object is retired and
127replaced (new generation); every 3rd round a new conclusion object appears;
128round 12 revokes team 3's READ on its home domain; round 18 grants it again.
129
130Workers: 32, 100 and 500, with partially overlapping tasks. Nine in ten draw an
131operation, one or two types, a window of 12–48 objects from one of 24 task
132groups (or all objects of the types), sometimes a time range, an evidence mode
133and an uncertainty bound. One in ten is a coordinator: every type, every
134object, every data field, writer evidence.
135
136Every round, from the same World at the same moment:
137
138| Mode | What each worker gets |
139|---|---|
140| full-state broadcast | every live object, every field, its version and writer crumb id |
141| semantic projection | its projection, fresh |
142| projection + delta | its first projection, then deltas |
143
144The broadcast baseline carries no crumb digests; that makes it smaller than a
145true full state, and DIGEST workers in broadcast mode are not charged for
146missing digests. Both choices favour the baseline.
147
148Each worker then performs its operation. A reference evaluator, written apart
149from `rx_sem_project`, applies the same need to a copy taken straight from the
150World under the worker's authority; that is the truth. Broadcast workers run
151the same evaluator on what they decoded (they filter, and check authority,
152themselves).
153
154Measured per size and mode: encoded bytes, sender and receiver thread CPU
155time, per-round latency (sender + all receivers, one thread), receiver held
156bytes and sender state bytes (broadcast buffer or delta cursors), authority
157validations, task success, missing-required-information failures, and fields
158delivered without authority. Energy: the Spark's `aien_spbm` hardware counters
159(pkg, cpu_p, microjoules) over whole scenario runs, four interleaved blocks of
160at least 1.5 s per mode (world-only, broadcast, delta), medians, raw.
161
162Also checked: a view rebuilt from deltas hashes the same as a view built from
163the fresh projection (every worker, every round); the same need on the same
164World gives identical bytes whatever order capabilities are held in; after a
165round with no change every delta is empty; every worker that held revoked
166state is told; a deliberately under-declared need (one type left out) is caught
167as missing information (negative control).
168
169## Gate
170
171`OMEGA_SEMANTIC_COMMUNICATION_PASS` iff every check passes and, at every size:
172projection bytes < broadcast bytes and delta bytes < projection bytes;
173missing-required-information 0 in every mode; fields delivered without
174authority 0 for projection and delta; task success 100% in every mode;
175delta/fresh equivalence 0 mismatches; determinism 0 mismatches; quiet deltas
176empty; revocation delivered to every holder; the negative control detects
177missing information; no write through a projection. Energy is measured and
178reported, not gated.
179
180## Not claimed
181
182- Transport over a network or between processes: delivery is in-process
183 decode of the real encoded bytes.
184- Graphics-processor senders or receivers.
185- The Aienux kernel: the authority runs as a host library.
186- Learned or inferred needs: needs are declared.
187- Uncertainty estimation: Omega carries the producer's declared value.
188- Worlds above 256 objects (`RX_MAX_OBJECTS`).
189- Sender cost: projection spends sender CPU and a cursor per receiver that
190 broadcast does not; the receipt reports both.