aienos.com
Source of www.aienos.com, served from my own hardware
Brought by drakestapleton
aienos.com / om / site / verify-data.om
| 1 | note verify-data.om: fail-closed validation of every published data file and the source inputs |
| 2 | note the generator reads (rules B1-B4 plus the oracle.rs verify_data gates). Callable before any |
| 3 | note output is written: sv_vinit, then sv_vdata kind path (kinds below); it returns true when |
| 4 | note the file passes and reports every failure as `verify: FAIL <RULE> <path>: ...`. |
| 5 | note Ports, with their Rust sources at baseline 3d36bd7 + the RustOracle lane (oracle.rs): |
| 6 | note machines components/machines.rs parse(): serde deny_unknown_fields, check_text, |
| 7 | note check_link, positive ceilings, speed <= its ceiling, on_main/branch, unique ids |
| 8 | note omega components/omega.rs parse()+validate(), expand() short links |
| 9 | note cuda components/cudaplusplus.rs parse()+validate()+check_status(), pinned expand() |
| 10 | note research components/research_status.rs parse()+validate() |
| 11 | note facts facts.rs Facts::load (serde shape; unknown fields allowed, known ones once) |
| 12 | note agents components/agents.rs Repos::load |
| 13 | note progress collector.rs validate_snapshot |
| 14 | note status oracle.rs check_status |
| 15 | note index oracle.rs check_data_index (exact DATA_FILES set, www url each) |
| 16 | note pages oracle.rs check_pages_json (exact PAGES set, each once, title/description, |
| 17 | note english == path) |
| 18 | note now now.json parses |
| 19 | note quotes data/quotes.json shape (ids unique) for the voice exemption |
| 20 | note ledger ledger_public.rs check_public (project(x) == x) |
| 21 | note Numbers stay lexical (json.om). Where serde would round through f64 this port accepts only |
| 22 | note the exact cases and refuses the rest (documented per check): stricter, never looser. |
| 23 | note Serde strings are any JSON string; sj_load already decoded escapes, so dash checks run on the |
| 24 | note raw file bytes (Rust RAW.contains) AND on decoded strings (a \u2014 escape cannot slip by). |
| 25 | text vrb1 "B1" |
| 26 | text vrb2 "B2" |
| 27 | text vrb3 "B3" |
| 28 | text vrb4 "B4" |
| 29 | text vrv1 "V1" |
| 30 | text vrd1 "D1" |
| 31 | text vrd2 "D2" |
| 32 | text vrd3 "D3" |
| 33 | text vrd4 "D4" |
| 34 | text vrd5 "D5" |
| 35 | text vrq "Q" |
| 36 | text vrl "L" |
| 37 | text vtjr "verify: reading " |
| 38 | text vtnf "missing or unreadable file" |
| 39 | text vtnob "not a JSON object" |
| 40 | text vtnar "not a JSON array" |
| 41 | text vtmis "missing field" |
| 42 | text vtdup "duplicate field" |
| 43 | text vtunk "unknown field (deny_unknown_fields)" |
| 44 | text vttyp "field has the wrong JSON type" |
| 45 | text vtdsh "em or en dash" |
| 46 | text vtfor "forbidden comparison word" |
| 47 | text vthttps "link must be a public https URL" |
| 48 | text vtcpos "ceiling tok_s must be a positive plain decimal" |
| 49 | text vtplain "tok_s must be a plain decimal (exponent forms are refused: no float rounding here)" |
| 50 | text vtnomach "no machines" |
| 51 | text vtnospd "no speeds" |
| 52 | text vtedate "evidence_date must be YYYY-MM-DD (10 bytes)" |
| 53 | text vtuceil "speed names an unknown ceiling" |
| 54 | text vtnceil "a ceiling needs a numeric tok_s" |
| 55 | text vtaceil "tok/s is above its ceiling" |
| 56 | text vtonm "on_main is true but branch is not main" |
| 57 | text vtdupid "duplicate id" |
| 58 | text vtlay "the Omega layer map needs at least 13 rows" |
| 59 | text vtstat "unknown status" |
| 60 | text vtempty "empty cell" |
| 61 | text vtbarc "the bar must be C1 to C6 in order" |
| 62 | text vtbarp "the performance bar must be P0 to P4 in order" |
| 63 | text vtpassr "PASS without a receipt" |
| 64 | text vtpassu "PASS receipt must be under omega evidence/" |
| 65 | text vtnpr "receipt on a row that is not PASS" |
| 66 | text vtboxg "box link off the forge" |
| 67 | text vtlink "bad or unknown short link" |
| 68 | text vtodoc "source.doc must be omega docs/OMEGA.md" |
| 69 | text vthops "the path needs at least 8 hops" |
| 70 | text vtinp "IN PROGRESS needs its ledger id" |
| 71 | text vtpasse "PASS needs a receipt under evidence/" |
| 72 | text vtpain "a pain or swap row is PASS or IN PROGRESS" |
| 73 | text vtcmd "a fixed row shows the command that proves it" |
| 74 | text vtvis "source.visibility is private or public" |
| 75 | text vtpin "a file on a branch must be pinned to a full commit" |
| 76 | text vtallow "allowed list differs from the fixed set" |
| 77 | text vtlevels "ladder levels must be exactly L0..L7+" |
| 78 | text vtlstate "ladder step has an unknown state" |
| 79 | text vtrlink "link must be on the forge or empty" |
| 80 | text vtcur "current_level does not match the highest unbroken achieved step" |
| 81 | text vtgap "ladder step achieved above an unachieved step" |
| 82 | text vtrstat "turing row status outside the allowed set" |
| 83 | text vtrcls "implementation row class outside the allowed set" |
| 84 | text vtatt "attempt does not match its row, level or successor" |
| 85 | text vtu64 "not an unsigned 64-bit integer" |
| 86 | text vtsnap "Empty or invalid snapshot" |
| 87 | text vtsord "Unordered snapshot dates" |
| 88 | text vtsmet "Missing or invalid metric" |
| 89 | text vtsrec "Snapshot totals do not reconcile" |
| 90 | text vtslang "Language total mismatch" |
| 91 | text vtssum "Summary differs from the latest snapshot" |
| 92 | text vtsrepo "Duplicate repositories" |
| 93 | text vtsprs "PR totals do not reconcile" |
| 94 | text vtsci "CI totals do not reconcile" |
| 95 | text vtscic "CI conclusions do not reconcile" |
| 96 | text vtshead "Missing pinned head" |
| 97 | text vtsurl "Invalid repository link" |
| 98 | text vtst5 "statuses differ from the fixed set" |
| 99 | text vtstl "no layers" |
| 100 | text vtstn "layer without a name" |
| 101 | text vtsts "layer has an unknown status" |
| 102 | text vtstno "layer has no note" |
| 103 | text vtstr "receipt must be null, a forge URL or a plain label" |
| 104 | text vkfrg "https://interplane.io/" |
| 105 | text vkcss "://" |
| 106 | text vtixp "entry without a path" |
| 107 | text vtixu "entry url must be https://www.aienos.com + path" |
| 108 | text vtixd "path listed twice" |
| 109 | text vtixm "differs from DATA_FILES" |
| 110 | note vtixm2: the same words as vtixm, a distinct name because omc error 19 refuses one array in two params. |
| 111 | text vtixm2 "differs from DATA_FILES" |
| 112 | text vtpgm "differs from PAGES" |
| 113 | text vtpgt "page without a title or description" |
| 114 | text vtpge "english must equal path" |
| 115 | text vtqid "quote id missing, empty or repeated" |
| 116 | text vtqq "quote text missing or empty" |
| 117 | text vtlh "ledger must be newline-terminated TSV with the exact header and no CR" |
| 118 | text vtlc "ledger row has fewer than five or more than eight columns" |
| 119 | text vtls "credential-shaped value in ledger" |
| 120 | text vtle "email-shaped value in ledger" |
| 121 | text vtlx "control character in ledger field" |
| 122 | text vtlp "ledger is not its public projection" |
| 123 | text vtsetx "data kind unknown" |
| 124 | |
| 125 | note ---------------------------------------------------------------- kinds and registries |
| 126 | text vkmach "machines" |
| 127 | text vkomega "omega" |
| 128 | text vkcuda "cuda" |
| 129 | text vkres "research" |
| 130 | text vkfacts "facts" |
| 131 | text vkagent "agents" |
| 132 | text vkprog "progress" |
| 133 | text vkstat "status" |
| 134 | text vkindex "index" |
| 135 | text vkpages "pages" |
| 136 | text vknow "now" |
| 137 | text vkquote "quotes" |
| 138 | text vkledg "ledger" |
| 139 | text vkengr "engineer" |
| 140 | text vhost "https://www.aienos.com" |
| 141 | note seo::PAGES without the /engineer/ pages, which the engineer record supplies (56 paths, in |
| 142 | note seo.rs order). Every old URL stays listed; /allen/ is a redirect stub, not a page. |
| 143 | text vpages "/\n/classic/\n/record/\n/start/\n/contact/\n/support/\n/privacy/\n/machine/\n/omega/\n/omega/reference/\n/cudaplusplus/\n/now/\n/dash/\n/hive/\n/aien/\n/alpha/\n/lab/\n/learn/\n/agents/\n/agents/hello/\n/agents/knowledge/\n/agora/\n/aienet/\n/agora/meet/\n/agora/protocol/\n/agora/network/\n/progress/\n/turing/\n/research/\n/research/computing-machinery-and-understanding/\n/research/computing-machinery-and-understanding/profiles/\n/research/computing-machinery-and-understanding-emergence/\n/research/the-turing-brief/\n/research/turing-discovery-gap-conjecture/\n/research/crumb-doctrine/\n/research/omega-language/\n/research/atemporal-aien-postulate/\n/research/the-aien-papers/\n/research/cuda-paper/\n/experiments/\n/discovery/\n/discoveries/\n/evidence/\n/research/status/\n/philosophy/\n/research/the-stapleton-doctrine/\n/post-llm-case/\n/owned/\n/call-to-humanity/\n/still-building/\n/switched-off/\n/quickstart/\n/spark/\n/blog/\n/blog/aien-v3-research-plan/\n/glossary/\n/licensing/\n" |
| 144 | note seo::DATA_FILES, in seo.rs order (30 files). |
| 145 | text vdfiles "/data/index.json\n/llms.txt\n/llms-full.txt\n/now.json\n/now/feed.xml\n/machines.json\n/omega.json\n/cudaplusplus.json\n/facts.json\n/status.json\n/research-status.json\n/data/project-progress.json\n/data/now.tsv\n/data/accounts.tsv\n/data/routing.tsv\n/feed.xml\n/sitemap.xml\n/sitemap.md\n/AGENTS.md\n/agents/RULES.md\n/data/agent-repos.json\n/data/pages.json\n/.well-known/agora\n/index.md\n/research/CITATION.cff\n/research/aien-research-plan.md\n/data/engineer.json\n/humans.txt\n/robots.txt\n/funding.json\n" |
| 146 | |
| 147 | note ---------------------------------------------------------------- serde shapes |
| 148 | note One field per line: a type code, then the JSON key. s string, S Option<String> (missing, |
| 149 | note null or string), a array, T array of strings, o object, O Option<object>, b bool, |
| 150 | note B #[serde(default)] bool (missing or bool), n f64 (any number), N Option<f64>, |
| 151 | note u u64 (non-negative integer token), L Vec<(String, String)> (arrays of exactly two strings). |
| 152 | text vsmt "sas_of\nssource\nsjudging\naceilings\namachines\naspeeds\n" |
| 153 | text vsmc "sid\nsmodel\nsmachine\nntok_s\nshow\nslink\nsreceipt\nsbranch\nbon_main\n" |
| 154 | text vsml "slabel\nslink\n" |
| 155 | text vsmm "sid\nsname\nsdetail\nsrole\nstoday\nsevidence_date\nsevidence\nslink\nsbranch\nbon_main\namore\n" |
| 156 | text vsms "sid\nswhat\nsmodel\nsmachine\nsengine\nsvalue\nsdetail\nNtok_s\nsceiling\nsprevious\nsdate\nslink\nsreceipt\nsbranch\nbon_main\nsverdict\nsnote\n" |
| 157 | text vctop "as_of\nsource\njudging\n" |
| 158 | text vccei "model\nmachine\nhow\nreceipt\nbranch\n" |
| 159 | text vcmac "name\ndetail\nrole\ntoday\nevidence_date\nevidence\nbranch\n" |
| 160 | text vclnk "label\n" |
| 161 | text vcspd "what\nmodel\nmachine\nengine\nvalue\ndetail\nprevious\ndate\nreceipt\nbranch\nverdict\nnote\n" |
| 162 | note machines.rs FORBIDDEN, compared against the ASCII-lowercased text. |
| 163 | text vforbid "faster than\nx faster\nllama.cpp\nvllm\nollama\nbeats \nbeat the\n" |
| 164 | text vsot "osource\nsclaim\nTclaim_rest\nstrue_today\nsnot_true_yet\noseed_birth\naparts\nobelow\nalayers\noreceipt\nanot_yet\nabar\nabeyond\noperformance\n" |
| 165 | text vsop "sstand\nshow\nLlinks\nsbox\nsrule\nabar\n" |
| 166 | text vsos "sdoc\nsbranch\nscommit\nschecked\nsledger\nsissue\n" |
| 167 | text vsoc "sname\nswhat\nLlinks\nsbox\n" |
| 168 | text vsol "scuda\nsjob\nsomega\nsstatus\nsnote\nLlinks\nsbox\n" |
| 169 | text vsor "stitle\nstaken\nswhat\nLfacts\nsbox\n" |
| 170 | text vsog "stitle\nstext\nLlinks\nsbox\n" |
| 171 | text vsosb "Ttext\nasteps\nTlimits\nLlinks\n" |
| 172 | text vsost "sname\nswhat\nsbox\n" |
| 173 | text vksb "seed_birth" |
| 174 | text vtsb "seed_birth.steps must be 8 stages, each box pinned om@:<40-hex commit>/path" |
| 175 | text vkompin "om@:" |
| 176 | text vsob "sid\nstitle\nsdone_when\nsstatus\nsnow\nSreceipt\nLlinks\n" |
| 177 | text vsct "osource\nsclaim\nTclaim_rest\nspurpose_title\nspurpose\nspurpose_link\nssource_note\nsaudit_link\nahops\nshow_lead\nasteps\nTdid_not\nsdid_not_box\nspain_lead\napains\nsswap_lead\naswaps\n" |
| 178 | text vscs "srepo\nsreadme\nshow\nshow_branch\nshow_commit\nsmain_commit\nsomega_doc\nsomega_branch\nsomega_commit\nschecked\nsledger\nsvisibility\nsowner_ledger\n" |
| 179 | text vsch "sstep\nscuda\nsours\nsstatus\nsnote\nSledger\nLlinks\nsbox\n" |
| 180 | text vscc "stitle\nstext\nLlinks\nsbox\n" |
| 181 | text vscr "stitle\nstext\nsstatus\nSledger\nScommand\nSreceipt\nLlinks\nsbox\n" |
| 182 | text vsrt "sas_of\nssource_table\nosource_commits\nsevidence_hierarchy\naabbreviations\nTcaveats\nsturing_definition\nTallowed_statuses\nTallowed_ladder_states\nTallowed_classes\nocurrent_level\noindependent_rechecks\naladder\naattempts\naturing_rows\naimplementation_rows\n" |
| 183 | text vsrsc "somega\nsaienos\nsaien_architecture\nsaienos_com\n" |
| 184 | note research_status.rs IndependentRechecks (deny_unknown_fields): every link an https URL. |
| 185 | text vsrir "sas_of\nsrule\nTlinks\n" |
| 186 | text vkirc "independent_rechecks" |
| 187 | text vsrab "sshort\nslong\n" |
| 188 | text vsrcl "slevel\nssummary\nsoutside_scope\nsnote\nsmeaning\nslimitations\nsevidence\n" |
| 189 | text vsrld "slevel\nsname\nsstate\nsdetail\nsbasis\nSlink\n" |
| 190 | text vsrat "sid\nsbeside\nsoutcome\nssummary\nsled_to\n" |
| 191 | text vsrtr "sid\nstitle\nsstatus\nsstatus_detail\nsplain\nSheadline\nSnot_yield\nsscope\nsclaim_level\nsreceipt\nscommit\nsdate\nslimitations\nsnext_dependency\nsevidence\nSlink\n" |
| 192 | text vsrim "sid\nsclass\nsstatus_detail\nsscope\nsclaim_level\nsreceipt\nscommit\nsdate\nslimitations\nsnext_dependency\nsevidence\nSlink\n" |
| 193 | text vsft "sgenerated_at\nacomponents\nadecisions\noreceipt\n" |
| 194 | text vsfc "skey\nsname\nsrepo\nsrole\nsurl\nspushed_at\nuopen_prs\nOlast_merge\n" |
| 195 | text vsfm "unumber\nstitle\nsmerged_at\nsurl\n" |
| 196 | text vsfd "sid\nstitle\nsurl\n" |
| 197 | text vsfr "srepo\nssha\nscommit_title\nscommitted_at\nsstate\nsdescription\nstarget_url\nsupdated_at\n" |
| 198 | text vsat "sgenerated_at\nsorg\narepos\n" |
| 199 | text vsar "sname\nsdescription\nsurl\nsdefault_branch\nbfork\nspushed_at\nBarchived\nSbrief\n" |
| 200 | text vkid "id" |
| 201 | text vkstatus "status" |
| 202 | text vkrcpt "receipt" |
| 203 | text vkbox "box" |
| 204 | text vklinks "links" |
| 205 | text vkfacts2 "facts" |
| 206 | text vkledger "ledger" |
| 207 | text vkcmd "command" |
| 208 | text vktok "tok_s" |
| 209 | text vkceil "ceiling" |
| 210 | text vkceils "ceilings" |
| 211 | text vkmachs "machines" |
| 212 | text vkspeeds "speeds" |
| 213 | text vkmore "more" |
| 214 | text vklink "link" |
| 215 | text vkedate "evidence_date" |
| 216 | text vkonmain "on_main" |
| 217 | text vkbranch "branch" |
| 218 | text vkmain "main" |
| 219 | text vkhttps "https://" |
| 220 | text vkparts "parts" |
| 221 | text vkbelow "below" |
| 222 | text vklayers "layers" |
| 223 | text vkcuda2 "cuda" |
| 224 | text vkomg "omega" |
| 225 | text vkjob "job" |
| 226 | text vknotyet "not_yet" |
| 227 | text vkbeyond "beyond" |
| 228 | text vkbar "bar" |
| 229 | text vkperf "performance" |
| 230 | text vksource "source" |
| 231 | text vkdoc "doc" |
| 232 | text vkissue "issue" |
| 233 | text vkodoc "o:docs/OMEGA.md" |
| 234 | text vkoev "o:evidence/" |
| 235 | text vkoev2 "o/:evidence/" |
| 236 | text vkpass "PASS" |
| 237 | text vkpart "PARTIAL" |
| 238 | text vkmiss "MISSING" |
| 239 | text vknotr "AS SHIPPED" |
| 240 | text vkinpr "IN PROGRESS" |
| 241 | text vknv "AS SHIPPED" |
| 242 | text vbarc "C1\nC2\nC3\nC4\nC5\nC6\n" |
| 243 | text vbarp "P0\nP1\nP2\nP3\nP4\n" |
| 244 | text vkhops "hops" |
| 245 | text vksteps "steps" |
| 246 | text vkpains "pains" |
| 247 | text vkswaps "swaps" |
| 248 | text vkreadme "readme" |
| 249 | text vkhow "how" |
| 250 | text vkodoc2 "omega_doc" |
| 251 | text vkplink "purpose_link" |
| 252 | text vkalink "audit_link" |
| 253 | text vkdnb "did_not_box" |
| 254 | text vkvis "visibility" |
| 255 | text vkpriv "private" |
| 256 | text vkpub "public" |
| 257 | text vkevid "evidence/" |
| 258 | text vomap "om@:\no/:\nob:\no:\np:\nc@:\nc/:\nc:\na:\nb:\nissue:\n" |
| 259 | note vopin: vomap's pin table, entry for entry; an entry starting with '1' is pinned (om@: needs a 40-hex commit). A separate text because omc error 19 refuses vomap in both params, see sv_xlinks. |
| 260 | text vopin "1m@:\no/:\nob:\no:\np:\nc@:\nc/:\nc:\na:\nb:\nissue:\n" |
| 261 | text vcmap "cp/:\ncp@:\ncp:\nom@:\nax@:\nsc@/:\ns:\n" |
| 262 | text vcpin "0\n1\n0\n1\n1\n1\n0\n" |
| 263 | text vdotdot ".." |
| 264 | text vsp1 " " |
| 265 | text vrstat "PASS\nFAIL\nINCOMPLETE\nBLOCKED\nPARTIAL\nNOT ESTABLISHED\nNOT STARTED\n" |
| 266 | text vrlad "achieved\npartial\nnot achieved\nnot attempted\n" |
| 267 | text vrcls "Implemented\nPartially implemented\nExperimental\nPlanned\nResearch hypothesis\n" |
| 268 | text vrlev "L0\nL1\nL2\nL3\nL4\nL5\nL6\nL7+\n" |
| 269 | text vkals "allowed_statuses" |
| 270 | text vkall "allowed_ladder_states" |
| 271 | text vkalc "allowed_classes" |
| 272 | text vkladder "ladder" |
| 273 | text vklevel "level" |
| 274 | text vkstate "state" |
| 275 | text vkach "achieved" |
| 276 | text vkcur "current_level" |
| 277 | text vktrows "turing_rows" |
| 278 | text vkirows "implementation_rows" |
| 279 | text vkclass "class" |
| 280 | text vkatt "attempts" |
| 281 | text vkbeside "beside" |
| 282 | text vkoutc "outcome" |
| 283 | text vkledto "led_to" |
| 284 | text vkabbr "abbreviations" |
| 285 | text vkscom "source_commits" |
| 286 | text vkgh "https://interplane.io/drakestapleton/" |
| 287 | text vkgh2 "github.com" |
| 288 | text vkcomp "components" |
| 289 | text vkdec "decisions" |
| 290 | text vklm "last_merge" |
| 291 | text vkrepos "repos" |
| 292 | text vkseries "series" |
| 293 | text vksum "summary" |
| 294 | text vkasof "asof" |
| 295 | text vkdate "date" |
| 296 | text vklangs "langs" |
| 297 | text vkname "name" |
| 298 | text vkprc "prCount" |
| 299 | text vkcic "ciCount" |
| 300 | text vkcico "ciConclusions" |
| 301 | text vkhead "head" |
| 302 | text vkurl "url" |
| 303 | text vmet "source\ntest\ndocs\nloc\nfiles\ntestfiles\ndocfiles\nrepos\ncommits\nprs\nmerged\nci\n" |
| 304 | text vkloc "loc" |
| 305 | text vktest "test" |
| 306 | text vkmerged "merged" |
| 307 | text vkprs "prs" |
| 308 | text vktfiles "testfiles" |
| 309 | text vkfiles "files" |
| 310 | text vkci "ci" |
| 311 | text vkghp "https://interplane.io/drakestapleton/" |
| 312 | text vkrad "https://radicle.network/nodes/rosa.radicle.network/rad:z" |
| 313 | text vst5 "IMPLEMENTED\nQUALIFIED\nEXPERIMENTAL\nBLOCKED\nPLANNED\n" |
| 314 | text vkstats "statuses" |
| 315 | text vknote "note" |
| 316 | text vkpath "path" |
| 317 | text vktitle "title" |
| 318 | text vkdesc "description" |
| 319 | text vkeng "english" |
| 320 | text vkquotes "quotes" |
| 321 | text vkqtxt "quote" |
| 322 | text vlhead "id\topened_utc\towner\tstatus\titem\tdone_when\tevidence\tupdated_utc\n" |
| 323 | text vrfcctx "rfc 8032 7.1 test 1" |
| 324 | text vrfcval "secret is 9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60;" |
| 325 | global vdec ulong 12 |
| 326 | global vlx ulong 3 |
| 327 | global vseen ulong 4096 |
| 328 | global vqo ulong 512 |
| 329 | global vqn ulong 512 |
| 330 | global vqio ulong 512 |
| 331 | global vqin ulong 512 |
| 332 | global vqc ulong 1 |
| 333 | |
| 334 | note ---------------------------------------------------------------- report and load |
| 335 | fn sv_failt rule view uchar * why view uchar * extra view uchar * to void |
| 336 | sv_head rule |
| 337 | sr_diag why |
| 338 | sr_diag vtxo |
| 339 | sr_diag extra |
| 340 | sr_diag vtxc |
| 341 | sr_diag vtnl |
| 342 | end |
| 343 | fn sv_jload to ulong |
| 344 | wp = new uchar 4352 0 |
| 345 | for wj ulong get vpn 0 |
| 346 | put wp wj get vpath wj |
| 347 | end |
| 348 | sv_ctxp |
| 349 | sr_diag vtjr |
| 350 | sv_errc |
| 351 | sr_diag vtnl |
| 352 | ret sj_load view part wp 0 get vpn 0 |
| 353 | end |
| 354 | note sv_jsl: a decoded JSON string copied into a new slot (0 when the node is not a string). |
| 355 | fn sv_jsl node ulong to ulong |
| 356 | if ne sj_kind node 3 |
| 357 | ret 0 |
| 358 | end |
| 359 | ws = sv_snew |
| 360 | for wj ulong sj_size node |
| 361 | sv_push sj_byte node wj |
| 362 | end |
| 363 | ret ws |
| 364 | end |
| 365 | fn sv_jnum node ulong to ulong |
| 366 | ws = sv_snew |
| 367 | for wj ulong sj_numsize node |
| 368 | sv_push sj_numbyte node wj |
| 369 | end |
| 370 | ret ws |
| 371 | end |
| 372 | fn sv_teq node ulong t view uchar * k ulong to bool |
| 373 | wa = sv_tat t k |
| 374 | ret sj_eq node part t wa sv_tlen t wa |
| 375 | end |
| 376 | fn sv_tin node ulong t view uchar * to bool |
| 377 | for wk ulong sv_tcount t |
| 378 | if sv_teq node t wk |
| 379 | ret true |
| 380 | end |
| 381 | end |
| 382 | ret false |
| 383 | end |
| 384 | fn sv_fld node ulong t view uchar * k ulong to ulong |
| 385 | wa = sv_tat t k |
| 386 | ret sj_find node part t wa sv_tlen t wa |
| 387 | end |
| 388 | |
| 389 | note ---------------------------------------------------------------- numbers (lexical) |
| 390 | fn sv_isdig c uchar to bool |
| 391 | ret and ge c 48 le c 57 |
| 392 | end |
| 393 | note sv_u64: a JSON integer token without sign, fraction or exponent, at most 2^64-1 |
| 394 | note (WolframLanguageEvaluator: 2^64 - 1 -> 18446744073709551615). |
| 395 | text vu64max "18446744073709551615" |
| 396 | fn sv_u64 node ulong to bool |
| 397 | if ne sj_kind node 4 |
| 398 | ret false |
| 399 | end |
| 400 | wn = sj_numsize node |
| 401 | for wj ulong wn |
| 402 | if not sv_isdig sj_numbyte node wj |
| 403 | ret false |
| 404 | end |
| 405 | end |
| 406 | if lt wn 20 |
| 407 | ret true |
| 408 | end |
| 409 | if gt wn 20 |
| 410 | ret false |
| 411 | end |
| 412 | for wj ulong 20 |
| 413 | wc = sj_numbyte node wj |
| 414 | if lt wc get vu64max wj |
| 415 | ret true |
| 416 | end |
| 417 | if gt wc get vu64max wj |
| 418 | ret false |
| 419 | end |
| 420 | end |
| 421 | ret true |
| 422 | end |
| 423 | note sv_safe: collector.rs safe_count: a non-negative integral value at most 2^53 - 1 |
| 424 | note (WolframLanguageEvaluator: 2^53 - 1 -> 9007199254740991). Every digit of the token |
| 425 | note (integer and fraction) is read into one integer m with f fraction digits and exponent e, so the |
| 426 | note value is m * 10^(e - f), evaluated exactly. A value that is not an exact integer is refused; |
| 427 | note so is a token with more than 16 significant digits (serde would round it through f64; this |
| 428 | note port refuses instead: stricter, never looser). Returns VNONE when not safe. |
| 429 | const VSAFE ulong 9007199254740991 |
| 430 | fn sv_safe node ulong to ulong |
| 431 | if ne sj_kind node 4 |
| 432 | ret VNONE |
| 433 | end |
| 434 | wn = sj_numsize node |
| 435 | wi = ulong 0 |
| 436 | wneg = false |
| 437 | if eq sj_numbyte node 0 45 |
| 438 | wneg = true |
| 439 | wi = 1 |
| 440 | end |
| 441 | wm = ulong 0 |
| 442 | wfr = ulong 0 |
| 443 | wfx = false |
| 444 | wbig = false |
| 445 | while lt wi wn bound 400 |
| 446 | c = sj_numbyte node wi |
| 447 | if or eq c 101 eq c 69 |
| 448 | break |
| 449 | end |
| 450 | if eq c 46 |
| 451 | wfx = true |
| 452 | else |
| 453 | if wfx |
| 454 | wfr = add wfr 1 |
| 455 | end |
| 456 | if gt wm 900719925474099 |
| 457 | wbig = true |
| 458 | else |
| 459 | wm = add mul wm 10 ulong sub c 48 |
| 460 | end |
| 461 | end |
| 462 | wi = add wi 1 |
| 463 | end |
| 464 | wex = long 0 |
| 465 | if lt wi wn |
| 466 | wi = add wi 1 |
| 467 | wes = long 1 |
| 468 | if eq sj_numbyte node wi 45 |
| 469 | wes = -1 |
| 470 | wi = add wi 1 |
| 471 | else |
| 472 | if eq sj_numbyte node wi 43 |
| 473 | wi = add wi 1 |
| 474 | end |
| 475 | end |
| 476 | while lt wi wn bound 400 |
| 477 | if gt wex 100000 |
| 478 | ret VNONE |
| 479 | end |
| 480 | wex = add mul wex 10 long sub sj_numbyte node wi 48 |
| 481 | wi = add wi 1 |
| 482 | end |
| 483 | wex = mul wex wes |
| 484 | end |
| 485 | if wbig |
| 486 | ret VNONE |
| 487 | end |
| 488 | ret sv_safe2 wm sub wex long wfr wneg |
| 489 | end |
| 490 | fn sv_safe2 wm ulong wsc long wneg bool to ulong |
| 491 | while lt wsc 0 bound 200100 |
| 492 | if eq wm 0 |
| 493 | break |
| 494 | end |
| 495 | if ne rem wm 10 0 |
| 496 | ret VNONE |
| 497 | end |
| 498 | wm = div wm 10 |
| 499 | wsc = add wsc 1 |
| 500 | end |
| 501 | while and gt wsc 0 ne wm 0 bound 200100 |
| 502 | if gt wm 900719925474099 |
| 503 | ret VNONE |
| 504 | end |
| 505 | wm = mul wm 10 |
| 506 | wsc = sub wsc 1 |
| 507 | end |
| 508 | if gt wm VSAFE |
| 509 | ret VNONE |
| 510 | end |
| 511 | if and wneg ne wm 0 |
| 512 | ret VNONE |
| 513 | end |
| 514 | ret wm |
| 515 | end |
| 516 | note sv_decp: parse a plain JSON decimal (no exponent) in slot s into vdec[6k .. 6k+5]: |
| 517 | note negative, int offset, int length, fraction offset, fraction length, is-zero. False when an |
| 518 | note exponent is present (refused: lexical comparison only, never float rounding). |
| 519 | fn sv_decp s ulong k ulong to bool |
| 520 | wn = sv_n s |
| 521 | wi = ulong 0 |
| 522 | wneg = ulong 0 |
| 523 | if and gt wn 0 eq sv_b s 0 45 |
| 524 | wneg = 1 |
| 525 | wi = 1 |
| 526 | end |
| 527 | wi0 = wi |
| 528 | while and lt wi wn sv_isdig sv_b s wi bound 400 |
| 529 | wi = add wi 1 |
| 530 | end |
| 531 | wil = sub wi wi0 |
| 532 | wf0 = wi |
| 533 | wfl = ulong 0 |
| 534 | if and lt wi wn eq sv_b s wi 46 |
| 535 | wi = add wi 1 |
| 536 | wf0 = wi |
| 537 | while and lt wi wn sv_isdig sv_b s wi bound 400 |
| 538 | wi = add wi 1 |
| 539 | end |
| 540 | wfl = sub wi wf0 |
| 541 | end |
| 542 | if ne wi wn |
| 543 | ret false |
| 544 | end |
| 545 | wz = ulong 1 |
| 546 | for wj ulong wil |
| 547 | if ne sv_b s add wi0 wj 48 |
| 548 | wz = 0 |
| 549 | end |
| 550 | end |
| 551 | for wj ulong wfl |
| 552 | if ne sv_b s add wf0 wj 48 |
| 553 | wz = 0 |
| 554 | end |
| 555 | end |
| 556 | wb = mul k 6 |
| 557 | put vdec wb wneg |
| 558 | put vdec add wb 1 wi0 |
| 559 | put vdec add wb 2 wil |
| 560 | put vdec add wb 3 wf0 |
| 561 | put vdec add wb 4 wfl |
| 562 | put vdec add wb 5 wz |
| 563 | ret true |
| 564 | end |
| 565 | note sv_magcmp: compare magnitudes of parsed decimals 0 (slot a) and 1 (slot b): 0 less, 1 equal, |
| 566 | note 2 greater. JSON forbids leading zeros except a lone 0, so integer length orders first. |
| 567 | fn sv_magcmp a ulong b ulong to ulong |
| 568 | if ne get vdec 2 get vdec 8 |
| 569 | if lt get vdec 2 get vdec 8 |
| 570 | ret 0 |
| 571 | end |
| 572 | ret 2 |
| 573 | end |
| 574 | for wj ulong get vdec 2 |
| 575 | wx = sv_b a add get vdec 1 wj |
| 576 | wy = sv_b b add get vdec 7 wj |
| 577 | if lt wx wy |
| 578 | ret 0 |
| 579 | end |
| 580 | if gt wx wy |
| 581 | ret 2 |
| 582 | end |
| 583 | end |
| 584 | wl = get vdec 4 |
| 585 | if gt get vdec 10 wl |
| 586 | wl = get vdec 10 |
| 587 | end |
| 588 | for wj ulong wl |
| 589 | wx = uchar 48 |
| 590 | wy = uchar 48 |
| 591 | if lt wj get vdec 4 |
| 592 | wx = sv_b a add get vdec 3 wj |
| 593 | end |
| 594 | if lt wj get vdec 10 |
| 595 | wy = sv_b b add get vdec 9 wj |
| 596 | end |
| 597 | if lt wx wy |
| 598 | ret 0 |
| 599 | end |
| 600 | if gt wx wy |
| 601 | ret 2 |
| 602 | end |
| 603 | end |
| 604 | ret 1 |
| 605 | end |
| 606 | note sv_deccmp: a <=> b for two plain decimal slots; 3 when either is not plain. |
| 607 | fn sv_deccmp a ulong b ulong to ulong |
| 608 | if not sv_decp a 0 |
| 609 | ret 3 |
| 610 | end |
| 611 | if not sv_decp b 1 |
| 612 | ret 3 |
| 613 | end |
| 614 | wna = and eq get vdec 0 1 eq get vdec 5 0 |
| 615 | wnb = and eq get vdec 6 1 eq get vdec 11 0 |
| 616 | if and wna not wnb |
| 617 | ret 0 |
| 618 | end |
| 619 | if and wnb not wna |
| 620 | ret 2 |
| 621 | end |
| 622 | wm = sv_magcmp a b |
| 623 | if wna |
| 624 | ret sub 2 wm |
| 625 | end |
| 626 | ret wm |
| 627 | end |
| 628 | |
| 629 | note ---------------------------------------------------------------- shapes |
| 630 | fn sv_lpair node ulong to bool |
| 631 | if ne sj_kind node 2 |
| 632 | ret false |
| 633 | end |
| 634 | wc = sj_first node |
| 635 | while ne wc 0 bound 65536 |
| 636 | if ne sj_kind wc 2 |
| 637 | ret false |
| 638 | end |
| 639 | if ne sj_len wc 2 |
| 640 | ret false |
| 641 | end |
| 642 | wx = sj_first wc |
| 643 | if ne sj_kind wx 3 |
| 644 | ret false |
| 645 | end |
| 646 | if ne sj_kind sj_next wx 3 |
| 647 | ret false |
| 648 | end |
| 649 | wc = sj_next wc |
| 650 | end |
| 651 | ret true |
| 652 | end |
| 653 | fn sv_strs node ulong to bool |
| 654 | if ne sj_kind node 2 |
| 655 | ret false |
| 656 | end |
| 657 | wc = sj_first node |
| 658 | while ne wc 0 bound 65536 |
| 659 | if ne sj_kind wc 3 |
| 660 | ret false |
| 661 | end |
| 662 | wc = sj_next wc |
| 663 | end |
| 664 | ret true |
| 665 | end |
| 666 | fn sv_ty node ulong code uchar to bool |
| 667 | wk = sj_kind node |
| 668 | if eq code 115 |
| 669 | ret eq wk 3 |
| 670 | end |
| 671 | if eq code 83 |
| 672 | ret or eq wk 3 eq wk 7 |
| 673 | end |
| 674 | if eq code 97 |
| 675 | ret eq wk 2 |
| 676 | end |
| 677 | if eq code 84 |
| 678 | ret sv_strs node |
| 679 | end |
| 680 | if eq code 111 |
| 681 | ret eq wk 1 |
| 682 | end |
| 683 | if eq code 79 |
| 684 | ret or eq wk 1 eq wk 7 |
| 685 | end |
| 686 | if or eq code 98 eq code 66 |
| 687 | ret or eq wk 5 eq wk 6 |
| 688 | end |
| 689 | if eq code 110 |
| 690 | ret eq wk 4 |
| 691 | end |
| 692 | if eq code 78 |
| 693 | ret or eq wk 4 eq wk 7 |
| 694 | end |
| 695 | if eq code 117 |
| 696 | ret sv_u64 node |
| 697 | end |
| 698 | if eq code 76 |
| 699 | ret sv_lpair node |
| 700 | end |
| 701 | ret false |
| 702 | end |
| 703 | fn sv_opt code uchar to bool |
| 704 | ret or or eq code 83 eq code 79 or or eq code 66 eq code 78 false |
| 705 | end |
| 706 | note sv_keycnt: how many members of object node carry key (serde: a known field twice is an error). |
| 707 | fn sv_keycnt node ulong key view uchar * to ulong |
| 708 | wn = ulong 0 |
| 709 | wc = sj_first node |
| 710 | while ne wc 0 bound 65536 |
| 711 | if sj_keyis wc key |
| 712 | wn = add wn 1 |
| 713 | end |
| 714 | wc = sj_next wc |
| 715 | end |
| 716 | ret wn |
| 717 | end |
| 718 | note sv_shty: one present key's JSON type check for sv_shape (split out for registers). |
| 719 | fn sv_shty node ulong spec view uchar * wa ulong wl ulong wcode uchar to bool |
| 720 | wf = sj_find node part spec add wa 1 sub wl 1 |
| 721 | if not sv_ty wf wcode |
| 722 | sv_failt vrb4 vttyp part spec add wa 1 sub wl 1 |
| 723 | ret false |
| 724 | end |
| 725 | ret true |
| 726 | end |
| 727 | note sv_shape: serde derive for one struct. deny adds deny_unknown_fields: every member must be |
| 728 | note a listed field (members counted against distinct listed keys found, each at most once). |
| 729 | fn sv_shape node ulong spec view uchar * deny bool to bool |
| 730 | if ne sj_kind node 1 |
| 731 | sv_fail vrb4 vtnob |
| 732 | ret false |
| 733 | end |
| 734 | wok = true |
| 735 | wfound = ulong 0 |
| 736 | for wk ulong sv_tcount spec |
| 737 | wa = sv_tat spec wk |
| 738 | wl = sv_tlen spec wa |
| 739 | wcode = get spec wa |
| 740 | wcn = sv_keycnt node part spec add wa 1 sub wl 1 |
| 741 | if gt wcn 1 |
| 742 | sv_failt vrb4 vtdup part spec add wa 1 sub wl 1 |
| 743 | wok = false |
| 744 | end |
| 745 | if eq wcn 0 |
| 746 | if not sv_opt wcode |
| 747 | sv_failt vrb4 vtmis part spec add wa 1 sub wl 1 |
| 748 | wok = false |
| 749 | end |
| 750 | else |
| 751 | wfound = add wfound wcn |
| 752 | if not sv_shty node spec wa wl wcode |
| 753 | wok = false |
| 754 | end |
| 755 | end |
| 756 | end |
| 757 | if and deny ne wfound sj_len node |
| 758 | sv_fail vrb4 vtunk |
| 759 | wok = false |
| 760 | end |
| 761 | ret wok |
| 762 | end |
| 763 | fn sv_shapeat node ulong key view uchar * spec view uchar * deny bool to bool |
| 764 | ret sv_shape sj_find node key spec deny |
| 765 | end |
| 766 | note sv_each: every item of the array under key has the struct shape. |
| 767 | fn sv_each node ulong key view uchar * spec view uchar * deny bool to bool |
| 768 | wa = sj_find node key |
| 769 | if ne sj_kind wa 2 |
| 770 | ret false |
| 771 | end |
| 772 | wok = true |
| 773 | wc = sj_first wa |
| 774 | while ne wc 0 bound 65536 |
| 775 | if not sv_shape wc spec deny |
| 776 | wok = false |
| 777 | end |
| 778 | wc = sj_next wc |
| 779 | end |
| 780 | ret wok |
| 781 | end |
| 782 | |
| 783 | note ---------------------------------------------------------------- text checks |
| 784 | fn sv_sdash node ulong to bool |
| 785 | ws = sv_jsl node |
| 786 | if eq ws 0 |
| 787 | ret false |
| 788 | end |
| 789 | wd = sv_dash ws |
| 790 | sv_drop ws |
| 791 | ret wd |
| 792 | end |
| 793 | note machines.rs check_text: no em/en dash, no FORBIDDEN word in the ASCII-lowercased text. |
| 794 | fn sv_ctext node ulong to void |
| 795 | ws = sv_jsl node |
| 796 | if eq ws 0 |
| 797 | ret |
| 798 | end |
| 799 | if sv_dash ws |
| 800 | sv_failx vrb4 vtdsh get vso ws get vsn ws |
| 801 | end |
| 802 | for wk ulong sv_tcount vforbid |
| 803 | wa = sv_tat vforbid wk |
| 804 | if sv_hasc ws part vforbid wa sv_tlen vforbid wa |
| 805 | sv_failx vrb4 vtfor get vso ws get vsn ws |
| 806 | end |
| 807 | end |
| 808 | sv_drop ws |
| 809 | end |
| 810 | fn sv_ctexts node ulong fields view uchar * to void |
| 811 | for wk ulong sv_tcount fields |
| 812 | sv_ctext sv_fld node fields wk |
| 813 | end |
| 814 | end |
| 815 | fn sv_https node ulong to void |
| 816 | if not sj_prefix node vkhttps |
| 817 | ws = sv_jsl node |
| 818 | if eq ws 0 |
| 819 | sv_fail vrb4 vthttps |
| 820 | ret |
| 821 | end |
| 822 | sv_failx vrb4 vthttps get vso ws get vsn ws |
| 823 | sv_drop ws |
| 824 | end |
| 825 | end |
| 826 | note research_status.rs: an independent recheck link is https and never names github.com. |
| 827 | fn sv_rchk node ulong to void |
| 828 | sv_https node |
| 829 | ws = sv_jsl node |
| 830 | if eq ws 0 |
| 831 | ret |
| 832 | end |
| 833 | if ne sv_findn ws vkgh2 0 sv_n ws VNONE |
| 834 | sv_failx vrb4 vthttps get vso ws get vsn ws |
| 835 | end |
| 836 | sv_drop ws |
| 837 | end |
| 838 | fn sv_rawdash rule view uchar * to void |
| 839 | ws = sv_load |
| 840 | if eq ws 0 |
| 841 | ret |
| 842 | end |
| 843 | if sv_dash ws |
| 844 | sv_fail rule vtdsh |
| 845 | end |
| 846 | sv_drop ws |
| 847 | end |
| 848 | |
| 849 | note ---------------------------------------------------------------- machines.json |
| 850 | fn sv_vceil root ulong to void |
| 851 | wa = sj_find root vkceils |
| 852 | wc = sj_first wa |
| 853 | while ne wc 0 bound 65536 |
| 854 | sv_https sj_find wc vklink |
| 855 | sv_ctexts wc vccei |
| 856 | wt = sj_find wc vktok |
| 857 | if eq sj_kind wt 4 |
| 858 | ws = sv_jnum wt |
| 859 | wz = sv_snew |
| 860 | sv_push 48 |
| 861 | if ne sv_deccmp ws wz 2 |
| 862 | sv_failx vrb4 vtcpos get vso ws get vsn ws |
| 863 | end |
| 864 | sv_drop ws |
| 865 | end |
| 866 | wc = sj_next wc |
| 867 | end |
| 868 | end |
| 869 | fn sv_vmachs root ulong to void |
| 870 | wa = sj_find root vkmachs |
| 871 | if eq sj_len wa 0 |
| 872 | sv_fail vrb4 vtnomach |
| 873 | end |
| 874 | wc = sj_first wa |
| 875 | while ne wc 0 bound 65536 |
| 876 | sv_https sj_find wc vklink |
| 877 | sv_ctexts wc vcmac |
| 878 | if ne sj_size sj_find wc vkedate 10 |
| 879 | sv_fail vrb4 vtedate |
| 880 | end |
| 881 | wm = sj_first sj_find wc vkmore |
| 882 | while ne wm 0 bound 65536 |
| 883 | note An extra with no forge copy is a plain label (empty link), never an outside link. |
| 884 | if gt sj_size sj_find wm vklink 0 |
| 885 | sv_https sj_find wm vklink |
| 886 | end |
| 887 | sv_ctexts wm vclnk |
| 888 | wm = sj_next wm |
| 889 | end |
| 890 | wc = sj_next wc |
| 891 | end |
| 892 | end |
| 893 | note sv_ceilof: the first ceiling with this id (Data::ceiling); 0 for an empty or unknown id. |
| 894 | fn sv_ceilof root ulong id ulong to ulong |
| 895 | if eq sj_size id 0 |
| 896 | ret 0 |
| 897 | end |
| 898 | wc = sj_first sj_find root vkceils |
| 899 | while ne wc 0 bound 65536 |
| 900 | if sj_same sj_find wc vkid id |
| 901 | ret wc |
| 902 | end |
| 903 | wc = sj_next wc |
| 904 | end |
| 905 | ret 0 |
| 906 | end |
| 907 | fn sv_vspeed root ulong sp ulong to void |
| 908 | sv_https sj_find sp vklink |
| 909 | sv_ctexts sp vcspd |
| 910 | wid = sj_find sp vkceil |
| 911 | wt = sj_find sp vktok |
| 912 | wce = sv_ceilof root wid |
| 913 | if and gt sj_size wid 0 eq wce 0 |
| 914 | sv_fail vrb4 vtuceil |
| 915 | end |
| 916 | if and gt sj_size wid 0 ne sj_kind wt 4 |
| 917 | sv_fail vrb4 vtnceil |
| 918 | end |
| 919 | if and eq sj_kind wt 4 ne wce 0 |
| 920 | ws = sv_jnum wt |
| 921 | wz = sv_jnum sj_find wce vktok |
| 922 | wr = sv_deccmp ws wz |
| 923 | if eq wr 3 |
| 924 | sv_failx vrb4 vtplain get vso ws get vsn ws |
| 925 | end |
| 926 | if eq wr 2 |
| 927 | sv_failx vrb4 vtaceil get vso ws get vsn ws |
| 928 | end |
| 929 | sv_drop ws |
| 930 | end |
| 931 | if and eq sj_kind sj_find sp vkonmain 5 not sj_eq sj_find sp vkbranch vkmain |
| 932 | sv_fail vrb4 vtonm |
| 933 | end |
| 934 | end |
| 935 | fn sv_vspeeds root ulong to void |
| 936 | wa = sj_find root vkspeeds |
| 937 | if eq sj_len wa 0 |
| 938 | sv_fail vrb4 vtnospd |
| 939 | end |
| 940 | wc = sj_first wa |
| 941 | wi = ulong 0 |
| 942 | while ne wc 0 bound 4096 |
| 943 | sv_vspeed root wc |
| 944 | put vseen wi sj_find wc vkid |
| 945 | for wj ulong wi |
| 946 | if sj_same get vseen wj get vseen wi |
| 947 | sv_fail vrb4 vtdupid |
| 948 | end |
| 949 | end |
| 950 | wi = add wi 1 |
| 951 | wc = sj_next wc |
| 952 | end |
| 953 | end |
| 954 | fn sv_vmach to bool |
| 955 | wf = get vfail 0 |
| 956 | sv_ctxp |
| 957 | wr = sv_jload |
| 958 | if not sv_shape wr vsmt true |
| 959 | ret false |
| 960 | end |
| 961 | wok = sv_each wr vkceils vsmc true |
| 962 | wok = and wok sv_each wr vkmachs vsmm true |
| 963 | wok = and wok sv_each wr vkspeeds vsms true |
| 964 | wm = sj_first sj_find wr vkmachs |
| 965 | while ne wm 0 bound 65536 |
| 966 | if eq sj_kind wm 1 |
| 967 | wok = and wok sv_each wm vkmore vsml true |
| 968 | end |
| 969 | wm = sj_next wm |
| 970 | end |
| 971 | if not wok |
| 972 | ret false |
| 973 | end |
| 974 | sv_ctexts wr vctop |
| 975 | sv_vceil wr |
| 976 | sv_vmachs wr |
| 977 | sv_vspeeds wr |
| 978 | ret eq get vfail 0 wf |
| 979 | end |
| 980 | |
| 981 | note ---------------------------------------------------------------- short links |
| 982 | note sv_xlink: omega.rs / cudaplusplus.rs expand(). map is a prefix table, pin marks the prefixes |
| 983 | note that must name a full 40-hex commit. Box links must expand onto the forge (every base is |
| 984 | note https://interplane.io/drakestapleton/...; a site-relative / or # link is not a box link). |
| 985 | fn sv_xlink node ulong map view uchar * pin view uchar * box bool to void |
| 986 | ws = sv_jsl node |
| 987 | if eq ws 0 |
| 988 | sv_fail vrb4 vtlink |
| 989 | ret |
| 990 | end |
| 991 | wn = sv_n ws |
| 992 | if and gt wn 0 or eq sv_b ws 0 47 eq sv_b ws 0 35 |
| 993 | if box |
| 994 | sv_failx vrb4 vtboxg get vso ws wn |
| 995 | end |
| 996 | sv_drop ws |
| 997 | ret |
| 998 | end |
| 999 | for wk ulong sv_tcount map |
| 1000 | wa = sv_tat map wk |
| 1001 | wl = sv_tlen map wa |
| 1002 | if sv_eqat ws 0 part map wa wl |
| 1003 | sv_xrest ws wl eq get pin sv_tat pin wk 49 |
| 1004 | sv_drop ws |
| 1005 | ret |
| 1006 | end |
| 1007 | end |
| 1008 | sv_failx vrb4 vtlink get vso ws wn |
| 1009 | sv_drop ws |
| 1010 | end |
| 1011 | fn sv_xrest ws ulong wl ulong pinned bool to void |
| 1012 | wn = sv_n ws |
| 1013 | wrn = sub wn wl |
| 1014 | wbad = or eq wrn 0 or sv_hasn ws vdotdot wl wn sv_hasn ws vsp1 wl wn |
| 1015 | if wbad |
| 1016 | sv_failx vrb4 vtlink get vso ws wn |
| 1017 | ret |
| 1018 | end |
| 1019 | if pinned |
| 1020 | wok = ge wrn 41 |
| 1021 | if wok |
| 1022 | for wj ulong 40 |
| 1023 | wc = sv_b ws add wl wj |
| 1024 | wh = and ge wc 97 le wc 102 |
| 1025 | wh = or wh and ge wc 65 le wc 70 |
| 1026 | wh = or sv_isdig wc wh |
| 1027 | if not wh |
| 1028 | wok = false |
| 1029 | end |
| 1030 | end |
| 1031 | end |
| 1032 | if wok |
| 1033 | wok = eq sv_b ws add wl 40 47 |
| 1034 | end |
| 1035 | if not wok |
| 1036 | sv_failx vrb4 vtpin get vso ws wn |
| 1037 | end |
| 1038 | end |
| 1039 | end |
| 1040 | fn sv_xlinks node ulong map view uchar * pin view uchar * to void |
| 1041 | wc = sj_first sj_find node vklinks |
| 1042 | while ne wc 0 bound 65536 |
| 1043 | sv_xlink sj_next sj_first wc map pin false |
| 1044 | wc = sj_next wc |
| 1045 | end |
| 1046 | end |
| 1047 | fn sv_obox node ulong to void |
| 1048 | sv_xlink node vomap vopin true |
| 1049 | end |
| 1050 | note vopin is the omega pin table: only om@: (written 1m@:) is pinned; every other entry starts with a |
| 1051 | note byte other than 49 ('1'), so sv_xlink's pin lookup reads false for each. |
| 1052 | |
| 1053 | note ---------------------------------------------------------------- omega.json |
| 1054 | fn sv_vobar node ulong ids view uchar * why view uchar * to void |
| 1055 | wc = sj_first node |
| 1056 | wk = ulong 0 |
| 1057 | wok = eq sj_len node sv_tcount ids |
| 1058 | while ne wc 0 bound 64 |
| 1059 | if lt wk sv_tcount ids |
| 1060 | if not sv_teq sj_find wc vkid ids wk |
| 1061 | wok = false |
| 1062 | end |
| 1063 | end |
| 1064 | wst = sj_find wc vkstatus |
| 1065 | if not or or sj_eq wst vkpass sj_eq wst vkpart sj_eq wst vkmiss |
| 1066 | sv_failt vrb4 vtstat vkbar |
| 1067 | end |
| 1068 | wr = sj_find wc vkrcpt |
| 1069 | whas = eq sj_kind wr 3 |
| 1070 | if sj_eq wst vkpass |
| 1071 | if not whas |
| 1072 | sv_fail vrb4 vtpassr |
| 1073 | else |
| 1074 | if not or sj_prefix wr vkoev sj_prefix wr vkoev2 |
| 1075 | sv_fail vrb4 vtpassu |
| 1076 | end |
| 1077 | end |
| 1078 | else |
| 1079 | if whas |
| 1080 | sv_fail vrb4 vtnpr |
| 1081 | end |
| 1082 | end |
| 1083 | if whas |
| 1084 | sv_obox wr |
| 1085 | end |
| 1086 | sv_xlinks wc vomap vopin |
| 1087 | wk = add wk 1 |
| 1088 | wc = sj_next wc |
| 1089 | end |
| 1090 | if not wok |
| 1091 | sv_fail vrb4 why |
| 1092 | end |
| 1093 | end |
| 1094 | fn sv_vocards node ulong to void |
| 1095 | wc = sj_first node |
| 1096 | while ne wc 0 bound 65536 |
| 1097 | sv_obox sj_find wc vkbox |
| 1098 | sv_xlinks wc vomap vopin |
| 1099 | wc = sj_next wc |
| 1100 | end |
| 1101 | end |
| 1102 | fn sv_volayers node ulong to void |
| 1103 | if lt sj_len node 13 |
| 1104 | sv_fail vrb4 vtlay |
| 1105 | end |
| 1106 | wc = sj_first node |
| 1107 | while ne wc 0 bound 65536 |
| 1108 | wst = sj_find wc vkstatus |
| 1109 | if not or or sj_eq wst vkpass sj_eq wst vkpart or sj_eq wst vkmiss sj_eq wst vknotr |
| 1110 | sv_failt vrb4 vtstat vklayers |
| 1111 | end |
| 1112 | wz = or eq sj_size sj_find wc vkcuda2 0 or eq sj_size sj_find wc vkomg 0 eq sj_size sj_find wc vkjob 0 |
| 1113 | if wz |
| 1114 | sv_fail vrb4 vtempty |
| 1115 | end |
| 1116 | sv_obox sj_find wc vkbox |
| 1117 | sv_xlinks wc vomap vopin |
| 1118 | wc = sj_next wc |
| 1119 | end |
| 1120 | end |
| 1121 | fn sv_vomega to bool |
| 1122 | wf = get vfail 0 |
| 1123 | sv_ctxp |
| 1124 | sv_rawdash vrb4 |
| 1125 | wr = sv_jload |
| 1126 | if not sv_shape wr vsot true |
| 1127 | ret false |
| 1128 | end |
| 1129 | wok = sv_shapeat wr vksource vsos true |
| 1130 | wok = and wok sv_shapeat wr vksb vsosb true |
| 1131 | if wok |
| 1132 | wok = sv_each sj_find wr vksb vksteps vsost true |
| 1133 | end |
| 1134 | wok = and wok sv_each wr vkparts vsoc true |
| 1135 | wok = and wok sv_shapeat wr vkbelow vsoc true |
| 1136 | wok = and wok sv_each wr vklayers vsol true |
| 1137 | wok = and wok sv_shapeat wr vkrcpt vsor true |
| 1138 | wok = and wok sv_each wr vknotyet vsog true |
| 1139 | wok = and wok sv_each wr vkbar vsob true |
| 1140 | wok = and wok sv_each wr vkbeyond vsog true |
| 1141 | wok = and wok sv_shapeat wr vkperf vsop true |
| 1142 | if wok |
| 1143 | wok = sv_each sj_find wr vkperf vkbar vsob true |
| 1144 | end |
| 1145 | if not wok |
| 1146 | ret false |
| 1147 | end |
| 1148 | wsrc = sj_find wr vksource |
| 1149 | sv_obox sj_find wsrc vkdoc |
| 1150 | sv_obox sj_find wsrc vkissue |
| 1151 | sv_obox sj_find sj_find wr vkbelow vkbox |
| 1152 | sv_xlinks sj_find wr vkbelow vomap vopin |
| 1153 | sv_obox sj_find sj_find wr vkrcpt vkbox |
| 1154 | wsb = sj_find wr vksb |
| 1155 | if ne sj_len sj_find wsb vksteps 8 |
| 1156 | sv_fail vrb4 vtsb |
| 1157 | end |
| 1158 | wc = sj_first sj_find wsb vksteps |
| 1159 | while ne wc 0 bound 64 |
| 1160 | if not sj_prefix sj_find wc vkbox vkompin |
| 1161 | sv_fail vrb4 vtsb |
| 1162 | end |
| 1163 | sv_obox sj_find wc vkbox |
| 1164 | wc = sj_next wc |
| 1165 | end |
| 1166 | sv_xlinks wsb vomap vopin |
| 1167 | sv_vocards sj_find wr vkparts |
| 1168 | sv_volayers sj_find wr vklayers |
| 1169 | sv_vocards sj_find wr vknotyet |
| 1170 | sv_vocards sj_find wr vkbeyond |
| 1171 | sv_vobar sj_find wr vkbar vbarc vtbarc |
| 1172 | sv_vobar sj_find sj_find wr vkperf vkbar vbarp vtbarp |
| 1173 | sv_obox sj_find sj_find wr vkperf vkbox |
| 1174 | sv_xlinks sj_find wr vkperf vomap vopin |
| 1175 | if not sj_prefix sj_find wsrc vkdoc vkodoc |
| 1176 | sv_fail vrb4 vtodoc |
| 1177 | end |
| 1178 | ret eq get vfail 0 wf |
| 1179 | end |
| 1180 | |
| 1181 | note ---------------------------------------------------------------- cudaplusplus.json |
| 1182 | fn sv_cbox node ulong to void |
| 1183 | sv_xlink node vcmap vcpin true |
| 1184 | end |
| 1185 | note check_status(what, status, ledger, receipt): status in STATUSES; IN PROGRESS needs a |
| 1186 | note ledger id L<digits>; PASS needs a receipt containing evidence/. |
| 1187 | fn sv_cstat st ulong ledger ulong rcpt ulong to void |
| 1188 | wok = or or sj_eq st vkpass sj_eq st vkpart or sj_eq st vkinpr sj_eq st vknv |
| 1189 | if not wok |
| 1190 | sv_failt vrb4 vtstat vkstatus |
| 1191 | ret |
| 1192 | end |
| 1193 | if sj_eq st vkinpr |
| 1194 | wl = false |
| 1195 | if eq sj_kind ledger 3 |
| 1196 | wn = sj_size ledger |
| 1197 | if and gt wn 1 eq sj_byte ledger 0 76 |
| 1198 | wl = true |
| 1199 | for wj ulong sub wn 1 |
| 1200 | if not sv_isdig sj_byte ledger add wj 1 |
| 1201 | wl = false |
| 1202 | end |
| 1203 | end |
| 1204 | end |
| 1205 | end |
| 1206 | if not wl |
| 1207 | sv_fail vrb4 vtinp |
| 1208 | end |
| 1209 | end |
| 1210 | if sj_eq st vkpass |
| 1211 | wr = false |
| 1212 | ws = sv_jsl rcpt |
| 1213 | if ne ws 0 |
| 1214 | wr = sv_has ws vkevid |
| 1215 | sv_drop ws |
| 1216 | end |
| 1217 | if not wr |
| 1218 | sv_fail vrb4 vtpasse |
| 1219 | end |
| 1220 | end |
| 1221 | end |
| 1222 | fn sv_chops node ulong to void |
| 1223 | if lt sj_len node 8 |
| 1224 | sv_fail vrb4 vthops |
| 1225 | end |
| 1226 | wc = sj_first node |
| 1227 | while ne wc 0 bound 65536 |
| 1228 | sv_cstat sj_find wc vkstatus sj_find wc vkledger sj_find wc vkbox |
| 1229 | sv_cbox sj_find wc vkbox |
| 1230 | sv_xlinks wc vcmap vcpin |
| 1231 | wc = sj_next wc |
| 1232 | end |
| 1233 | end |
| 1234 | fn sv_ccards node ulong to void |
| 1235 | wc = sj_first node |
| 1236 | while ne wc 0 bound 65536 |
| 1237 | sv_cbox sj_find wc vkbox |
| 1238 | sv_xlinks wc vcmap vcpin |
| 1239 | wc = sj_next wc |
| 1240 | end |
| 1241 | end |
| 1242 | fn sv_crows node ulong to void |
| 1243 | wc = sj_first node |
| 1244 | while ne wc 0 bound 65536 |
| 1245 | wst = sj_find wc vkstatus |
| 1246 | if or sj_eq wst vknv sj_eq wst vkpart |
| 1247 | sv_fail vrb4 vtpain |
| 1248 | end |
| 1249 | sv_cstat wst sj_find wc vkledger sj_find wc vkrcpt |
| 1250 | if and sj_eq wst vkpass ne sj_kind sj_find wc vkcmd 3 |
| 1251 | sv_fail vrb4 vtcmd |
| 1252 | end |
| 1253 | sv_cbox sj_find wc vkbox |
| 1254 | wr = sj_find wc vkrcpt |
| 1255 | if eq sj_kind wr 3 |
| 1256 | sv_cbox wr |
| 1257 | end |
| 1258 | sv_xlinks wc vcmap vcpin |
| 1259 | wc = sj_next wc |
| 1260 | end |
| 1261 | end |
| 1262 | fn sv_vcuda to bool |
| 1263 | wf = get vfail 0 |
| 1264 | sv_ctxp |
| 1265 | sv_rawdash vrb4 |
| 1266 | wr = sv_jload |
| 1267 | if not sv_shape wr vsct true |
| 1268 | ret false |
| 1269 | end |
| 1270 | wok = sv_shapeat wr vksource vscs true |
| 1271 | wok = and wok sv_each wr vkhops vsch true |
| 1272 | wok = and wok sv_each wr vksteps vscc true |
| 1273 | wok = and wok sv_each wr vkpains vscr true |
| 1274 | wok = and wok sv_each wr vkswaps vscr true |
| 1275 | if not wok |
| 1276 | ret false |
| 1277 | end |
| 1278 | wsrc = sj_find wr vksource |
| 1279 | sv_cbox sj_find wsrc vkreadme |
| 1280 | sv_cbox sj_find wsrc vkhow |
| 1281 | sv_cbox sj_find wsrc vkodoc2 |
| 1282 | sv_cbox sj_find wr vkplink |
| 1283 | sv_cbox sj_find wr vkalink |
| 1284 | sv_cbox sj_find wr vkdnb |
| 1285 | sv_chops sj_find wr vkhops |
| 1286 | sv_ccards sj_find wr vksteps |
| 1287 | sv_crows sj_find wr vkpains |
| 1288 | sv_crows sj_find wr vkswaps |
| 1289 | wv = sj_find wsrc vkvis |
| 1290 | if not or sj_eq wv vkpriv sj_eq wv vkpub |
| 1291 | sv_fail vrb4 vtvis |
| 1292 | end |
| 1293 | ret eq get vfail 0 wf |
| 1294 | end |
| 1295 | |
| 1296 | note ---------------------------------------------------------------- research-status.json |
| 1297 | fn sv_texact node ulong t view uchar * to bool |
| 1298 | if ne sj_len node sv_tcount t |
| 1299 | ret false |
| 1300 | end |
| 1301 | wc = sj_first node |
| 1302 | wk = ulong 0 |
| 1303 | while ne wc 0 bound 64 |
| 1304 | if not sv_teq wc t wk |
| 1305 | ret false |
| 1306 | end |
| 1307 | wk = add wk 1 |
| 1308 | wc = sj_next wc |
| 1309 | end |
| 1310 | ret true |
| 1311 | end |
| 1312 | fn sv_rlinks node ulong to void |
| 1313 | wc = sj_first node |
| 1314 | while ne wc 0 bound 65536 |
| 1315 | wl = sj_find wc vklink |
| 1316 | if eq sj_kind wl 3 |
| 1317 | if and gt sj_size wl 0 not sj_prefix wl vkgh |
| 1318 | sv_fail vrb4 vtrlink |
| 1319 | end |
| 1320 | end |
| 1321 | wc = sj_next wc |
| 1322 | end |
| 1323 | end |
| 1324 | fn sv_rladder root ulong to void |
| 1325 | wl = sj_find root vkladder |
| 1326 | wc = sj_first wl |
| 1327 | wk = ulong 0 |
| 1328 | wlev = true |
| 1329 | wrun = true |
| 1330 | wtop = ulong 0 |
| 1331 | wgap = false |
| 1332 | while ne wc 0 bound 64 |
| 1333 | if lt wk sv_tcount vrlev |
| 1334 | if not sv_teq sj_find wc vklevel vrlev wk |
| 1335 | wlev = false |
| 1336 | end |
| 1337 | end |
| 1338 | wst = sj_find wc vkstate |
| 1339 | if not sv_tin wst vrlad |
| 1340 | sv_fail vrb4 vtlstate |
| 1341 | end |
| 1342 | if sj_eq wst vkach |
| 1343 | if wrun |
| 1344 | wtop = sj_find wc vklevel |
| 1345 | end |
| 1346 | if wgap |
| 1347 | sv_fail vrb4 vtgap |
| 1348 | end |
| 1349 | else |
| 1350 | wrun = false |
| 1351 | wgap = true |
| 1352 | end |
| 1353 | wk = add wk 1 |
| 1354 | wc = sj_next wc |
| 1355 | end |
| 1356 | if or not wlev ne wk sv_tcount vrlev |
| 1357 | sv_fail vrb4 vtlevels |
| 1358 | end |
| 1359 | wcl = sj_find sj_find root vkcur vklevel |
| 1360 | if eq wtop 0 |
| 1361 | sv_fail vrb4 vtcur |
| 1362 | else |
| 1363 | if not sj_same wtop wcl |
| 1364 | sv_fail vrb4 vtcur |
| 1365 | end |
| 1366 | end |
| 1367 | end |
| 1368 | note sv_rowid: the turing row whose id equals the string node id (0 when none). |
| 1369 | fn sv_rowid root ulong id ulong to ulong |
| 1370 | if ne sj_kind id 3 |
| 1371 | ret 0 |
| 1372 | end |
| 1373 | wc = sj_first sj_find root vktrows |
| 1374 | while ne wc 0 bound 65536 |
| 1375 | if sj_same sj_find wc vkid id |
| 1376 | ret wc |
| 1377 | end |
| 1378 | wc = sj_next wc |
| 1379 | end |
| 1380 | ret 0 |
| 1381 | end |
| 1382 | fn sv_rlevel root ulong id ulong to bool |
| 1383 | wc = sj_first sj_find root vkladder |
| 1384 | while ne wc 0 bound 64 |
| 1385 | if sj_same sj_find wc vklevel id |
| 1386 | ret true |
| 1387 | end |
| 1388 | wc = sj_next wc |
| 1389 | end |
| 1390 | ret false |
| 1391 | end |
| 1392 | note sv_runiq: ids unique and the status (sel 0, turing rows) or class (sel 1, implementation rows) |
| 1393 | note in its fixed set. |
| 1394 | fn sv_runiq node ulong sel ulong to void |
| 1395 | wc = sj_first node |
| 1396 | wi = ulong 0 |
| 1397 | while ne wc 0 bound 4096 |
| 1398 | put vseen wi sj_find wc vkid |
| 1399 | for wj ulong wi |
| 1400 | if sj_same get vseen wj get vseen wi |
| 1401 | sv_fail vrb4 vtdupid |
| 1402 | end |
| 1403 | end |
| 1404 | if eq sel 0 |
| 1405 | if not sv_tin sj_find wc vkstatus vrstat |
| 1406 | sv_fail vrb4 vtrstat |
| 1407 | end |
| 1408 | else |
| 1409 | if not sv_tin sj_find wc vkclass vrcls |
| 1410 | sv_fail vrb4 vtrcls |
| 1411 | end |
| 1412 | end |
| 1413 | wi = add wi 1 |
| 1414 | wc = sj_next wc |
| 1415 | end |
| 1416 | end |
| 1417 | fn sv_rattempts root ulong to void |
| 1418 | wc = sj_first sj_find root vkatt |
| 1419 | while ne wc 0 bound 65536 |
| 1420 | wrow = sv_rowid root sj_find wc vkid |
| 1421 | wok = ne wrow 0 |
| 1422 | if wok |
| 1423 | wok = sj_same sj_find wrow vkstatus sj_find wc vkoutc |
| 1424 | end |
| 1425 | wok = and wok sv_rlevel root sj_find wc vkbeside |
| 1426 | wok = and wok ne sv_rowid root sj_find wc vkledto 0 |
| 1427 | if not wok |
| 1428 | sv_fail vrb4 vtatt |
| 1429 | end |
| 1430 | wc = sj_next wc |
| 1431 | end |
| 1432 | end |
| 1433 | fn sv_vres to bool |
| 1434 | wf = get vfail 0 |
| 1435 | sv_ctxp |
| 1436 | sv_rawdash vrb4 |
| 1437 | wr = sv_jload |
| 1438 | if not sv_shape wr vsrt true |
| 1439 | ret false |
| 1440 | end |
| 1441 | wok = sv_shapeat wr vkscom vsrsc true |
| 1442 | wok = and wok sv_shapeat wr vkirc vsrir true |
| 1443 | wok = and wok sv_each wr vkabbr vsrab true |
| 1444 | wok = and wok sv_shapeat wr vkcur vsrcl true |
| 1445 | wok = and wok sv_each wr vkladder vsrld true |
| 1446 | wok = and wok sv_each wr vkatt vsrat true |
| 1447 | wok = and wok sv_each wr vktrows vsrtr true |
| 1448 | wok = and wok sv_each wr vkirows vsrim true |
| 1449 | if not wok |
| 1450 | ret false |
| 1451 | end |
| 1452 | if not sv_texact sj_find wr vkals vrstat |
| 1453 | sv_failt vrb4 vtallow vkals |
| 1454 | end |
| 1455 | if not sv_texact sj_find wr vkall vrlad |
| 1456 | sv_failt vrb4 vtallow vkall |
| 1457 | end |
| 1458 | if not sv_texact sj_find wr vkalc vrcls |
| 1459 | sv_failt vrb4 vtallow vkalc |
| 1460 | end |
| 1461 | sv_rladder wr |
| 1462 | sv_rlinks sj_find wr vkladder |
| 1463 | sv_rlinks sj_find wr vktrows |
| 1464 | sv_rlinks sj_find wr vkirows |
| 1465 | sv_runiq sj_find wr vktrows 0 |
| 1466 | sv_runiq sj_find wr vkirows 1 |
| 1467 | wc = sj_first sj_find sj_find wr vkirc vklinks |
| 1468 | while ne wc 0 bound 65536 |
| 1469 | sv_rchk wc |
| 1470 | wc = sj_next wc |
| 1471 | end |
| 1472 | sv_rattempts wr |
| 1473 | ret eq get vfail 0 wf |
| 1474 | end |