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 / seed / omc / sites / found-mmapio-1.om

101 lines · 1899 bytes Raw Blame History
1note sites: found by a one-token change of a tracked program (41 to 120 lines); reaches the omc error site in mmapio (code 9)
2note Exact word access through managed mappings. No GPU or device opens.
3global bytes uchar 16
4global status uchar 4
5text msg "PASS managed addresses and ordered mapped words\n"
6fn ck yes bool to void
7if not yes
8exit int 80
9end
10end
11fn bad k int to void
12h = mapnew neg int 1 0 4096 3 34
13ck gt h 0
14if eq k 0
15ck eq mapdrop h 0
16r = mapaddr h
17ret
18end
19if eq k 1
20ck eq mapdrop h 0
21r = mapget h 0 4
22ret
23end
24if eq k 2
25r = mapget h 4096 4
26ret
27end
28if eq k 3
29r = mapset h 4092 not 0
30ret
31end
32if eq k 4
33r = mapget h 1 4
34ret
35end
36if eq k 5
37r = mapset h 4 8 0
38ret
39end
40if eq k 6
41ro = mapnew neg int 1 0 4096 1 34
42r = mapset ro 0 4 0
43ret
44end
45if eq k 7
46r = mapset h 0 4 4294967296
47ret
48end
49r = mapget h 18446744073709551615 8
50end
51fn held h long a ulong b ulong c ulong d ulong e ulong to void
52ck gt mapaddr h 4096
53ck eq mapset h 0 8 18446744073709551615 0
54ck eq mapget h 0 8 18446744073709551615
55ck eq a 101
56ck eq b 202
57ck eq c 303
58ck eq d 404
59ck eq e 505
60end
61fn main to int
62h = mapnew neg int 1 0 4096 3 33
63ck gt h 0
64ck eq and mapaddr h 4095 0
65held h 101 202 303 404 505
66ck eq mapset h 8 4 4294967295 0
67ck eq mapget h 8 4 4294967295
68ck eq mapset h 12 4 305419896 0
69ck eq mapread h 0 bytes 0 16 16
70for i ulong 12
71ck eq get bytes i 255
72end
73ck eq get bytes 12 120
74ck eq get bytes 13 86
75ck eq get bytes 14 52
76ck eq get bytes 15 18
77ck eq mapset h 4088 8 81985529216486895 0
78ck eq mapget h 4088 8 81985529216486895
79p = fork
80ck ge p 0
81if eq p 0
82ck eq mapset h 0 8 42 0
83exit int 0
84end
85ck eq waitpid int p status 0 4 0 p
86ck and eq get status 0 0 eq get status 1 0
87ck eq mapget h 0 8 42
88ck eq mapdrop h 0
89for k int 9
90p = fork
91ck ge p 0
92if eq p 0
93bad k
94exit int 80
95end
96ck eq waitpid int p status 0 4 0 p
97ck and eq get status 0 0 eq get status 1 103
98end
99ck eq write 1 msg 0 len msg long len msg
100ret 0
101end