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 / calibration / docs / DATA_FORMAT.md
| 1 | # EXP-001 data and bundle format (docs-only reference) |
| 2 | |
| 3 | This document is enough to read every EXP-001 input and output without the omega or crumbs source. It closes |
| 4 | the independent scorer's gaps G1 (CTR1 layout), G3 (crumb boundary), G5 (bundle layout), G6 (profile digest), |
| 5 | G9 (event-index gaps) and G10 (crumb saturation). It is part of the shared background hashed into the candidate |
| 6 | manifest. Where it and the code disagree, the code is wrong and the run is a terminal FAIL of the criterion that |
| 7 | used the value (FAILURE_REPORTING.md section 2). |
| 8 | |
| 9 | All integers are little-endian and unsigned unless stated. "SHA-256" means lowercase hex. |
| 10 | |
| 11 | ## 1. CTR1 trace file (`control/trace.ctr`) |
| 12 | |
| 13 | A headerless stream of 247-byte records. The file size must be a multiple of 247, otherwise the file is refused. |
| 14 | Each record is a 215-byte body followed by a 32-byte BLAKE3 chain digest. The chain is not verified by EXP-001 |
| 15 | (no BLAKE3 in the tree); file integrity is pinned by the SHA-256 in the dataset manifest instead (G12). |
| 16 | |
| 17 | | Offset | Size | Field | Used by EXP-001 | |
| 18 | |---:|---:|---|---| |
| 19 | | 0 | 4 | magic, ASCII `CTR1` | refused if different | |
| 20 | | 4 | 2 | version u16 | must be 1 | |
| 21 | | 6 | 1 | kind u8: 1 = EXPAND, 2 = SUBMIT | symbol, refusal | |
| 22 | | 7 | 1 | result_class u8: 1 Pruned, 2 Failed, 3 Partial, 4 Improved, 5 Verified, 6 RejectedHidden, 7 RejectedRobust | symbol | |
| 23 | | 8 | 4 | event_index u32 | crumb boundary | |
| 24 | | 12 | 4 | parent u32 | no | |
| 25 | | 16 | 4 | child u32 | no | |
| 26 | | 20 | 2 | op_index u16 | context (EXPAND) | |
| 27 | | 22 | 1 | op_origin u8 | must be 0 (control arm: base ops only) | |
| 28 | | 23 | 1 | prune u8: 0 none, 1 EQUIV, 2 COST, 3 FRONTIER_CAP, 4 STEP_CAP | symbol | |
| 29 | | 24 | 1 | verify u8 | must be <= 4 | |
| 30 | | 25 | 1 | fit u8 | must be <= 2 | |
| 31 | | 26 | 1 | hidden u8 | no | |
| 32 | | 27 | 1 | improved u8 | no | |
| 33 | | 28 | 1 | contributed u8 | no | |
| 34 | | 29 | 2 | depth u16 | context, clipped to min(depth, 7) | |
| 35 | | 31 | 32 | op_id | no | |
| 36 | | 63 | 32 | state_digest | no | |
| 37 | | 95 | 32 | child_state_digest | no | |
| 38 | | 127 | 32 | program_digest | no | |
| 39 | | 159 | 2 | mismatch_before u16 | no | |
| 40 | | 161 | 2 | mismatch_after u16 | no | |
| 41 | | 163 | 4 | hamming_before u32 | no | |
| 42 | | 167 | 4 | hamming_after u32 | no | |
| 43 | | 171 | 4 | exec_cost u32 | no | |
| 44 | | 175 | 4 | search_cost u32 | no | |
| 45 | | 179 | 2 | program_steps u16 | no | |
| 46 | | 181 | 2 | oracle_index u16 | no | |
| 47 | | 183 | 32 | residual u64[4] | no | |
| 48 | | 215 | 32 | BLAKE3 chain digest | no (see above) | |
| 49 | |
| 50 | The overlap audit's crumb-block hash (verify_holdout_separation.sh G9) covers bytes 0..214 of every record. |
| 51 | |
| 52 | ### 1.1 Symbol mapping (alphabet K = 9) |
| 53 | |
| 54 | | Symbol | Name | Condition | |
| 55 | |---:|---|---| |
| 56 | | 0 | P_EQUIV | kind 1, prune 1 (result_class must be 1) | |
| 57 | | 1 | P_COST | kind 1, prune 2 (result_class must be 1) | |
| 58 | | 2 | P_FRONTIER | kind 1, prune 3 (result_class must be 1) | |
| 59 | | 3 | P_STEPCAP | kind 1, prune 4 (result_class must be 1) | |
| 60 | | 4 | FAILED | kind 1, prune 0, result_class 2 | |
| 61 | | 5 | PARTIAL | kind 1, prune 0, result_class 3 | |
| 62 | | 6 | IMPROVED | kind 1, prune 0, result_class 4 | |
| 63 | | 7 | ACCEPT | kind 2, prune 0, result_class 5 | |
| 64 | | 8 | REJECT | kind 2, prune 0, result_class 6 or 7 | |
| 65 | |
| 66 | The context feature `op` is op_index (0..14) for EXPAND and 15 for SUBMIT. Refusals (the evaluator reads and validates every CTR1 file before it scores any file, so a bad file always |
| 67 | refuses before any score exists: FORMAT, a void; EVALUATOR.md section 3): bad magic; version != 1; op_origin != 0; verify > 4; fit > 2; kind not 1 or 2; |
| 68 | EXPAND with op_index >= 15 or prune > 4; pruned EXPAND with result_class != 1; unpruned EXPAND with result_class |
| 69 | outside 2..4; SUBMIT with prune != 0 or result_class outside 5..7. |
| 70 | |
| 71 | ### 1.2 Crumb boundary (G3) |
| 72 | |
| 73 | A record with event_index 0 starts a new crumb (this is the "first" flag and the "same crumb id" of |
| 74 | EVALUATOR.md and CODER_SPEC.md). Every other record must have event_index strictly greater than the previous |
| 75 | record in the file, otherwise the file is refused. The first record of a file must have event_index 0. A jump of |
| 76 | more than one inside a crumb is a gap: it is counted and reported (`gaps`), never refused (G9). Crumbs are |
| 77 | numbered 0, 1, 2, ... in file order; the crumb ordinal stored in TPS1 and used by the POS context is |
| 78 | min(ordinal, 65535) (G10). A crumb is the unit of the per-crumb envelope (S4) and of the bootstrap pool. |
| 79 | Saturation is accepted (CAL-0 review 2 Q15): in a file with more than 65,535 crumbs, every crumb from ordinal 65535 |
| 80 | on would share one ordinal, so the evaluator would treat them as a single crumb (one bootstrap unit, one per-crumb |
| 81 | envelope entry) and the POS context would see one value for them. It cannot happen at this design: the development |
| 82 | traces hold 181 to 188 crumbs per file, about 350 times below the limit, and the sealed traces come from the same |
| 83 | generator with the same trace length. |
| 84 | |
| 85 | ## 2. Profile digest (G6) |
| 86 | |
| 87 | The profile digest is the SHA-256 of the bytes of `calibration/profiles/Turing-profile-v1.0.toml`. The sidecar |
| 88 | `Turing-profile-v1.0.sha256` and the bundle file `profile.digest` both hold one line `<digest> Turing-profile-v1.0.toml` |
| 89 | + LF; "the digest" is the 64-hex value on that line, not the hash of the sidecar file. The same 32 bytes sit at |
| 90 | TPS1 header offset 28 (CODER_SPEC.md section 2). |
| 91 | |
| 92 | ## 3. Dataset manifest (`dataset_manifest.json`, schema turing.cal.dataset_manifest.v1) |
| 93 | |
| 94 | Written by `calibration/scripts/make_dataset_manifest.sh` (`--dev` for development data, `--sealed` for the sealed |
| 95 | set). Top-level keys: schema, dataset_id, experiment, split (`development` or `sealed_test`), profile_digest, |
| 96 | freeze_commit (C_f, or `NONE` for development data), generator_digest, learner_digest, parameter_commitment, |
| 97 | seed_commitment_sha256, sealed_manifest_sha256, released_utc, generation_finished_utc, trajectory_count, |
| 98 | payload_digest, files. Each `files` entry is one line |
| 99 | `{"group": g, "index": j, "seed": S, "sha256": ..., "bytes": ..., "path": ...}` with group 1 (primary) or 2 |
| 100 | (replication) and index j = 0, 1, 2 within the group (j is the position in the seed-commitment order, which is the |
| 101 | derivation index; it is also the bootstrap pool order, UNCERTAINTY_PROTOCOL.md section 3). |
| 102 | |
| 103 | ## 4. Run root and bundle layout (G5) |
| 104 | |
| 105 | A sealed run (and the dev dry run, `tests/turing/test_tc_eval_dry.sh`) uses one run root R and runs with the |
| 106 | working directory R: |
| 107 | |
| 108 | ``` |
| 109 | R/candidate_manifest.json copy of the frozen manifest (from C_f) |
| 110 | R/dataset_manifest.json the sealed (or dev) dataset manifest, section 3 |
| 111 | R/candidates/ the seven .tym files (or --cand-dir) |
| 112 | R/bundle/ the bundle (below); sealed R = $TC_EVAL_ROOT/<C_f>/run (FAILURE_REPORTING.md section 6) |
| 113 | R/work/ large intermediate files, referenced by relative path "work/..." |
| 114 | R/work/probability_streams/g<g>_j<j>_<C>.tps TPS1 stream per candidate and file |
| 115 | R/work/symbols/g<g>_j<j>_<C>.tsy TSY1 symbol stream per candidate and file |
| 116 | R/work/arithmetic/g<g>_j<j>_<C>.tcr range coder output (TCR1) |
| 117 | R/work/ans/g<g>_j<j>_<C>.tca rANS coder output (TCA1) |
| 118 | ``` |
| 119 | |
| 120 | Bundle files (EVALUATOR.md section 5 describes their content): |
| 121 | |
| 122 | | File | Content | |
| 123 | |---|---| |
| 124 | | `profile.digest` | section 2 | |
| 125 | | `probability_streams/INDEX` | one line per candidate and file: `<TPS1 file sha256> <TPS1 trailer digest> <TSY1 trailer digest> <g> <index> <candidate> <bytes> <path>`; first line is a `#` comment | |
| 126 | | `encoded_artifacts/INDEX` | one line per coder, candidate and file: `<coded file sha256> <coder: range or rans> <g> <index> <candidate> <bytes> <path>`; first line is a `#` comment | |
| 127 | | `ideal_lengths.json` | whole-file and per-crumb ideal lengths (ub), event counts, per-crumb coded bytes | |
| 128 | | `arithmetic/results.json`, `ans/results.json` | coded sizes and decode results per coder | |
| 129 | | `decoder_receipts/g<g>_j<j>_<C>.json` | lossless decode receipt per candidate and file | |
| 130 | | `scorer_primary.json` | the S8 key set (EVALUATOR.md section 6) | |
| 131 | | `scorer_independent.json` | the independent scorer's output (tools/turing_verify_indep) | |
| 132 | | `uncertainty.json` | bootstrap intervals | |
| 133 | | `final_receipt.pending.json`, `REPORT.pending.md` | before the gate | |
| 134 | | `final_receipt.json`, `REPORT.md` | after the gate (write-once) | |
| 135 | | `void_receipt_<n>.json` | one per void attempt (FAILURE_REPORTING.md section 2) | |
| 136 | |
| 137 | `<path>` in both INDEX files is relative to R. TSY1 files are not listed in an INDEX; their path is fixed by the |
| 138 | naming above. The per-crumb coded sizes in `ideal_lengths.json` come from coding each crumb alone with its own |
| 139 | 56-byte header; they are published but are outside the S8 key set (G8). |