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 / apps / interplane-forge / store / tests / mutant-scan.om

55 lines · 1280 bytes Raw Blame History
1note store/tests/mutant-scan.om: TEST-ONLY mutant for store/tests/compare.sh, never composed into
2note forged. compare.sh appends it to the composed store-reading build and turns "n = xscatrd" into
3note "n = xscatsc": the project list then comes from scanning ROOT/projects and joining every
4note project's catalog.row (what interplane-native's ipl join_catalog does) instead of from
5note ROOT/catalog.tsv. Control C2 (a project in the folder that the catalog does not list) must catch it.
6text tmtrow "/catalog.row"
7global mtdb uchar 65536
8fn xscatsc to long
9put fxol 0 0
10put fxotr 0 0
11xspdir
12note O_RDONLY | O_DIRECTORY (040000 on arm64) | O_CLOEXEC
13fd = fopen fpth 0 get fpthl 0 540672 0
14if lt fd 0
15ret -1
16end
17for it ulong 100000
18n = getdnts int fd mtdb 0 len mtdb
19if le n 0
20break
21end
22p = ulong 0
23while lt p ulong n bound 65536
24rl = or ulong get mtdb add p 16 shl ulong get mtdb add p 17 8
25mtone add p 19
26p = add p rl
27end
28end
29x = fclose int fd
30ret long get fxol 0
31end
32fn mtone a ulong to void
33if eq get mtdb a 46
34ret
35end
36xspfold
37for k ulong 255
38c = get mtdb add a k
39if eq c 0
40break
41end
42fpc c
43end
44fpt tmtrow
45fd = fopen fpth 0 get fpthl 0 524288 0
46if lt fd 0
47ret
48end
49n = get fxol 0
50r = read int fd fxo n sub len fxo n
51if gt r 0
52put fxol 0 add n ulong r
53end
54x = fclose int fd
55end