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 / docs / one_layer / GEN_PROTOCOL_V1.md
| 1 | # GEN: compositional generalization from verified abstractions, pre-registered protocol (v1) |
| 2 | |
| 3 | Issue: aien-spark/omega#476 (GEN-1), program aien-spark/omega#475. This file is committed BEFORE any GEN |
| 4 | generation and before the custodian authors any held-out task. Every setting below is frozen by its |
| 5 | commit; the machine-checked copy is `tests/one_layer/generalization/protocol.json`, validated by |
| 6 | `tools/gen/protocol/gencheck` (`make test-gen-protocol`). A change follows section 15. GEN is a separate |
| 7 | experiment from EXP445 (`docs/one_layer/EXP445_PROTOCOL.md`): it reuses EXP445's tools by calling them, |
| 8 | never edits EXP445's protocol, PARAMS, seals or data, and never opens EXP445's sealed tasks. |
| 9 | |
| 10 | ## 1. Question |
| 11 | |
| 12 | Does retrieving **checker-verified reusable abstractions** (helper functions extracted from earlier |
| 13 | verified solutions) help a model write correct Omegese programs for **unfamiliar combinations of known |
| 14 | primitives**, compared with one example, a fixed set of many examples, and retrieval of earlier raw |
| 15 | solutions under the same budget? |
| 16 | |
| 17 | A positive answer is claimed only when the abstraction condition beats every control, including raw |
| 18 | retrieval, on held-out task families that no example, dev task or retrieved record shares (section 9). |
| 19 | FAIL and INCONCLUSIVE are legitimate outcomes and are reported as such. |
| 20 | |
| 21 | ## 2. Tasks and splits |
| 22 | |
| 23 | Three splits, each made of composition **families** defined by the family contract |
| 24 | `tests/one_layer/generalization/families/FAMSIG_V1.md` (frozen first; tool `tools/gen/protocol/famsig`). |
| 25 | A family is the primitive multiset plus nesting shape the task SPECIFICATION asks for, over the |
| 26 | primitives `arith branch loop array call nested`; it is declared from the prompt, never from a solution. |
| 27 | Renaming identifiers or changing constants never makes a new family. |
| 28 | |
| 29 | | split | count | author | visibility | role | |
| 30 | |---|---|---|---|---| |
| 31 | | dev | 10: `devgen01`..`devgen10` | protocol author (GEN-1) | public: `tests/one_layer/generalization/dev/` | prompt and tool development, gates, negative controls; never evidence | |
| 32 | | corpus (exemplars) | about 48 | abstraction builder (GEN-3) | public: `tests/one_layer/generalization/corpus/` | the B prefix (section 3) and the only source of retrieved records | |
| 33 | | held-out | 60, in at least 6 families | custodian (Unix user `gencust`), who builds no corpus or tool | sealed | the only evidence | |
| 34 | |
| 35 | - Disjointness (FAMSIG_V1 section 4, checked mechanically by `famsig rule`): corpus, dev and held-out |
| 36 | families are pairwise disjoint by signature (R3); every primitive a held-out task uses is used by some |
| 37 | corpus task (R4); every held-out family combines at least two distinct primitives (R5); coarse |
| 38 | signatures (duplicate siblings collapsed, `nested` read as `arith`, a top-level `seq` wrapper around one |
| 39 | container plus leaves dropped) are pairwise disjoint across the three splits (R6); every held-out family |
| 40 | has at least one coarse composition edge that no corpus shape has, `novel_edges >= 1` (R7); no top-level |
| 41 | step of a dev or held-out shape (after `seq` flattening) is a container whose coarse form equals a corpus |
| 42 | coarse signature (R8). |
| 43 | - Held-out family metadata lives only in the sealed `SPLIT` file (FAMSIG_V1 section 6), never inside |
| 44 | `tasks.tar`. Before any held-out generation the custodian publishes `HELDOUT.pub` (FAMSIG_V1 section 7): |
| 45 | task ids, the salted family-list digest, the split digest, counts. The independent reviewer verifies |
| 46 | SPLIT against HELDOUT.pub and R1..R8 after the seal (`gencheck split`) and audits semantic overlap with |
| 47 | the corpus using `famsig rule --show-heldout` (`novel_edges` per family). The reviewer who runs any |
| 48 | `--show-heldout` or `--show` command is never a corpus, record or tool builder. |
| 49 | - **Blind re-declaration (before the seal is opened):** the reviewer reads every held-out prompt and |
| 50 | requirement read-only, as `gencust`, without seeing SPLIT, and declares each task's metadata line in |
| 51 | its own `gen-split 1` file (own salt). `famsig compare SPLIT REDECLARED` (as `gencust`; prints only |
| 52 | `tasks=<n> mismatches=<k>`) must give `mismatches=0`. Any mismatch forces the custodian to fix the |
| 53 | declaration or the task and re-seal (new SPLIT, HELDOUT.pub and pack digests, R1..R8 again) before the |
| 54 | seal is opened. The compare line is published with the run meta. |
| 55 | - **Near-duplicate check (before the seal is opened):** `tools/gen/protocol/genjac scan` (as `gencust`) |
| 56 | of every held-out prompt against every corpus prompt and every corpus reference solution: word |
| 57 | 3-gram Jaccard (genret tokenization: lowercase `[a-z0-9]+` words, set of consecutive word triples); |
| 58 | the number of held-out prompts with any Jaccard strictly above 0.5 (`above=`) must be 0, compared |
| 59 | exactly. Only the summary line (`heldout= corpus= threshold= max_jaccard= above=`) is published. A |
| 60 | non-zero count forces a rewrite and re-seal as above. |
| 61 | - Task layout: exactly `tests/one_layer/acceptance/HARNESS_INTERFACE_V2.md` section 3 (requirement, |
| 62 | prompt, `hidden/inputs`, `hidden/expected`, `hidden/reference.osc`), reused unchanged. The prompt |
| 63 | states every trap kind (HARNESS_INTERFACE_V2 section 3), so a held-out trap line is `TRAP <code>` with |
| 64 | that code whenever the code is unambiguous (a bare `TRAP` accepts any code). Held-out ids |
| 65 | must not start with `dev`, must not reveal family or difficulty. Expected values are computed |
| 66 | independently of the reference (an oracle written from the prompt, as |
| 67 | `tests/one_layer/generalization/dev/gen_expected.c`), and every reference must be ACCEPTed by |
| 68 | `ola.sh tasks-check` (RUN VALID) before the seal is published. The custodian publishes in the run meta |
| 69 | `oracle_match=<k>/60` (tasks whose `hidden/expected` equals the oracle's output byte for byte; must be |
| 70 | 60/60) and the sha256 of the oracle source file. |
| 71 | - Every held-out `hidden/reference.osc` carries one comment line `// canary <32 lowercase hex>` with a |
| 72 | fresh random value per task, used by the source-leak probe (section 8). |
| 73 | - Dev fixtures: packed and sealed by `tests/one_layer/generalization/dev/pack_dev.sh`; `ola.sh tasks-check` |
| 74 | on that pack gives references_accepted=10/10, RUN VALID (dev pack sha256 in protocol.json). |
| 75 | - Entry names: no corpus task may share an entry name with a held-out task; checked by the custodian |
| 76 | against the public view, printing only the count (as EXP445 13.2). |
| 77 | |
| 78 | ## 3. Conditions |
| 79 | |
| 80 | Every condition writes Omegese (`docs/one_layer/OMEGESE.md`); the reader is the EXP445 omegese chain |
| 81 | (`tools/exp445/reader.sh`: `omegese emit`, `omega_emit emit`, `x445 check`); harness kind `oscir`. |
| 82 | Decode-time masking is OFF in every condition (the mask is not qualified); a masked sub-experiment needs |
| 83 | its own revision and is never pooled with these results. |
| 84 | |
| 85 | | condition | system message = prefix ++ suffix | |
| 86 | |---|---| |
| 87 | | A (1-shot) | prefix: `arms/common.md` + `arms/omegese.md` + 1 fixed example; suffix empty | |
| 88 | | B (many-shot) | prefix: the same two documents + 14 fixed corpus examples; suffix empty | |
| 89 | | C (B + raw retrieval) | B's prefix byte for byte + suffix: top-k verified raw corpus solutions | |
| 90 | | D (B + abstraction retrieval) | B's prefix byte for byte + suffix: top-k verified abstraction records | |
| 91 | |
| 92 | - **B prefix pick (deterministic, diverse):** order the corpus tasks by family signature (byte order), |
| 93 | then task id; walk the families round robin in signature order, taking each family's lowest unused |
| 94 | task id, until 14 tasks are taken. Every task line of corpus META is eligible, GEN-3 transfer-probe tasks |
| 95 | included (probes are withheld from both retrieval pools, see Candidate pool below). A's single example is the first task |
| 96 | taken. The 14 ids (`record_sets.prefix_ids`, in pick order) and `record_sets.prefix_sha256` = sha256 of |
| 97 | `tests/one_layer/generalization/records/PREFIX` (those ids, one per line) are pinned in protocol.json when |
| 98 | the corpus is frozen. If the prefix reuses EXP445 |
| 99 | examples, they are corpus tasks with corpus META lines and must pass `famsig rule`. |
| 100 | - **Retrieval (C and D):** the file-backed provider `genret` (`tools/gen/retrieval/CONTRACT.md`, |
| 101 | contract `genret-cli-v3`, pinned in protocol.json `interfaces` at commit `4a48b613` with CONTRACT.md |
| 102 | sha256 `48006271d18394c40daf96120eaa20fbe3908d9a12b08cab7994ee02a6351e9d`; it validates every record |
| 103 | with the GEN-3 `recheck`), the same `--k`, `--cap-bytes`, mode `normal` and lexical ranker for C and D; |
| 104 | only `--kind raw` (C) versus `--kind abstraction` (D) and the record manifest differ. k = 3, |
| 105 | cap_bytes = 4096. **Query** = the task's public `requirement` and `prompt` files passed as |
| 106 | `--requirement` and `--prompt`: genret's query text is the `entry`, `params` and `ret` values plus the |
| 107 | whole prompt, the same bytes `tools/exp445/reader.sh` `user_msg` shows the model (CONTRACT.md section |
| 108 | 3). Retrieved text appears only in the suffix, after the shared prefix. A and B never call the provider. |
| 109 | - **Candidate pool:** C's raw-record manifest is the probe-free set: the verified corpus solutions EXCEPT every |
| 110 | GEN-3 transfer-probe task (`split=probe` in the GEN-3 manifest) and EXCEPT the 14 prefix tasks (already in |
| 111 | every B, C, D prompt; retrieving them would waste C's budget): 23 records. D's manifest holds the probe-free |
| 112 | abstraction records produced by the deterministic GEN-3 tool from the corpus solutions, EXCEPT every |
| 113 | abstraction whose ancestry lies entirely within the 14 prefix tasks (the same rule as C: nothing the |
| 114 | prefix already shows). Both are filtered views of the GEN-3 `records/MANIFEST`, written in the genret |
| 115 | manifest format inside `records/`. Their paths (`record_sets.raw_manifest`, |
| 116 | `record_sets.abstraction_manifest`) and sha256 (`record_sets.raw_manifest_sha256`, |
| 117 | `record_sets.abstraction_manifest_sha256`) are frozen in protocol.json and re-hashed by `gencheck` |
| 118 | BEFORE the seal is opened for the run; no record is added, removed or edited afterwards. Every genret |
| 119 | receipt's `manifest_sha256` must equal the frozen digest of its condition. |
| 120 | - **Shared record skeleton:** C and D records follow one schema (GEN-3 |
| 121 | `tools/gen/abstract/RECORD_SCHEMA.md`, `gen-record 1`). An abstraction record is a callable Omegese |
| 122 | helper with a one-line pre/post, one example call, a test receipt, ancestry of at least 2 distinct |
| 123 | corpus solutions, and an IR fingerprint different from every corpus solution. No pattern templates. |
| 124 | - **What the model sees (rendering, genret-cli-v3, approved here):** the C and D renderings are |
| 125 | byte-identical except for record content. Both start with the one neutral heading, the same 66 bytes |
| 126 | for C and D: `"\nVerified reference code from earlier tasks, most relevant first.\n"` (approved |
| 127 | verbatim). Then per record `Record <i>.`, the `entry`, `params` and `ret` lines (the signature), the |
| 128 | one-line description, and the body in a fenced block. Only those record fields differ between C and D |
| 129 | (a whole raw solution versus a factored helper `fn`). The omission of D's pre/post, example call, test |
| 130 | receipt, ancestry and fingerprint from the prompt is approved: they are validated by `recheck` and |
| 131 | logged in the retrieval output, never shown. A heading or any other framing text that names the record |
| 132 | kind is a confound and is not allowed (genret-cli-v2 used kind-specific headings and is not used). |
| 133 | - **Selection cap report:** per task and condition the number of records genret selected (`selected`) |
| 134 | is logged; the dev and held-out reports give, for C and D separately, how many tasks got fewer than k |
| 135 | = 3 records (cap or pool exhausted), so a lift cannot hide behind D simply receiving fewer, shorter |
| 136 | records. |
| 137 | - Realised prompt tokens and suffix bytes are logged per condition and task (run row, GEN-2 FORMATS.md). |
| 138 | |
| 139 | ## 4. Model and configuration |
| 140 | |
| 141 | - Config A only: the model, endpoint, request extra, server pin and weight list of EXP445 config A, read |
| 142 | from `tools/exp445/PARAMS` (sha256 pinned in protocol.json): Qwen3-30B-A3B-Instruct-2507 FP8 on Omega's |
| 143 | own `aien-serve-http` (`--engine omega`, :18091). Read-only inference; no weights change. Config B and |
| 144 | OWN-8B need a later revision. |
| 145 | - The GPU run happens after EXP445 Stage 1 attempt 1, under the quiet flag and GPU lock, never |
| 146 | concurrently with any other use of :18091. |
| 147 | - No paid model, new hardware or external service. |
| 148 | |
| 149 | ## 5. Generation procedure |
| 150 | |
| 151 | 1. Requests: `messages = [{system: prefix ++ suffix}, {user: reader.sh user_msg(requirement, prompt)}]`, |
| 152 | one POST to `<base_url>/chat/completions`, `stream: false`, the configuration's request extra merged. |
| 153 | `base_url` is PARAMS `config.A.base_url` and already ends in `/v1` (`http://127.0.0.1:18091/v1`); |
| 154 | `sampling-gate.sh` takes the base WITHOUT `/v1` (it posts to `<base>/v1/chat/completions`), so the |
| 155 | gate is called with `config.A.base_url` minus its trailing `/v1`. Both reach the same endpoint. |
| 156 | 2. **One request in flight:** gates and run send exactly one request at a time to the server (no |
| 157 | concurrency, no batching across tasks or conditions); the next request starts only after the previous |
| 158 | one has returned or failed. |
| 159 | 3. **Budget:** `max_tokens = 3072` per round in every condition, task and attempt (EXP445 section 5: |
| 160 | 3.3 times the longest dev reference in the most verbose spelling; Omegese references are shorter |
| 161 | than OSC text, OMEGESE.md section 5, so the cap is not binding for a correct answer). |
| 162 | `finish_reason=length` is logged. |
| 163 | 4. **Greedy gate (before attempt 1):** the 10 dev tasks in condition B, each sent twice at temperature 0: |
| 164 | both replies byte-identical in content and every reply reports `mode=greedy`. No gate PASS, no |
| 165 | primary result (verdict INVALID). |
| 166 | 5. **Attempt 1 = PRIMARY:** temperature 0 (greedy), round 1 only. Its candidate is set `<c>-1` |
| 167 | (`a-1` .. `d-1`). Every attempt-1 response must report `usage.aien_sampling.mode = greedy`; a single |
| 168 | attempt-1 response reporting anything else (or nothing) makes the run INVALID (section 8). |
| 169 | 6. **Attempts 2 and 3 (pass@3, secondary):** temperature 0.7, top_p 0.8, seeded, only when the G0 sampling |
| 170 | gate passes: the Stage S gate vendored as `tools/exp445/sampling-gate.sh` (sha256 in protocol.json) |
| 171 | with its repro requests set to `devgen01` in condition B at the eight seeds s1..s8 = 476901, 476902, |
| 172 | 476903, 476904, 476905, 476906, 476907, 476908 (protocol.json `gates.g0.seed_values`; disjoint from |
| 173 | every run seed), plus one repeat of s1 = 476901, PASS rules as EXP445 13.4. Otherwise pass@3 is |
| 174 | reported `UNAVAILABLE`. Sets `<c>-2`, `<c>-3`. |
| 175 | **pass@3** of a condition = the tasks with an `ACCEPT` in the union of the round-1 sets `<c>-1`, |
| 176 | `<c>-2`, `<c>-3` only (never a `-final` set), labelled "pass@3 (1 greedy + 2 sampled)". |
| 177 | 7. **Repair (secondary only):** exactly one public-check repair round when round 1 is refused, as EXP445 |
| 178 | section 6 step 4; the final candidate is set `<c>-<attempt>-final`. Never part of the primary or of |
| 179 | pass@3. |
| 180 | 8. **Seeds:** `seed = 476000 + 1000 x attempt + task index` (1-based position in the sorted task list), |
| 181 | the same for the four conditions of one task and attempt; sent and logged for attempt 1 too. |
| 182 | 9. **Transport retry:** a try fails at transport level when there is a transport error, an HTTP status |
| 183 | other than 200, or a 200 with **no usable answer**, defined mechanically: the body is not valid JSON, |
| 184 | or it has no `choices` array, or `choices[0].message.content` is missing or not a string. A failed try |
| 185 | is retried up to 2 times with the byte-identical request (same seed, same temperature, same top_p) |
| 186 | after K x 5 s before try K. A retry repeats the same sample; it is never an extra sample. Still |
| 187 | failing after the third try = no candidate (`no_candidate`, a failure). A well-formed 200 whose |
| 188 | content is empty, a refusal or not a program is NOT a transport failure: that content is the |
| 189 | candidate and is graded (it fails). Attempt-1 `no_candidate` is counted per condition; any count |
| 190 | above 0 makes the run INVALID (section 8), because a transport failure that hits one condition more |
| 191 | than another biases the paired comparison. |
| 192 | 10. **Order:** attempt, then task, then condition (A, B, C, D), so attempt 1 of every task in all four |
| 193 | conditions finishes first. A run resumes only with identical settings; finished generations are |
| 194 | never redone. |
| 195 | 11. Everything is hashed and logged as `tools/gen/runner/FORMATS.md` (GEN-2) specifies: raw requests and |
| 196 | responses, prompt manifests, retrieval outputs, run rows, SHA256SUMS. |
| 197 | |
| 198 | ## 6. Success |
| 199 | |
| 200 | - **Functional success** of a candidate = the sealed harness (`ola.sh experiment`, kind `oscir`) gives |
| 201 | `ACCEPT` on the task's hidden inputs. Anything else (any REJECT reason, `no_candidate`) is failure. |
| 202 | - **Primary measure:** attempt-1, round-1 functional success per condition over the 60 held-out tasks, |
| 203 | paired by task. |
| 204 | - **Checker acceptance** (the public check or checker2 accepting a candidate) is NOT success: a program |
| 205 | that compiles and passes the checker can compute the wrong function. It is reported separately |
| 206 | (`checker_ok`) and never pooled with, or substituted for, functional success. |
| 207 | - The grader runs as `gencust` from a clean tree and publishes a public grading receipt that the reducer |
| 208 | consumes. |
| 209 | - **Outcome classes (decision input):** the grading receipt gives, for every held-out task x condition |
| 210 | (attempt 1, round 1), exactly one class: `ACCEPT`, `REJECT:<reason>` (the harness reason, e.g. |
| 211 | `REJECT:wrong_result`), `no_candidate` (section 5 step 9) or `MISSING` (no row for that task and |
| 212 | condition). Only `ACCEPT` is success. The reducer refuses to reduce (no verdict at all, not even |
| 213 | INVALID) when any cell is `MISSING`, when the number of distinct held-out tasks n is not 60, or when a |
| 214 | task x condition cell appears more than once. |
| 215 | |
| 216 | ## 7. Secondary measures (reported, never decisive) |
| 217 | |
| 218 | Checker acceptance; pass@3 (1 greedy + 2 sampled, or UNAVAILABLE); success after the repair round; |
| 219 | refusal and REJECT reasons by class; prompt and completion tokens per condition; realised suffix bytes; |
| 220 | records selected per task and the number of tasks with fewer than 3 records, for C and D separately |
| 221 | (section 3); wall time; tokens and wall seconds per correct program; Wilson 95% intervals for every |
| 222 | proportion; the 90% Newcombe bounds. |
| 223 | |
| 224 | ## 8. Validity (any failure: verdict INVALID) |
| 225 | |
| 226 | - complete paired matrix: every held-out task x A, B, C, D x attempt 1, exactly once (60 x 4); |
| 227 | - every attempt-1 response reports `mode=greedy`, and attempt-1 `no_candidate` is 0 in each of A, B, C |
| 228 | and D (section 5 steps 5 and 9; the per-condition counts are in the receipt); |
| 229 | - the harness run ends `RUN VALID` (every reference accepted, zero errors, identical replay, probes |
| 230 | PASS, clean tree); |
| 231 | - the greedy gate PASSed before attempt 1; every request was sent one at a time (section 5 step 2); |
| 232 | - every pin of section 13 equals protocol.json; every run SHA256SUMS verifies; every candidate re-derives |
| 233 | from its hashed response; protocol.json passes `gencheck manifest` and `gencheck run-ready` (no null |
| 234 | field, every interface file present, `genret-cli-v3` pinned; there is no "pending merge" exception); |
| 235 | - **seal-open receipt:** before the first `tasks-public` of the sealed pack for generation (= the seal is |
| 236 | opened), the custodian runs its published seal-open script, which runs `gencheck open` and writes |
| 237 | `OPEN`, five lines exactly: |
| 238 | `gen-open 1` / `omega_commit <40 hex>` / `protocol_sha256 <sha256 of protocol.json at that commit>` / |
| 239 | `tasks_sha256 <64 hex>` / `heldout_pub_sha256 <64 hex>`, commits it as |
| 240 | `evidence/GEN/OPEN` and pushes that commit to origin. The run is valid only if that push happened |
| 241 | before the first `tasks-public`, and protocol.json at `omega_commit` passes `gencheck open` with that |
| 242 | OPEN: the record-set manifests (paths and digests), corpus META, prefix, `splits.heldout.pub_sha256` |
| 243 | and `splits.heldout.tasks_sha256` all set (none null) and matching. The reducer refuses a run whose |
| 244 | OPEN commit has a null or different digest; |
| 245 | - `gencheck split` PASSed on SPLIT and HELDOUT.pub against protocol.json at the OPEN commit (it fails |
| 246 | closed when either held-out digest is null), the blind re-declaration gave `mismatches=0` and the |
| 247 | near-duplicate scan gave `above=0` (section 2), all before the seal was opened; |
| 248 | - `oracle_match=60/60` published by the custodian (section 2); |
| 249 | - clean generation tree whose tool files equal the scoring commit's; |
| 250 | - **sanity flag:** B's attempt-1 successes are not lower than A's by more than 2 tasks |
| 251 | (A - B > 2 = the many-shot prefix is broken: INVALID); |
| 252 | - **source-leak probe:** no request, retrieval output or record contains any held-out canary |
| 253 | (section 2) or the bytes of any held-out `hidden/inputs` file; checked by the custodian as `gencust` |
| 254 | after generation, printing only a count (must be 0); |
| 255 | - isolation audit clean (section 12), including no model request by the custodian. |
| 256 | |
| 257 | ## 9. Statistics and decision (exact) |
| 258 | |
| 259 | Notation for condition D against a control X in {A, B, C}, over the n held-out tasks (n = 60): `both`, |
| 260 | `d_only`, `x_only`, `neither` = tasks where both / only D / only X / neither succeed (attempt 1, round 1). |
| 261 | |
| 262 | - **Lift:** `diff = (d_only - x_only) / n`; `lift_ok` iff `10 x (d_only - x_only) >= n` (exact integers; |
| 263 | delta = 10 percentage points = 6 tasks at n = 60). |
| 264 | - **Exact one-sided McNemar** (H1: D better): `p = P(Y >= d_only)`, Y ~ Binomial(d_only + x_only, 1/2), |
| 265 | computed exactly as `p_num / 2^(d_only + x_only)` (p = 1 when there are no discordant tasks); |
| 266 | `p_ok` iff `20 x p_num < 2^(d_only + x_only)` (p < 0.05, exact). |
| 267 | - **Newcombe paired interval for D - X**, method 10 of Newcombe (1998), Statist. Med. 17:2635-2650: |
| 268 | a = both, b = d_only, c = x_only, d = neither, p1 = (a+b)/n, p2 = (a+c)/n, theta = (b - c)/n. |
| 269 | (l1, u1), (l2, u2) = Wilson score intervals (no continuity correction) of p1, p2, with lower limit |
| 270 | exactly 0 at a count of 0 and upper exactly 1 at a count of n. phi = N / sqrt((a+b)(c+d)(a+c)(b+d)), |
| 271 | N = a d - b c, replaced by max(a d - b c - n/2, 0) when a d > b c; phi = 0 when the denominator is 0. |
| 272 | delta = sqrt((p1-l1)^2 - 2 phi (p1-l1)(u2-p2) + (u2-p2)^2), eps = sqrt((u1-p1)^2 - 2 phi (u1-p1)(p2-l2) + |
| 273 | (p2-l2)^2) (a negative radicand from rounding is taken as 0); interval [theta - delta, theta + eps], |
| 274 | clamped to [-1, 1]. Constants: z = 1.959963984540054 (95%), z = 1.644853626951472 (90%, two-sided; |
| 275 | its upper limit is a one-sided 95% bound). IEEE double arithmetic. |
| 276 | - **Verdict**, in this order: |
| 277 | 1. **INVALID** when any validity condition (section 8) fails. |
| 278 | 2. **INCONCLUSIVE, reason `floor`** when max(successes of A, B, C, D) <= 3, and **INCONCLUSIVE, reason |
| 279 | `ceiling`** when min(successes of A, B, C, D) >= 57 (both reasons when both hold): with at most 3 |
| 280 | successes everywhere, or at least 57 everywhere, the paired comparison cannot measure anything, and |
| 281 | neither PASS nor FAIL is claimed. Integers, exact (protocol.json `decision.floor_max = 3`, |
| 282 | `decision.ceiling_min = 57`). |
| 283 | 3. **PASS** when, for every X in {A, B, C}: `lift_ok` and `p_ok` (intersection-union test: each control |
| 284 | at level 0.05, no multiplicity correction needed). PASS is reported in exactly these words: "D beats |
| 285 | every control at one-sided 0.05 with observed lift >= 10pp". It never means "a lift of 10pp or more |
| 286 | is established": the observed lift is a point estimate, and the Newcombe intervals are reported |
| 287 | beside it. |
| 288 | 4. **FAIL** when the upper limit of the 95% Newcombe interval for D - C, as the full IEEE double (never |
| 289 | the 6-decimal value printed in the receipt), is below 0.10. C (raw retrieval) is the designated FAIL |
| 290 | control: the strongest fair baseline by design. |
| 291 | 5. **INCONCLUSIVE** otherwise (reasons: each failing `lift_<X>` and `p_<X>`). |
| 292 | PASS and FAIL cannot both hold (PASS needs theta(D-C) >= 0.10, and the upper limit is at least theta). |
| 293 | The receipt names the verdict and its reason tags. |
| 294 | - At n = 60 this test can only separate large effects: most outcomes that are not a clear win will be |
| 295 | **INCONCLUSIVE**, and that is the honest report, not a failure of the experiment. The 90% upper limit is |
| 296 | reported beside the 95% one and is not decisive. |
| 297 | - **Test vectors:** `tests/one_layer/generalization/stats_vectors.tsv`, generated by |
| 298 | `tools/gen/protocol/genstats vectors` (never by hand), with Wilson, McNemar, Newcombe and full verdict |
| 299 | records (including the floor and ceiling boundaries) and length-match records (section 10). `genstats selftest` reproduces methods 8 and 10 on all 18 rows of the paper's Table III to the |
| 300 | printed 4 decimals (one method-10 cell, row 1/97/1/1, is printed 0.8736 where the paper's own method-8 |
| 301 | cell for the identical formula is 0.8737; the computed value is 0.873672). The GEN reducer must |
| 302 | reproduce every vector (reals within 1e-9; counts, p_num, p_den, yes/no and verdicts exactly). |
| 303 | - The receipt (`omega.gen.decision.v1`, GEN-2 FORMATS.md) reports for each condition the attempt-1 |
| 304 | successes with Wilson 95% intervals and checker acceptance, and for each D-X pair the four counts, diff, |
| 305 | p, both Newcombe intervals, lift_ok and p_ok, and the verdict with its reasons. |
| 306 | |
| 307 | ## 10. Negative controls (pre-registered; run on the dev tasks; diagnostics, not decisive) |
| 308 | |
| 309 | | control | how | expectation if retrieval works as intended | |
| 310 | |---|---|---| |
| 311 | | no retrieval | C and D with genret mode `empty` | equals B up to sampling noise | |
| 312 | | irrelevant records | genret mode `irrelevant` | no better than B | |
| 313 | | length-matched C | C plus whole extra raw records (rank k+1, ...) until at least D's realised suffix bytes for the same task (genret `length-matched`, `--target-bytes` = D's `suffix_bytes`) | separates "more context" from "better content" on matched tasks only (see below) | |
| 314 | | cross-family | C and D with `--exclude-family <the dev task's own family token>` | shows how much a lift depends on same-family records (on dev, own-family records do not exist in the corpus by R3, so this must change nothing: a check of the split) | |
| 315 | | source-leak probe | canaries and hidden inputs searched in every request (section 8) | 0 hits | |
| 316 | |
| 317 | **Length-matched C (secondary, dev-only diagnostic).** It never feeds the PASS / FAIL / INCONCLUSIVE |
| 318 | verdict or run validity. genret-cli-v3 pads C with whole extra raw records, never truncated, in rank order |
| 319 | after the k selected (rank k+1, k+2, ...), until C's suffix is at least D's realised `suffix_bytes` for |
| 320 | the same task (`--target-bytes`): `pad_reason=reached` (it may overshoot by up to one record), |
| 321 | `exhausted` (candidates ran out, still short) or `c_not_shorter` (C was already at least as long; nothing |
| 322 | padded). Its receipt logs `length_gap` = padded C `suffix_bytes` - target, signed. Because padding moves |
| 323 | in whole solutions, it cannot hit a fine target, so each dev task is classified: |
| 324 | |
| 325 | - **matched** when |length_gap| <= max(256 bytes, 15% of the target), compared exactly as |
| 326 | `100 x |gap| <= max(25600, 15 x target)` (protocol.json `retrieval.length_match_abs_bytes = 256`, |
| 327 | `retrieval.length_match_frac = 0.15`); |
| 328 | - **unmatched** otherwise: listed with its gap and pad_reason, never silently dropped. |
| 329 | |
| 330 | The report gives, per dev task, C's and D's `suffix_bytes`, the padded C `suffix_bytes`, pad count, |
| 331 | pad_reason, length_gap and class; then the matched and unmatched counts; then the attempt-1 success of |
| 332 | length-matched C on the matched tasks only, next to normal C and D on those same tasks. When fewer than |
| 333 | 50% of the dev tasks are matched (`retrieval.length_match_min_matched_frac = 0.5`; fewer than 5 of 10), |
| 334 | the result is reported plainly as `length-matched ablation: UNAVAILABLE (<m> of <n> dev tasks matched)` |
| 335 | and no conclusion about prompt length is drawn. The matched tasks are a selected subset (tasks with |
| 336 | short solutions match more easily), so the report states that the length-matched result applies to the |
| 337 | matched subset only, gives its size, and is not an estimate for the whole dev set. The comparison is |
| 338 | read in both directions: when C's suffix is longer than D's (gap > 0, including `c_not_shorter`) and C |
| 339 | still does worse than D, that is evidence against the "D only wins because its prompt is longer" |
| 340 | explanation and is reported as such; when C is shorter and loses, length is not ruled out. Reference |
| 341 | values: `genstats lenmatch <target>:<suffix> ...`, and the `lenmatch` / `lenset` records in |
| 342 | `stats_vectors.tsv`. |
| 343 | The held-out decision uses only conditions A, B, C, D in mode `normal`. |
| 344 | |
| 345 | ## 11. Dev pilot (before the held-out run, never evidence) |
| 346 | |
| 347 | Config A, the 10 dev tasks, all four conditions, attempt 1, plus the negative controls of section 10. |
| 348 | GO when: the greedy gate passes; every generation is logged and re-derives; the dev harness run ends |
| 349 | RUN VALID; B is not worse than A by more than 2 tasks. Builders may change prompts, records or tools |
| 350 | using dev results only, then rerun, at most twice; each change before the seal is opened is a protocol |
| 351 | revision under section 15. |
| 352 | |
| 353 | ## 12. Isolation |
| 354 | |
| 355 | - The custodian is the dedicated Unix user `gencust`; the sealed directory is owned by it, mode 0700. |
| 356 | The custodian authors, seals and grades through `sudo -u gencust`. Builders and the runner never read |
| 357 | it; the runner sees only `ola.sh tasks-public` output. |
| 358 | - Every sudo call is in the system journal. Before the run, and again before the receipt is accepted, |
| 359 | the operator audits the journal (`journalctl _COMM=sudo` for the run window) and lists every command |
| 360 | run as `gencust`; any command not in the custodian's published script list is an isolation failure |
| 361 | (INVALID). |
| 362 | - **The custodian never queries any model.** No custodian script and no command run as `gencust` sends |
| 363 | a request to a model endpoint (:18091, :18097 or any other). The journal audit above also searches |
| 364 | every `gencust` command line for `18091`, `18097`, `chat/completions` and `/v1/`; any hit is an |
| 365 | isolation failure (INVALID). The audit sees command lines only, not traffic inside an allowed script, |
| 366 | so every script in the custodian's published list is reviewed before the run to contain no network |
| 367 | request (stated as a limit of the audit). |
| 368 | - Hidden inputs, expected values, references and grader output are never inputs to generation or |
| 369 | retrieval (GEN-2 manifests record every input). No grader feedback reaches the treatment during |
| 370 | generation; the repair round uses only the public check. |
| 371 | |
| 372 | ## 13. Pins recorded with the run (all in protocol.json or the run's meta) |
| 373 | |
| 374 | Model id, endpoint, request extra, server binary sha256 and source commits (via `tools/exp445/PARAMS`); |
| 375 | weight file hashes (`tools/exp445/weights.A.sha256`, re-checked by the operator before the run); |
| 376 | tokenizer files (in the weight list); Omega commit of the run and of scoring; harness contract |
| 377 | (HARNESS_INTERFACE_V2.md) sha256; reader chain (`tools/exp445/reader.sh`) and arm documents sha256; |
| 378 | B and A prefix sha256 and the 14 prefix ids; C and D manifest paths and sha256 (record-set digests); the OPEN |
| 379 | receipt and its commit; genret contract |
| 380 | and binary sha256; dev pack sha256; held-out `TASKS.sha256`, `split_sha256`, `famlist_sha256`; |
| 381 | family contract and famsig sha256; the blind re-declaration line (`tasks= mismatches=`), the genjac summary |
| 382 | line and `oracle_match` with the oracle source sha256; stats vectors sha256; seeds (run and G0), k, |
| 383 | cap_bytes, max_tokens; per-condition attempt-1 `no_candidate` counts; hardware |
| 384 | (DGX Spark GB10) and the GPU-lock / quiet-flag state at run time; this protocol's sha256. |
| 385 | |
| 386 | ## 14. Commands |
| 387 | |
| 388 | ``` |
| 389 | make test-gen-protocol # famsig, gencheck, genstats, genjac, dev pack (CPU only) |
| 390 | tools/gen/protocol/gencheck manifest tests/one_layer/generalization/protocol.json . |
| 391 | tests/one_layer/generalization/dev/pack_dev.sh <out> |
| 392 | tests/one_layer/acceptance/ola.sh tasks-check <out>/tasks.tar <out>/TASKS.sha256 |
| 393 | famsig rule tests/one_layer/generalization/dev/META tests/one_layer/generalization/corpus/META <SPLIT> # custodian, as gencust |
| 394 | famsig compare <SPLIT> <REDECLARED> # reviewer's blind re-declaration, as gencust |
| 395 | genjac scan <heldout-prompts.list> <corpus-prompts-and-solutions.list> # near-duplicate check, as gencust |
| 396 | gencheck split tests/one_layer/generalization/protocol.json . <SPLIT> <HELDOUT.pub> # reviewer, after the seal |
| 397 | gencheck run-ready tests/one_layer/generalization/protocol.json . # before seal-open and before the run |
| 398 | gencheck open tests/one_layer/generalization/protocol.json . <OPEN> # custodian at seal-open; reducer before reducing |
| 399 | ``` |
| 400 | |
| 401 | The runner, reducer, corpus builder and custodian scripts are specified by their own issues (GEN-2 |
| 402 | #477, GEN-3 #478, GEN-4 #479, GEN-6 #480) and must implement sections 3 to 9 as written here. |
| 403 | |
| 404 | ## 15. Revisions |
| 405 | |
| 406 | - Before the seal is opened for the held-out run, a change is a new revision: edit this file and |
| 407 | protocol.json in one commit, add a line below, bump `revision`, and re-run `make test-gen-protocol`. |
| 408 | A revision may use dev results only; no held-out content is ever opened to justify it. |
| 409 | - After the seal is opened, nothing in sections 2 to 9 changes. Any change (tasks, conditions, budget, |
| 410 | decision rule) is a new protocol version (`GEN_PROTOCOL_V2.md`) with a NEW sealed held-out pack; the |
| 411 | v1 result stands as reported. Negative or inconclusive results are never a reason to rewrite v1. |
| 412 | |
| 413 | - **v1**: first registration (PR #486). |
| 414 | - **v1, amended at review of PR #486 before merge and before any held-out task existed** (revision stays |
| 415 | 1: v1 was never on main): record-set manifest paths re-hashed and the public OPEN seal-open receipt; |
| 416 | R6 coarse disjointness and R7 novel edges; blind re-declaration (`famsig compare`) and the genjac |
| 417 | near-duplicate check; floor and ceiling INCONCLUSIVE; PASS wording; mode=greedy and zero attempt-1 |
| 418 | `no_candidate` as validity conditions; mechanical "no usable answer", identical retries, one request in |
| 419 | flight; pass@3 from round-1 sets; outcome classes and reducer refusal on MISSING or n != 60; D pool |
| 420 | excludes prefix-only abstractions; FAIL on the full double; `gencheck run-ready`, `open`, split fail |
| 421 | closed on null digests; custodian model-query ban; oracle_match; numeric G0 seeds; base_url and query |
| 422 | bytes stated; genret-cli-v3 pinned with its heading approved; length-matched ablation made a dev-only |
| 423 | diagnostic with matched/unmatched tasks and UNAVAILABLE below 50% matched. |
| 424 | - **v1, record sets pinned (before merge, before any held-out task):** corpus META, the 14 prefix ids, |
| 425 | records/PREFIX and the C and D manifests from GEN-3 commit 856cc977 (prefix recomputed from the pick |
| 426 | rule and matching); genret-cli-v3 re-pinned at 4a48b613. |
| 427 | - **v1, R8 and verdict n (before merge, before any held-out task):** rule R8 (no dev or held-out |
| 428 | top-level step is a corpus family in coarse form; dev/META passes against the GEN-3 corpus META); |
| 429 | `genstats verdict` refuses n != 60; the dev-pack tasks-check test runs in a private git worktree; the C and D pools stated as |
| 430 | probe-free (GEN-3 `split=probe` filtered out; C pool count pending from GEN-3). The sentence "Every task |
| 431 | line of corpus META is eligible, GEN-3 transfer-probe tasks included" (probes allowed in the B prefix) |
| 432 | was added in commit 8d940556; probes stay eligible for the prefix only. |
| 433 | - **v1, record sets re-pinned to GEN-3 commit e521e818 (before merge, before any held-out task):** C.MANIFEST |
| 434 | is the probe-free raw pool, 23 records (sha256 `d6b8a9a4...`); D.MANIFEST 9 records (sha256 `1fe9af29...`); |
| 435 | corpus META and records/PREFIX unchanged. Pool sizes bound k: k = 3 is below both pools, and any k above 9 |
| 436 | (D's pool) would let D exhaust its pool and is a new revision. The file pins of `OMEGESE.md`, `ola.sh`, |
| 437 | `reader.sh` and `sampling-gate.sh` re-hashed after main's Apache-2.0 header and OM-2 changes (no protocol |
| 438 | content changed); `famsig_lib.h` and `genstats.c` re-hashed after bounded-write fixes (CodeQL 537-541). |
| 439 | - **v1, file pins re-hashed in train r3 (before merge, before any held-out task; revision stays 1):** |
| 440 | `OMEGESE.md` re-hashed to `533887c7...` after main's recursion-depth note (#645), the seed/equiv |
| 441 | section (#826) and #951's `new` row (omc 1..16777216; the C reference path the reader uses stays |
| 442 | 1..64, `OSC_MAX_ARRAY_LEN`, as FAMSIG_V1.md requires); none is protocol content: conditions, reader |
| 443 | chain, section 5 reference lengths and the decision rule are unchanged. `GEN_PROTOCOL_V1.md` |
| 444 | re-hashed for this line. `make test-gen-protocol` re-run at the train head. `famsig_lib.h` re-hashed |
| 445 | after the three `strcpy` calls that copy metadata-file fields (task id and shape into the parsed line, |
| 446 | then the task id into the ascending-order check's previous id) became `snprintf` into the same-size |
| 447 | buffers (CodeQL "unbounded write" on #979). The first version of this note said "its last two `strcpy` |
| 448 | calls", which was wrong: the third copy was fixed after CodeQL flagged it, and the remaining `strcpy` |
| 449 | calls copy derived shape text, not file fields. All inputs are already length-checked (`fs_task_id_ok` |
| 450 | 1..40, `fs_shape` 1..512), so no accepted or refused input changes. `GEN_PROTOCOL_V1.md` re-hashed again. |
| 451 | - **v1, file pins re-hashed for #946 (before any held-out task; revision stays 1, as in train r3):** |
| 452 | `OMEGESE.md` re-hashed after its "Host CPU ordering words" section (`cpufence`/`cpurelax`, omc |
| 453 | keyword ids 199/200). The reader chain in `tools/` has no such words; conditions, section 5 reference |
| 454 | lengths and the decision rule are unchanged, so no protocol content changed. `GEN_PROTOCOL_V1.md` |
| 455 | re-hashed for this line. `make test-gen-protocol` re-run at the #946 head. |