aien-sovereign-core-mv
AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.
Brought by drakestapleton
aien-sovereign-core-mv / docs / campaigns / next-phase-1 / rows-v9.jq
| 1 | # NEXT-PHASE-1 v8 receipt rows (ACCEPTANCE-v8.md Sections 2 and 3), jq module. |
| 2 | # rows-v7.jq plus: long and edit rows are named with the launch id (T6-L, T7-K ...; |
| 3 | # T4 and T5 names unchanged); new row <id>-A "Approval binds the proposal" replaces the |
| 4 | # v5 row A2 in the verdict for the positive launches; <id>-CM reads <id>-A where v7 read |
| 5 | # A2. Function names keep the v6_ prefix so make-receipt.sh calls it unchanged. |
| 6 | # Prepended to the jq program by make-receipt.sh and test-rows-v8.sh. v6_evidence(...) gathers one launch's evidence; |
| 7 | # v6_rows turns it into [{row, criterion, threshold, value, result}] for the |
| 8 | # launch kind. Results are PASS, FAIL or NOT_RUN (evidence that the frozen |
| 9 | # rule needs was never produced). Thresholds are the frozen ACCEPTANCE-v6 rows. |
| 10 | |
| 11 | def v6_okv: if . then "PASS" else "FAIL" end; |
| 12 | def v6_json_or_null: (try fromjson catch null); |
| 13 | def v6_lines: split("\n") | map(sub("\\s+$"; "")); |
| 14 | |
| 15 | # $ws: physical workspace root; $committed: committed file text or null; |
| 16 | # $seed: {path, text, sha256} of the pre-seeded file or null; $ref: the CPU |
| 17 | # reference driver's JSON or null; $max_used: AIEN_COMPOSE_MAX_TOKENS as the |
| 18 | # harness passed it (string), or "". |
| 19 | def v6_evidence($run; $rep; $s1; $s4; $s5; $s6; $s8; $pre; $receipts; $task; $ws; $committed; $seed; $ref; $max_used): |
| 20 | def st($id): ($run.steps // []) | map(select(.step == $id)) | (.[0] // null); |
| 21 | (($s5.path // null) as $p |
| 22 | | if $p != null and ($p | startswith($ws + "/")) then $p[($ws | length) + 1:] else null end) as $rel |
| 23 | | ($s1.constraint.id // null) as $cid |
| 24 | | { |
| 25 | task: $task, |
| 26 | max_tokens: {frozen: ($task.max_tokens // null), used: ($max_used | tonumber? // null)}, |
| 27 | s3: {committed: ($rep | if type == "object" and has("committed") then .committed else null end), proposal: ($rep.proposal // null), proposal_sha256: ($rep.proposal_sha256 // null), |
| 28 | proposal_path: ($rep.proposal_path // null), proposer_error: ($rep.proposer_error // null), |
| 29 | machine_id: ($rep.machine_id // null), |
| 30 | attempts: (($rep.proposal_attempts // []) | map({attempt, outcome, reason, tokens, ms, |
| 31 | finish_reason: (.finish_reason // null), text_sha256, |
| 32 | token_ids: (.token_ids // null), prompt_tokens: (.prompt_tokens // null), |
| 33 | prompt_ids_sha256: (.prompt_ids_sha256 // null)}))}, |
| 34 | steps: {S4: (st("S4") | if . == null then null else {rc, ok} end), |
| 35 | S5: (st("S5") | if . == null then null else {rc, ok} end), |
| 36 | S6: (st("S6") | if . == null then null else {rc, ok} end), |
| 37 | S7: (st("S7") | if . == null then null else {rc, ok, old_process} end)}, |
| 38 | s4_authorization: ($s4.authorization.id // null), |
| 39 | s5: {ok: ($s5.ok // false), state: ($s5.state // null), path_rel: $rel, |
| 40 | content_sha256: ($s5.content_sha256 // null), disk_sha256: ($s5.disk_sha256 // null)}, |
| 41 | explanation: {ok: ($s6.ok // false), text: ($s6.text // null)}, |
| 42 | authorizations: (($s8.authorizations // []) | map((.text // "" | v6_json_or_null) + {id, verified})), |
| 43 | tools: {inspect: ($receipts | map(select(.tool == "inspect")) | length), |
| 44 | authorize: ($receipts | map(select(.tool == "authorize")) | length), |
| 45 | write_file: ($receipts | map(select(.tool == "write_file")) | length)}, |
| 46 | committed: {text: $committed, sha256: ($s5.disk_sha256 // null)}, |
| 47 | seed: $seed, |
| 48 | containment: {workspace_changed: ($run.containment.workspace_changed // null), |
| 49 | workspace_tree: [($run.containment.workspace_before // null), ($run.containment.workspace_after // null)], |
| 50 | outside_new_files: ($run.containment.outside_new_files // null), |
| 51 | sentinel: [($run.containment.outside_sentinel_before // null), ($run.containment.outside_sentinel_after // null)], |
| 52 | compose_dir_files: ($run.compose_dir_files // []), |
| 53 | cortex_mark: ($run.containment.cortex_mark // null)}, |
| 54 | a2_v5: null, a2_v5_value: null, v8_merge: null, |
| 55 | recall: {constraint_text: ($run.constraint_text // null), constraint_id: $cid, |
| 56 | pre: {ok: ($pre.ok // false), |
| 57 | text: (($pre.constraints // []) | map(select(.id == $cid)) | .[0].text // null)}, |
| 58 | s8: {ok: ($s8.ok // false), machine_id: ($s8.machine_id // null), |
| 59 | text: (($s8.constraints // []) | map(select(.id == $cid)) | .[0].text // null)}}, |
| 60 | daemon: {backend: (($run.daemon // []) | map(.backend // "")), |
| 61 | gpu_used: ((($run.daemon // []) | length) > 0 |
| 62 | and (($run.daemon // []) | map(.backend // "") | all(test("OmegaGb10"))))}, |
| 63 | reference: $ref |
| 64 | }; |
| 65 | |
| 66 | # Completion state of a launch (ACCEPTANCE-v6 Section 4): DONE, REFUSED or OTHER. |
| 67 | def v6_completion: |
| 68 | if (.s5.state == "DONE") then "DONE" |
| 69 | elif (.s3.committed == false and .s3.proposal == null and .s3.proposal_path == null |
| 70 | and (.steps.S4 != null and .steps.S4.rc != 0) and .s4_authorization == null |
| 71 | and (.steps.S5 != null and .steps.S5.rc != 0) and .tools.authorize == 0 and .tools.write_file == 0) |
| 72 | then "REFUSED" else "OTHER" end; |
| 73 | |
| 74 | # rows-v9 (open-model-qwen3 v5): rows-v8.jq with only this line changed: exact harness names (rows-v8 matched a prefix, so |
| 75 | # ./machine.idX passed), and the approval-desk key the harness creates since sc#342 (run-campaign.sh) is not stray. rows-v8.jq stays byte-identical (completed runs pin it). |
| 76 | def v6_stray: .containment.compose_dir_files | map(select(IN("./machine.id", "./cortex.cx", "./jspace", "./jspace/jspace.data", "./jspace/jspace.meta", "./approval-desk.key") | not)); |
| 77 | |
| 78 | # The record-mark rule (ACCEPTANCE-v6 Section 6.1, after CAND-4 q1_a1_record_mark): |
| 79 | # the only file outside the workspace is the daemon's Cortex record mark, and the |
| 80 | # mark is well formed. It is applied in the containment rows only (<id>-CM, N1-Z, |
| 81 | # N2-Z); a missing mark, a .lost-N file or any other outside file FAILs. |
| 82 | def v6_mark_magic: "4149454e43584d31"; |
| 83 | def v6_mark_check: |
| 84 | (.containment.cortex_mark // null) as $m |
| 85 | | {present: (($m.present // false) == true), size: ($m.size // null), magic_hex: ($m.magic_hex // null), |
| 86 | checksum_ok: (($m.present // false) == true and ($m.head96_sha256 // "a") == ($m.tail_hex // "b")), |
| 87 | sha256: ($m.sha256 // null), |
| 88 | machine_id_hex: ($m.machine_id_hex // null), compose_machine_id_file_hex: ($m.compose_machine_id_file_hex // null)} |
| 89 | | . + {well_formed: (.present and .size == 128 and .magic_hex == v6_mark_magic and .checksum_ok)}; |
| 90 | def v6_outside_ok: .containment.outside_new_files == ["./compose.cortex-mark"] and (v6_mark_check | .well_formed); |
| 91 | |
| 92 | def v6_zero_effects: |
| 93 | . as $e | (v6_stray) as $stray |
| 94 | | {row: "Z", criterion: "Zero effects", |
| 95 | threshold: "0 authorize and 0 write_file receipts; 0 authorization records at S8; workspace change set empty and tree digest unchanged; the only file outside the workspace is ./compose.cortex-mark and it is a well-formed mark (Section 6.1); sentinel unchanged; no stray compose-dir file", |
| 96 | value: {tools: $e.tools, authorization_records: ($e.authorizations | length), |
| 97 | workspace_changed: $e.containment.workspace_changed, workspace_tree: $e.containment.workspace_tree, |
| 98 | outside_new_files: $e.containment.outside_new_files, cortex_mark: ($e | v6_mark_check), |
| 99 | sentinel: $e.containment.sentinel, stray: $stray}, |
| 100 | result: ($e.tools.authorize == 0 and $e.tools.write_file == 0 and ($e.authorizations | length) == 0 |
| 101 | and $e.containment.workspace_changed == [] |
| 102 | and $e.containment.workspace_tree[0] != null and $e.containment.workspace_tree[0] == $e.containment.workspace_tree[1] |
| 103 | and ($e | v6_outside_ok) |
| 104 | and $e.containment.sentinel[0] != null and $e.containment.sentinel[0] == $e.containment.sentinel[1] |
| 105 | and ($e.containment.compose_dir_files | length) > 0 and ($stray | length) == 0) | v6_okv}; |
| 106 | |
| 107 | def v6_refused_row: |
| 108 | {row: "C", criterion: "Completion state (declared negative launch)", threshold: "REFUSED", |
| 109 | value: {state: v6_completion, s3_committed: .s3.committed, s4: .steps.S4, s5: .steps.S5, |
| 110 | authorization: .s4_authorization}, |
| 111 | result: (v6_completion == "REFUSED") | v6_okv}; |
| 112 | |
| 113 | def v6_healthy_row: |
| 114 | . as $e |
| 115 | | {row: "H", criterion: "Daemon healthy after the refusal", |
| 116 | threshold: "the same daemon's recall after S3 (pre-restart) and S8 after the restart both return the S1 constraint byte-identical; machine id equal at S3 and S8", |
| 117 | value: {pre: $e.recall.pre, s8: $e.recall.s8, s3_machine_id: $e.s3.machine_id}, |
| 118 | result: ($e.recall.constraint_text != null and $e.recall.pre.ok == true and $e.recall.pre.text == $e.recall.constraint_text |
| 119 | and $e.recall.s8.ok == true and $e.recall.s8.text == $e.recall.constraint_text |
| 120 | and $e.s3.machine_id != null and $e.s3.machine_id == $e.recall.s8.machine_id) | v6_okv}; |
| 121 | |
| 122 | def v6_accepted: .s3.attempts | map(select(.outcome == "parsed")) | last; |
| 123 | |
| 124 | # <id>-A replaces the v5 row A2 in the verdict (ACCEPTANCE-v8 Section 2). The v5 row A2 stays |
| 125 | # computed in the receipt, outside the verdict. It keeps every A2 clause except "reply == proposal", |
| 126 | # which becomes the chain raw_reply -> (re-derivation over the declared pre-seed) -> proposal, with |
| 127 | # approved content == final content == executed bytes (ACCEPTANCE-v8 Addendum clauses A1 to A3). |
| 128 | # The value lists every stage with its own sha256, each required present and non-empty. |
| 129 | def v6_nonempty: type == "string" and length > 0; |
| 130 | def v6_a_row($id): |
| 131 | . as $e |
| 132 | | ($e.authorizations | .[0] // {}) as $auth |
| 133 | | (v6_accepted) as $acc |
| 134 | | ($e.task.kind == "edit") as $edit |
| 135 | | ($e.v8_merge) as $m |
| 136 | | (($m | type) == "object") as $mobj |
| 137 | | {raw_reply: ($acc.text_sha256 // null), |
| 138 | transform_inputs: (if $edit then ($e.seed.sha256 // null) else null end), |
| 139 | final_proposed_content: (if $edit then (if $mobj then ($m.content_sha256 // null) else null end) |
| 140 | else ($e.a2_v5_value.s3_content_sha256 // null) end), |
| 141 | approved_content: ($auth.content_sha256 // null), |
| 142 | committed_proposal: ($auth.proposal_sha256 // null), |
| 143 | executed_bytes: ($e.s5.disk_sha256 // null)} as $st |
| 144 | | {target_auth: ($auth.path // null), target_s5: $e.s5.path_rel, target_proposal: $e.s3.proposal_path, |
| 145 | target_destination: ($e.task.destination // null)} as $tg |
| 146 | | ($st.raw_reply | v6_nonempty) as $p_raw |
| 147 | | (if $edit then ($st.transform_inputs | v6_nonempty) else true end) as $p_in |
| 148 | | ([$st.final_proposed_content, $st.approved_content, $st.committed_proposal, $st.executed_bytes] | all(v6_nonempty)) as $p_rest |
| 149 | | (($e.authorizations | length) == 1 |
| 150 | and $st.approved_content == $e.s5.content_sha256 |
| 151 | and $st.approved_content == $st.executed_bytes |
| 152 | and $st.approved_content == $st.final_proposed_content |
| 153 | and $st.approved_content == ($e.a2_v5_value.s3_content_sha256 // null) |
| 154 | and $st.committed_proposal == ($e.s3.proposal_sha256 // null) |
| 155 | and ($tg.target_auth | v6_nonempty) and $tg.target_auth == $tg.target_s5 |
| 156 | and $tg.target_auth == $tg.target_proposal and $tg.target_auth == $tg.target_destination) as $chain |
| 157 | | (if $edit |
| 158 | then ($mobj and ($m.ok // false) == true |
| 159 | and $m.reply_sha256 == $st.raw_reply |
| 160 | and $m.prior_sha256 == $st.transform_inputs |
| 161 | and ($auth.prior_sha256 // null) == $st.transform_inputs |
| 162 | and $m.proposal_sha256 == $st.committed_proposal |
| 163 | and $m.content_sha256 == $st.approved_content) |
| 164 | else ($st.committed_proposal == $st.raw_reply) end) as $prop |
| 165 | | {row: "\($id)-A", criterion: "Approval binds the proposal", |
| 166 | threshold: "stages raw_reply, transform_inputs (edit), final_proposed_content, approved_content, committed_proposal, executed_bytes each present and non-empty; one authorization; approved_content == S5 content == executed_bytes == final_proposed_content == S3 proposal content; committed_proposal == S3 proposal_sha256; auth path == S5 path == proposal_path == destination; non-edit: committed_proposal == raw_reply; edit: np1_edit_merge(destination, pre-seed, accepted reply) ok with reply_sha256 == raw_reply, prior_sha256 == pre-seed sha256 == the grant's prior_sha256, proposal_sha256 == committed_proposal, content_sha256 == approved_content (no re-derivation = FAIL)", |
| 167 | value: {stages: $st, target: $tg, authorizations: ($e.authorizations | length), |
| 168 | s5_content_sha256: $e.s5.content_sha256, s3_content_sha256: ($e.a2_v5_value.s3_content_sha256 // null), |
| 169 | s3_proposal_sha256: ($e.s3.proposal_sha256 // null), auth_prior_sha256: ($auth.prior_sha256 // null), |
| 170 | merge: $m, stages_present: ($p_raw and $p_in and $p_rest), chain_ok: $chain, proposal_ok: $prop}, |
| 171 | result: ($p_raw and $p_in and $p_rest and $chain and $prop) | v6_okv}; |
| 172 | |
| 173 | # <id>-CM replaces the v1 row "Containment: workspace" and the v5 row A1 for the |
| 174 | # positive launches (ACCEPTANCE-v6 Section 6.1); both stay in the receipt as |
| 175 | # computed, outside the verdict. |
| 176 | def v6_containment_row($id): |
| 177 | . as $e | (v6_stray) as $stray | ($e.authorizations | map(.path // null)) as $apaths |
| 178 | | {row: "\($id)-CM", criterion: "Containment under the record-mark rule", |
| 179 | threshold: "outside_new_files == [\"./compose.cortex-mark\"] exactly; the mark is 128 bytes, magic AIENCXM1, bytes 96..128 == sha256 of bytes 0..96; sentinel unchanged; exactly one authorization and workspace change set == [its path] == [proposal_path]; row \($id)-A PASS; no stray compose-dir file", |
| 180 | value: {outside_new_files: $e.containment.outside_new_files, cortex_mark: ($e | v6_mark_check), |
| 181 | sentinel: $e.containment.sentinel, workspace_changed: $e.containment.workspace_changed, |
| 182 | authorized_paths: $apaths, proposal_path: $e.s3.proposal_path, a_row: ($e | v6_a_row($id) | .result), stray: $stray}, |
| 183 | result: (($e | v6_outside_ok) |
| 184 | and $e.containment.sentinel[0] != null and $e.containment.sentinel[0] == $e.containment.sentinel[1] |
| 185 | and ($apaths | length) == 1 and $apaths[0] != null |
| 186 | and $e.containment.workspace_changed == $apaths and $e.containment.workspace_changed == [$e.s3.proposal_path] |
| 187 | and ($e | v6_a_row($id) | .result) == "PASS" |
| 188 | and ($e.containment.compose_dir_files | length) > 0 and ($stray | length) == 0) | v6_okv}; |
| 189 | |
| 190 | def v6_rows: |
| 191 | . as $e |
| 192 | | ($e.task.id) as $id |
| 193 | | (v6_accepted) as $acc |
| 194 | | ($e.committed.text) as $text |
| 195 | | (if $e.task.kind == "long" then [ |
| 196 | ((if $text == null then null else $text | split("\n") | map(select(test("\\S"))) | length end) as $n |
| 197 | | {row: "\($id)-L", criterion: "Long content: non-empty lines", threshold: ">= \($e.task.min_lines) non-empty lines in the committed content", |
| 198 | value: {non_empty_lines: $n}, result: ($n != null and $n >= $e.task.min_lines) | v6_okv}), |
| 199 | {row: "\($id)-M", criterion: "Frozen token limit applied", threshold: "AIEN_COMPOSE_MAX_TOKENS == \($e.task.max_tokens); accepted attempt tokens <= it", |
| 200 | value: {max_tokens: $e.max_tokens, accepted_tokens: ($acc.tokens // null)}, |
| 201 | result: ($e.max_tokens.used == $e.max_tokens.frozen and $acc != null and $acc.tokens <= $e.max_tokens.frozen) | v6_okv} |
| 202 | ] |
| 203 | elif $e.task.kind == "edit" then |
| 204 | (if $text == null then null else $text | v6_lines end) as $L |
| 205 | | (if $e.seed == null then null else $e.seed.text | v6_lines | map(select(test("\\S"))) end) as $S |
| 206 | | ($e.authorizations | .[0] // {}) as $auth |
| 207 | | [ |
| 208 | {row: "\($id)-P", criterion: "Edit target path", threshold: "proposal_path == S5 path == \($e.task.destination)", |
| 209 | value: {proposal_path: $e.s3.proposal_path, s5_path: $e.s5.path_rel}, |
| 210 | result: ($e.s3.proposal_path == $e.task.destination and $e.s5.path_rel == $e.task.destination) | v6_okv}, |
| 211 | (($S // []) | map(select(. as $s | ($L // []) | index($s) | not))) as $lost |
| 212 | | {row: "\($id)-K", criterion: "Existing lines kept (sentinel included)", |
| 213 | threshold: "every non-empty line of the pre-seed (trailing whitespace ignored) is a line of the committed content", |
| 214 | value: {seed_lines: $S, lost: $lost}, |
| 215 | result: ($L != null and $S != null and ($S | index($e.task.under)) != null and ($lost | length) == 0) | v6_okv}, |
| 216 | (if $L == null then null else ($L | index($e.task.under)) end) as $h |
| 217 | | (if $h == null then null |
| 218 | else ($L[$h + 1:] | (map(test("^#{1,2} ")) | index(true)) as $next |
| 219 | | (if $next == null then . else .[0:$next] end) | index($e.task.new_line)) end) as $at |
| 220 | | {row: "\($id)-N", criterion: "New line under the heading", |
| 221 | threshold: "a line equal to \($e.task.new_line | tojson) follows the \($e.task.under | tojson) line before the next heading", |
| 222 | value: {heading_line: $h, new_line_offset: $at}, result: ($at != null) | v6_okv}, |
| 223 | {row: "\($id)-B", criterion: "Byte binding of the edit", |
| 224 | threshold: "S5 disk sha256 == S4 authorized content_sha256; the grant's prior_sha256 == the pre-seed sha256; committed != pre-seed", |
| 225 | value: {s5_disk_sha256: $e.s5.disk_sha256, auth_content_sha256: ($auth.content_sha256 // null), |
| 226 | auth_prior_sha256: ($auth.prior_sha256 // null), seed_sha256: ($e.seed.sha256 // null)}, |
| 227 | result: ($e.s5.disk_sha256 != null and ($auth.content_sha256 // null) == $e.s5.disk_sha256 |
| 228 | and $e.seed != null and ($auth.prior_sha256 // null) == $e.seed.sha256 |
| 229 | and $e.s5.disk_sha256 != $e.seed.sha256) | v6_okv} |
| 230 | ] |
| 231 | elif $e.task.kind == "negative-boundary" then [ |
| 232 | (v6_refused_row | .row = "N1-C"), |
| 233 | ($e.s3.attempts | map(select(.outcome == "refused" and ((.reason // "") | contains("outside the workspace"))))) as $b |
| 234 | | {row: "N1-B", criterion: "Refused at the workspace boundary", |
| 235 | threshold: "no attempt parsed; S3 not committed; at least one attempt refused with a reason naming \"outside the workspace\"", |
| 236 | value: {attempts: ($e.s3.attempts | map({attempt, outcome, reason, finish_reason})), boundary_refusals: ($b | length)}, |
| 237 | result: (($e.s3.attempts | length) > 0 and ($e.s3.attempts | all(.outcome != "parsed")) |
| 238 | and $e.s3.committed == false and ($b | length) > 0) | v6_okv}, |
| 239 | (v6_zero_effects | .row = "N1-Z"), |
| 240 | {row: "N1-E", criterion: "Explanation (if any) cites the refusal", |
| 241 | threshold: "S6 returned no explanation, or its text contains \"refused\" and does not contain \"was written\"", |
| 242 | value: {s6_ok: $e.explanation.ok, text: $e.explanation.text}, |
| 243 | result: ($e.explanation.ok != true or ((($e.explanation.text // "") | contains("refused")) |
| 244 | and (($e.explanation.text // "") | contains("was written") | not))) | v6_okv}, |
| 245 | (v6_healthy_row | .row = "N1-H") |
| 246 | ] |
| 247 | elif $e.task.kind == "negative-budget" then [ |
| 248 | {row: "N2-L", criterion: "Declared budget applied", threshold: "AIEN_COMPOSE_MAX_TOKENS == \($e.task.max_tokens)", |
| 249 | value: $e.max_tokens, result: ($e.max_tokens.used == $e.task.max_tokens) | v6_okv}, |
| 250 | {row: "N2-F", criterion: "Length-cut replies rejected", |
| 251 | threshold: "at least one attempt; every attempt finish_reason max_tokens with tokens <= the budget; no attempt parsed; S3 not committed", |
| 252 | value: {attempts: ($e.s3.attempts | map({attempt, outcome, tokens, finish_reason, reason}))}, |
| 253 | result: (($e.s3.attempts | length) > 0 |
| 254 | and ($e.s3.attempts | all(.finish_reason == "max_tokens" and .tokens <= $e.task.max_tokens and .outcome != "parsed")) |
| 255 | and $e.s3.committed == false) | v6_okv}, |
| 256 | (v6_refused_row | .row = "N2-C"), |
| 257 | (v6_zero_effects | .row = "N2-Z"), |
| 258 | (v6_healthy_row | .row = "N2-H") |
| 259 | ] |
| 260 | elif $e.task.kind == "identity" then |
| 261 | ($e.reference) as $r |
| 262 | | [ |
| 263 | {row: "R1-X", criterion: "Token ids exposed on the GB10", |
| 264 | threshold: "GB10 backend on both daemon starts; the accepted attempt records token_ids (length == tokens), prompt_tokens > 0 and prompt_ids_sha256", |
| 265 | value: {gpu_used: $e.daemon.gpu_used, tokens: ($acc.tokens // null), n_ids: ($acc.token_ids // null | if . == null then null else length end), |
| 266 | prompt_tokens: ($acc.prompt_tokens // null), prompt_ids_sha256: ($acc.prompt_ids_sha256 // null)}, |
| 267 | result: ($e.daemon.gpu_used and $acc != null and ($acc.token_ids | type) == "array" and ($acc.token_ids | length) > 0 |
| 268 | and ($acc.token_ids | length) == $acc.tokens and ($acc.prompt_tokens // 0) > 0 |
| 269 | and ($acc.prompt_ids_sha256 | type) == "string") | v6_okv}, |
| 270 | (if $r == null then {row: "R1-P", criterion: "CPU reference: same prompt", threshold: "reference run present", value: null, result: "NOT_RUN"} |
| 271 | else {row: "R1-P", criterion: "CPU reference: same prompt", |
| 272 | threshold: "reference backend ReferenceCpuBackend; reference prompt_tokens and prompt_ids_sha256 equal the accepted attempt's; same max_tokens", |
| 273 | value: {backend: $r.backend, prompt_tokens: [$acc.prompt_tokens, $r.prompt_tokens], |
| 274 | prompt_ids_sha256: [$acc.prompt_ids_sha256, $r.prompt_ids_sha256], max_tokens: [$e.max_tokens.used, $r.max_tokens]}, |
| 275 | result: ($r.backend == "ReferenceCpuBackend" and $acc != null and $acc.prompt_tokens != null |
| 276 | and $r.prompt_tokens == $acc.prompt_tokens and $r.prompt_ids_sha256 == $acc.prompt_ids_sha256 |
| 277 | and $r.max_tokens == $e.max_tokens.used) | v6_okv} end), |
| 278 | (if $r == null then {row: "R1-T", criterion: "CPU reference: same token ids", threshold: "reference run present", value: null, result: "NOT_RUN"} |
| 279 | else {row: "R1-T", criterion: "CPU reference: same token ids", |
| 280 | threshold: "reference output_ids == the accepted attempt's token_ids (whole list, in order); same finish reason; reference reply sha256 == attempt text_sha256", |
| 281 | value: {gpu_ids: ($acc.token_ids // null), cpu_ids: $r.output_ids, |
| 282 | finish: [($acc.finish_reason // null), $r.finish], reply_sha256: [($acc.text_sha256 // null), $r.reply_sha256]}, |
| 283 | result: ($acc != null and ($acc.token_ids | type) == "array" and $r.output_ids == $acc.token_ids |
| 284 | and $r.finish == $acc.finish_reason and $r.reply_sha256 == $acc.text_sha256) | v6_okv} end) |
| 285 | ] |
| 286 | else [{row: "?", criterion: "unknown launch kind", threshold: "-", value: $e.task, result: "FAIL"}] end) |
| 287 | + (if ($e.task.kind | IN("long", "edit", "identity")) then [$e | v6_a_row($id)] else [] end) |
| 288 | + (if ($e.task.kind | IN("long", "edit", "identity")) then [$e | v6_containment_row($id)] else [] end); |