interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

branch main Branches Tags History

CUDApp / docs / speculation / SERVICE.md

108 lines · 6272 bytes Raw Blame History Rendered
1# Persistent native policy process
2
3`native/speculation/service.om` connects the existing policy to a persistent
4stdin/stdout process. It is handwritten Omega, including framing, lifecycle
5validation and timing. The native model engine must own and acknowledge all
6physical prefill, verification, rollback and token-consumption operations.
7
8This is a real Linux AArch64 process interface, tested by a second native Omega
9process through two pipes. It is not a model adapter or an AienOS device gate.
10
11## Qualified compiler profile
12
13This entrypoint uses the existing native-host compiler from Omega commit
14`f0499f415571bdd7496b6de391096915e78f7556`, independently reconstructed through
15its existing seed chain. Compiler SHA-256:
16
17```
18e5d60db892c8f21cc8c9128af26d8bded0e96d7f92946f5a549397c43a872649
19```
20
21Its published native-host gate covers file, process, pipe, clock and socket
22operations. This is a distinct profile from the baseline compiler used for the
23original pure components; no union with another compiler profile is assumed.
24The dependency is qualified here without editing another owner's compiler.
25
26For a reconstruction, export the exact pinned seed and original fixture paths,
27including their Git file index, and run its existing `seed/host/check.sh`.
28Require nine positive groups, 41 negative controls and **70** original fixtures.
29A partial source export can misleadingly print a passing comparison of zero
30fixtures; zero does not qualify this dependency.
31
32Compile these ordered units with that compiler:
33
34- Worker: `native/speculation/policy.om`, `native/speculation/service.om`.
35- Native test client: `native/speculation/policy.om`,
36 `tests/speculation/support.om`, `tests/speculation/service-test.om`.
37
38Run the test client with the worker executable's absolute path as its sole
39argument. The client starts only that host worker, exercises both pipes, and
40reaps it. Existing shell tools coordinate development reconstruction only;
41the delivered worker invokes no shell, foreign helper or model runtime.
42
43## Wire format
44
45All fields are unsigned 64-bit little-endian words. Requests have five header
46words: magic `827343699` (SCP1), version `1`, operation, sequence, body length in
47words. Sequences start at one and advance after each framed response, including
48semantic refusals. Header and body reads tolerate partial reads and EINTR.
49
50Responses have seven header words: magic, version, operation, sequence, status,
51body length in words, elapsed policy nanoseconds. Timing starts after the full
52request arrives and ends before the response is written. The engine must also
53measure total round-trip overhead, including transport, and include that cost
54in the round. The elapsed field alone is not full adaptation overhead.
55
56| Operation | Request body | Successful response body |
57| --- | --- | --- |
58| 1 initialize | 64 identity words, 6 profile words, 77 cost-row words, 31 prior words | Empty |
59| 2 begin | warm flag, require-device flag, sampling mode | Empty |
60| 3 select | context, remaining output, memory budget, epoch, mode, fixed length | Five decision words from CONTRACT.md |
61| 4 observe | accepted drafts, emitted tokens, full elapsed microseconds, EOS, complete | Emitted, consumed, pending-token, done counters |
62| 5 consume | Empty; caller acknowledges consumption by the real model owner | Empty |
63| 6 cancel | Empty; caller owns actual rollback and cancellation | Empty |
64| 7 end | Empty; request must be complete with no active round | Empty |
65| 8 exit | Empty; no request may be active | Empty, then process exit 0 |
66
67Initialize is accepted once per process. Begin requires initialization or a
68previously ended/cancelled request. Warm begin retains the policy's learned
69statistics under its original identity rules. Reconfiguration requires a new
70process. The process performs no shared learning with other instances.
71
72Semantic errors return the policy's status and no payload. Broken framing,
73unknown operations, bad versions/sequences or incomplete frames terminate the
74process without a response for that frame. EOF is clean only between requests;
75EOF during an active request exits 75. One process accepts at most one million
76commands. There is no automatic fallback after process or protocol failure.
77The model caller must abort the affected trial and preserve its failure record.
78
79The process itself does not discover code/model hashes or authenticate a device.
80Supplied identities and acknowledgements must be derived from the real owner;
81their presence on the wire cannot prove that the model executed correctly.
82
83## Exact existing-engine attachment point
84
85The inspected 27B engine is sovereign-core `speed2/specdecode` at
86`68fa1683874899eb0b6b4ab68bb2b9b19fcbcbb1`. Its existing
87`qwen38_omega/spec.rs::decode_rounds` takes one fixed `k` for the request.
88It has no external per-round budget callback. Its server reads `AIEN_Q38_SPEC_K`
89when loading, and its `qwen38_spec suite` parses the entire plan before loading.
90Those interfaces cannot implement adaptive per-round sizing merely by changing
91command arguments between calls. This source supports chains up to eight drafts;
9216 and 31 must remain explicitly unsupported until independently qualified.
93
94A narrow engine connection would call select before drafting, use the returned
95budget, preserve existing MTP/verification/complete-state ownership, and report
96observe only after actual commit or rollback. It must handle natural EOS,
97cancellation and output exhaustion before reporting the exact emitted/consumed
98prefix, then acknowledge any correction token at its real consumption boundary.
99Native timing must cover draft, verify, commit, host, policy/transport and setup.
100First-divergence checks remain mandatory; this interface adds no numerical waiver.
101
102The user confirmed strict Omega implementation and authorized extending Omega's
103compiler and runtime to supply this connection. Native device access, mapped
104memory and the full model/state attachment remain prerequisites. The existing
105Rust engine remains a reference for behavior. No model launch or hardware trial
106is delivered by this policy-service component.
107A strictly Omega attachment instead depends on the existing native ABI/runtime
108owner. The presence of native host facilities does not establish that ABI.