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
omega-mv / seed / node / tests / view-prep.om
| 1 | note seed/node/tests/view-prep.om: view-prep ROUND40 BASE ID[,ID...] [WRONG], the DRA-291 view-test |
| 2 | note fixture (nd_prep of nodedrv.om), the Omega port of view-prep.py with byte-identical output. |
| 3 | note ROUND40 holds final-selected.json. BASE is rebuilt with root/ (the broken files), work/, |
| 4 | note objs.txt (one objective argument per line), expect.json and map (fake-serve's format: |
| 5 | note "<klen> <vlen>\n" key value; the key is the prompt as a JSON string, as omnode-infer writes it |
| 6 | note into its request body, the value the completion answer carrying the recorded raw output). Each |
| 7 | note ID selects the first run whose job path contains it. With a fifth argument (WRONG) the first |
| 8 | note objective's goal becomes K+N+A+1, which the map has no turns for and a redirect corrects. |
| 9 | note Prints the objective lines. Exit 0, 1 when the fixture cannot be prepared, 2 for usage. |
| 10 | note Composition: om2, seed/json/json.om, seed/node/tests/drv.om, seed/node/tests/nodedrv.om, this. |
| 11 | |
| 12 | text vpusage "usage: view-prep ROUND40 BASE ID[,ID...] [WRONG]\n" |
| 13 | text vperr "view-prep: cannot prepare the fixture\n" |
| 14 | |
| 15 | fn main to int |
| 16 | cx = new uchar 65536 0 |
| 17 | js = new uchar ndjsz 0 |
| 18 | tp = new uint dvtcap 0 |
| 19 | ids = new uchar 4096 0 |
| 20 | if lt dv_argc 4 |
| 21 | x = dv_err vpusage |
| 22 | ret 2 |
| 23 | end |
| 24 | a = dv_arg 1 part cx 8192 4096 |
| 25 | b = dv_arg 2 part cx 16384 4096 |
| 26 | k = dv_arg 3 ids |
| 27 | if or or lt a 1 lt b 1 lt k 0 |
| 28 | x = dv_err vpusage |
| 29 | ret 2 |
| 30 | end |
| 31 | put ndl 2 ulong a |
| 32 | put ndl 4 ulong b |
| 33 | r = nd_prep cx js tp view part ids 0 ulong k gt dv_argc 4 |
| 34 | if lt r 0 |
| 35 | x = dv_err vperr |
| 36 | ret 1 |
| 37 | end |
| 38 | x = dv_out view part cx 32768 get ndl 8 |
| 39 | ret 0 |
| 40 | end |