interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / evidence / allen-omega-L694 / L746 / independent-review / probes / context-independent.om

397 lines · 7376 bytes Raw Blame History
1text Who "Drake"
2text Selfname "Allen"
3text Fkey "gate code"
4text Fval "4471"
5text Note0 "Meet at noon."
6text Note1 "Old private note."
7text Note3 "Bring tools."
8text MetaWant "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools.\tnote Meet at noon."
9text NewOnly "\tself=Allen\tname=Drake\tstarts=7\tfact gate code is 4471\tnote Bring tools."
10text Emptyctx "\tself=Allen\tstarts=0"
11text Lastsix "\tself=Allen\tstarts=0\tnote N9\tnote N8\tnote N7\tnote N6\tnote N5\tnote N4"
12text Plural "\tself=Allen\tname=Drake\tstarts=4294967295\tfact gate code are 4471"
13global Unitsave uchar 8192
14global Saveout uchar 8192
15global Saveos ulong 2
16global Appsave ulong 16
17global Joblen ulong 1
18global Qsave ulong 2
19fn test ok bool to void
20put Saveos 0 get Outlen 0
21put Saveos 1 get Err 0
22for i ulong get Outlen 0
23put Saveout i get Outb i
24end
25check ok add get Checks 0 1
26for i ulong get Saveos 0
27put Outb i get Saveout i
28end
29put Outlen 0 get Saveos 0
30put Err 0 get Saveos 1
31end
32fn fixture index ulong gone ulong to void
33put Ns 0 len Note0
34put Ns 1 index
35put Ns 2 7
36put Ns 3 gone
37for i ulong len Note0
38put Note i get Note0 i
39end
40if eq index 1
41put Ns 0 len Note1
42for i ulong len Note1
43put Note i get Note1 i
44end
45end
46if eq index 3
47put Ns 0 len Note3
48for i ulong len Note3
49put Note i get Note3 i
50end
51end
52test noteenc
53for i ulong 4096
54put Unit i get Enc i
55end
56end
57fn memsetup to void
58for i ulong 3692
59put Mem i 0
60end
61mset32 0 7
62mset32 32 1
63mset32 36 4
64for i ulong len Who
65put Mem add i 8 get Who i
66end
67for i ulong len Fkey
68put Mem add i 40 get Fkey i
69end
70for i ulong len Fval
71put Mem add i 88 get Fval i
72end
73for i ulong len Selfname
74put Mem add i 153 get Selfname i
75end
76end
77fn prompt to void
78put Inlen 0 2
79put In 0 104
80put In 1 105
81end
82fn main to int
83test appinit 123 0
84test ctxmeta 6
85test eq get Mx 0 len Emptyctx
86same = true
87for i ulong len Emptyctx
88if ne get Meta i get Emptyctx i
89same = false
90end
91end
92test same
93memsetup
94test memenc 100
95for i ulong 4096
96put Unit i get Enc i
97end
98loadbeg
99test loadcopy 0
100test eq get St 0 100
101test ctxbegin
102test eq get Cx 0 4
103test eq get Cx 1 0
104test eq get Cx 2 0
105test not ctxmeta 6
106note Independent admission snapshot: incomplete catalog must not consume ids/history/job.
107for i ulong 16
108put Appsave i get R i
109end
110put Joblen 0 get T 8
111put Qsave 0 get Q 0
112put Qsave 1 get Q 1
113put Saveos 0 get Outlen 0
114put Saveos 1 get Err 0
115for i ulong get Saveos 0
116put Saveout i get Outb i
117end
118for i ulong get T 8
119put Unitsave i get JobOut i
120end
121prompt
122test not appask 0
123test eq get R 0 get Appsave 0
124test eq get R 1 get Appsave 1
125test eq get R 9 get Appsave 9
126test eq get Q 1 get Qsave 1
127test eq get Q 0 get Qsave 0
128test eq get T 8 get Joblen 0
129test eq get Outlen 0 get Saveos 0
130test eq get Err 0 get Saveos 1
131same = true
132for i ulong get Saveos 0
133if ne get Outb i get Saveout i
134same = false
135end
136end
137test same
138same = true
139for i ulong get Joblen 0
140if ne get JobOut i get Unitsave i
141same = false
142end
143end
144test same
145appcancel
146fixture 3 0
147test eq ctxtake 3 1
148test eq get Ctxlen 3 len Note3
149test eq get Ctxstart 3 7
150test eq ctxtake 3 0
151test eq get Cx 1 1
152fixture 1 1
153test eq ctxtake 1 1
154test eq get Ctxgone 1 1
155fixture 2 0
156put Unit 64 33
157test eq ctxtake 2 2
158test eq get Cx 3 1
159test eq get Ctxgone 2 1
160test not ctxmeta 6
161fixture 0 0
162test eq ctxtake 0 1
163test eq get Cx 1 4
164test eq get Cx 2 1
165test eq get Cx 4 0
166test eq ctxtake 4 0
167test ctxmeta 6
168test eq get Mx 0 len MetaWant
169same = true
170for i ulong len MetaWant
171if ne get Meta i get MetaWant i
172same = false
173end
174end
175test same
176test ctxmeta 1
177test eq get Mx 0 len NewOnly
178same = true
179for i ulong len NewOnly
180if ne get Meta i get NewOnly i
181same = false
182end
183end
184test same
185test not ctxmeta 513
186test not ctxappend
187test ctxmeta 6
188outreset
189emitb 120
190test ctxappend
191test eq get Outlen 0 add 1 len MetaWant
192test eq get Outb 0 120
193same = true
194for i ulong len MetaWant
195if ne get Outb add i 1 get MetaWant i
196same = false
197end
198end
199test same
200note Exercise the actual appask -> qsubmit job snapshot, not only metadata helpers.
201prompt
202test appask 1
203test eq get R 0 1
204test eq get Q 1 1
205test eq get R 9 1
206n = get T 8
207test ge n len MetaWant
208same = ge n len MetaWant
209if same
210for i ulong len MetaWant
211if ne get JobOut add sub n len MetaWant i get MetaWant i
212same = false
213end
214end
215end
216test same
217test not ctxbegin
218test eq ctxtake 0 0
219appcancel
220note Exact append capacity and one byte above, preserving Outb/length/error on refusal.
221test ctxmeta 6
222n = sub ulong 4096 get Mx 0
223put Outlen 0 n
224for i ulong n
225put Outb i 90
226end
227test ctxappend
228test eq get Outlen 0 4096
229put Outlen 0 add n 1
230put Outb n 88
231test not ctxappend
232test eq get Outlen 0 add n 1
233test eq get Outb n 88
234put Err 0 5
235test not ctxappend
236test eq get Err 0 5
237outreset
238mset32 36 5
239test not ctxmeta 6
240mset32 36 4
241mset32 32 33
242prompt
243test not appask 2
244test eq get R 0 1
245test eq get Q 1 1
246mset32 32 1
247note Deliberately full valid facts make metadata fit but the whole JOB exceed4096.
248for i ulong 3692
249put Mem i 0
250end
251mset32 32 32
252for k ulong 32
253off = add 40 mul k 113
254for i ulong 47
255put Mem add off i 107
256end
257for i ulong 63
258put Mem add add off 48 i 118
259end
260end
261test ctxmeta 6
262test le get Mx 0 4096
263prompt
264test not appask 2
265test eq get R 0 1
266test eq get Q 1 1
267test eq get R 9 1
268note Catalog capacity and transaction exclusion.
269mset32 36 512
270test ctxbegin
271test eq get Cx 0 512
272test eq ctxtake 512 0
273fixture 511 0
274test eq ctxtake 511 1
275test eq get Ctxlen 511 len Note0
276test not ctxmeta 6
277put Tx 0 1
278test not ctxbegin
279test eq ctxtake 0 0
280put Tx 0 0
281put Nt 0 1
282test not ctxbegin
283test eq ctxtake 0 0
284put Nt 0 0
285mset32 36 513
286test not ctxbegin
287test eq get Cx 0 512
288note Load ten real records, select exactly the newest six, and allow zero selected.
289for i ulong 3692
290put Mem i 0
291end
292mset32 36 10
293test ctxbegin
294for k ulong 10
295put Ns 0 2
296put Ns 1 k
297put Ns 2 7
298put Ns 3 0
299put Note 0 78
300put Note 1 uchar add 48 k
301test noteenc
302for i ulong 4096
303put Unit i get Enc i
304end
305test eq ctxtake k 1
306end
307test ctxmeta 6
308test eq get Mx 0 len Lastsix
309same = true
310for i ulong len Lastsix
311if ne get Meta i get Lastsix i
312same = false
313end
314end
315test same
316test ctxmeta 0
317test eq get Mx 0 len Emptyctx
318note Context construction cannot overwrite a staged memory/note transaction image.
319for i ulong 4096
320put Unitsave i get Unit i
321put Unitsave add i 4096 get Enc i
322end
323test ctxmeta 6
324same = true
325for i ulong 4096
326if ne get Unit i get Unitsave i
327same = false
328end
329if ne get Enc i get Unitsave add i 4096
330same = false
331end
332end
333test same
334memsetup
335mset32 36 0
336mset32 0 4294967295
337put Mem 152 1
338test ctxmeta 6
339test eq get Mx 0 len Plural
340same = true
341for i ulong len Plural
342if ne get Meta i get Plural i
343same = false
344end
345end
346test same
347put Mem 40 9
348test not ctxmeta 6
349test not ctxappend
350put Mem 40 103
351for i ulong 48
352put Mem add i 40 107
353end
354test not ctxmeta 6
355note Thirty-two full facts and six full notes overflow metadata itself, not only JOB.
356for i ulong 3692
357put Mem i 0
358end
359mset32 32 32
360mset32 36 6
361for k ulong 32
362off = add 40 mul k 113
363for i ulong 47
364put Mem add off i 107
365end
366for i ulong 63
367put Mem add add off 48 i 118
368end
369end
370test ctxbegin
371for k ulong 6
372put Ns 0 127
373put Ns 1 k
374put Ns 2 7
375put Ns 3 0
376for i ulong 127
377put Note i 110
378end
379test noteenc
380for i ulong 4096
381put Unit i get Enc i
382end
383test eq ctxtake k 1
384end
385test not ctxmeta 6
386test eq get Mx 1 1
387outreset
388emitb 90
389test not ctxappend
390test eq get Outlen 0 1
391test eq get Outb 0 90
392prompt
393test not appask 2
394test eq get R 0 1
395test eq get Q 1 1
396ret int get Fails 0
397end