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 / cognitive-routing.md

155 lines · 7843 bytes Raw Blame History Rendered
1# Omega cognitive compute routing (OMEGA_COGNITIVE_ROUTING)
2
3Code: `src/runtime/rx_route.{c,h}`. Test: `tests/runtime/rx_cognitive_routing.c`
4with stand-in engines in `tests/runtime/rx_cog_engines.{c,h}`,
5`make test-cognitive-routing`. Receipt: `evidence/COGNITIVE_ROUTING/6731c0d0….json`
6(candidate 8ed2d9f).
7
8## Purpose
9
10Choose the cheapest cognitive realization that is expected to meet the
11semantic requirement. No engine is assumed to be a language model, and
12cognition is not assumed to be one model. An engine is a function with a
13declared class, the operations it supports, hard capacities, and a measured
14profile.
15
16## Objects
17
18```
19CognitiveRequirement (RxCogRequirement)
20 operation_class, minimum_quality, uncertainty_budget, memory_requirement,
21 temporal_requirement, planning_depth, precision_requirement,
22 latency_budget, energy_budget, hardware_constraints, escalation_allowed
23
24CognitiveRealization (RxCogRealization)
25 cognitive_engine_id, generation, supported_operations (in decl),
26 quality_profile, uncertainty_profile, resource_cost_model
27 (latency_model = mean/p99 ns, energy_model = nJ/call), hardware_requirements
28 (in decl), evidence (SHA-256 of the evidence sample)
29```
30
31`escalation_allowed` is a count: the escalations permitted after the first
32rung (0 = none). Quality is in parts per million.
33
34The declaration (`RxCogDeclaration`: class, supported operations, hardware,
35memory capacity, temporal horizon, maximum planning depth, precision,
36whether answers carry a sound check) is fixed at registration. The SHA-256 of
37all declarations is the registry digest; a model is bound to it.
38
39Realization classes: deterministic compiled procedure, small learned policy,
40specialized neural module, general cognition, ensemble, J-Space exploration.
41
42## Routing
43
441. **Hard filter.** An engine is eligible if it supports the operation, needs
45 no hardware the request forbids, and its memory capacity, temporal horizon,
46 planning depth and precision cover the request.
472. **Evidence filter.** It must have at least 200 labelled trials for the
48 operation in the active generation, a measured cost, and a place in the
49 operation's evidence sample.
503. **Acceptance.** For each engine the router derives the lowest confidence
51 bin from which an answer may stop the ladder: the pooled answers at or
52 above that bin must have a 95% Wilson upper error bound within the
53 `uncertainty_budget`. A verifiable engine's checked answer is accepted on
54 its check (a sound check has no error to bound). One checked answer
55 observed wrong, or none observed, withdraws that.
564. **Ladders.** Every cost-ordered subset of the eligible engines, of length
57 at most `escalation_allowed + 1` (and 4), is evaluated on the evidence
58 sample: for each recorded trial, walk the rungs; stop at the first rung
59 whose recorded bin is accepted, or at the last rung; count whether that
60 answer was right and add the mean cost of every rung reached. The sample
61 is the joint record of all engines on the same requests, so dependence
62 between engines (hard inputs are hard for all of them) is in the estimate.
635. **Choice.** Keep ladders whose 95% Wilson lower quality bound meets
64 `minimum_quality`, whose expected time fits `latency_budget`, and whose
65 expected energy fits `energy_budget` (an energy budget without an energy
66 model is not met). Choose the one with the least expected energy (time when
67 any rung has no metered energy). No ladder: `RX_COG_ERR_UNSATISFIABLE`.
68 The request is refused, never silently approximated.
696. **No evidence.** When the active generation has no evidence for the
70 operation, the operation's reference realization (declared at
71 registration) runs alone and the ladder says `no_evidence_reference`.
72 Evidence that disqualifies every engine is a refusal, not a bootstrap.
73
74The ladder for a requirement is cached per generation.
75
76## Escalation
77
78```
79rung 0 (cheapest) -> accepted? yes: done
80 no, or the engine failed: next rung
81...
82last rung -> accepted: RX_COG_OK
83 not accepted: RX_COG_ERR_EXHAUSTED, the answer is still returned
84```
85
86The ladder is bounded before it runs: its length and its expected cost are
87admission conditions. Nothing measured while it runs changes which rungs run,
88only the answers do; a run under scheduling noise takes the same path as a
89quiet one. The trace records every rung, its confidence and time, the final
90engine and the escalation count.
91
92## Learning
93
94Observations go into a ledger (`RxCogLedger`): labelled joint trials (quality,
95failures, confidence bins, per-call time for p99) and batch costs (processor
96time per call from a batch, metered energy per call). `rx_route_propose`
97serializes the ledger into a generation's `model` blob and proposes it. The
98routing does not change until that candidate is promoted by a principal
99holding `RX_GEN_RIGHT_PROMOTE` on `RX_GEN_RES_PROMOTION` on the native Aienux
100authority, and the proposer may not promote its own candidate
101(`rx_generation`).
102
103The router reads profiles only through `rx_route_load`, which reads the active
104generation's `model` blob through its SHA-256 root. A torn blob, or a model
105built against another registry, is refused and the loaded profiles are kept.
106There is no call that installs profiles from memory. `rx_route.o` is built
107alone and the build fails if it references `rx_gen_promote` or any
108`aienos_cap_*` / `rx_caproot_mint` / `rx_caproot_revoke` symbol.
109
110## Gate
111
112OMEGA_COGNITIVE_ROUTING_PASS requires, on one held-out workload (20,000
113recognitions, 2,000 plans), run routed and on the always-most-expensive
114eligible realization (the one with the highest measured cost, alone):
115
116- both meet the same `minimum_quality` for every operation (recognition 0.95,
117 planning 0.998), measured against ground truth;
118- routed median processor time is lower, and lower in every one of 9
119 back-to-back pairs (order alternating);
120- where an energy meter exists (DGX Spark `aien_spbm`, CPU P+E clusters),
121 routed median metered energy is lower, and lower in every pair;
122- escalation never exceeds its bound; no routed request is refused;
123- every promotion attempt without the right, or by the proposer, is refused;
124- all checks pass (hard constraints, torn and foreign models, engine failure
125 escalation, learning after damage).
126
127The meter covers whole CPU clusters, so other work on the machine lands in
128both legs of a pair; the receipt records the load average and every pair.
129
130## The test's engines
131
132Stand-ins, not AIEN. Recognition: label a 16-dimensional observation by a
133fixed nonlinear rule the engines learn from 20,000 labelled examples.
134Engines: small policy (logistic regression on x and x²), neural module
135(16-12-1), general (16-96-96-1), ensemble (general + two 16-64-64-1 + neural).
136Planning: a path within a length bound on a 96×96 grid with 28% obstacles, or
137proof there is none. Engines: greedy best-first (deterministic, checked,
138depth 256), weighted A* with an expansion budget (deterministic, checked,
139depth 1024), exhaustive breadth-first exploration to the bound (J-Space,
140exact).
141
142Learning scenario: the neural module's weights are perturbed. Under the still
143active generation routed recognition quality falls below the requirement. A
144fresh labelled ledger is proposed; the routing is unchanged until it is
145promoted; after promotion the router stops using the damaged module and
146quality meets the requirement again, still cheaper than the most expensive.
147
148## Not claimed
149
150- AIEN cognition (the engines are stand-ins);
151- graphics-processor realizations;
152- energy below idle (the meter is whole-cluster and includes idle draw);
153- routing of concurrent requests (one router per thread);
154- learning without labelled trials (the ledger needs ground truth);
155- a deadline that preempts a running rung.