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 / src / turing / ty_profile.c
| 1 | /* SPDX-License-Identifier: Apache-2.0 |
| 2 | * Copyright 2026 Drake Stapleton (AIEN / aien-dev) |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | /* Turing Yield measurement profile V0. The text here is the digested form of |
| 18 | * docs/turing/TURING_YIELD_PROFILE_V0.md; changing any field changes the |
| 19 | * profile digest, and a model or gain record made under V0 is then refused. */ |
| 20 | #include "turing/ty_record.h" |
| 21 | |
| 22 | #include <stdio.h> |
| 23 | #include <string.h> |
| 24 | |
| 25 | /* Pre-registered from fit seeds only (profile doc sections 7 and 9). */ |
| 26 | #define TY_V0_BASELINE_MASK (TY_F_PREV1) |
| 27 | #define TY_V0_CANDIDATE_MASK (TY_F_OP | TY_F_PREV1 | TY_F_PREV2 | TY_F_PREV3 | TY_F_PREV4) |
| 28 | #define TY_V0_MARGIN_UB 234602333141LL /* ceil(3 x sqrt(3) x 45149.240 bits), LOSO seeds 1-7 */ |
| 29 | |
| 30 | void ty_yprofile_v0(ty_yprofile *p) { |
| 31 | memset(p, 0, sizeof *p); |
| 32 | snprintf(p->name, sizeof p->name, "TY measurement profile v0"); |
| 33 | snprintf(p->dataset, sizeof p->dataset, |
| 34 | "crumbline exp-20260927-rep10 control trace.ctr seeds 1-10 per manifest; fit seeds 1-7; " |
| 35 | "held-out seeds 8-10 scored once"); |
| 36 | snprintf(p->x_t, sizeof p->x_t, |
| 37 | "one outcome per CTR1 record, K=9: EXPAND pruned equiv/cost/frontier/step_cap, EXPAND unpruned " |
| 38 | "failed/partial/improved, SUBMIT accept/reject"); |
| 39 | snprintf(p->side_info, sizeof p->side_info, |
| 40 | "not coded, open to every model: op_index (SUBMIT=15), depth clipped at 7, crumb boundaries, crumb " |
| 41 | "ordinal, event_index"); |
| 42 | snprintf(p->context_reset, sizeof p->context_reset, |
| 43 | "per crumb: previous-outcome features restart at event_index 0"); |
| 44 | p->K = TY_OUT_K; |
| 45 | p->qbits = TY_QBITS; |
| 46 | p->floor_q = 1; |
| 47 | snprintf(p->estimator, sizeof p->estimator, |
| 48 | "ty.fit.kt16.mdl.v0: KT add-1/2 counts, 16-bit largest-remainder rows summing to 65536, floor 1/65536, " |
| 49 | "row kept iff fit-data saving > row cost, unseen context uses the default order-0 row"); |
| 50 | snprintf(p->lm_code, sizeof p->lm_code, |
| 51 | "TYM0 v0 bitstream; L(M) = exact bits = 104 + 16(K-1) + rows x (keybits + 16(K-1))"); |
| 52 | p->fit_rule = TY_FIT_MDL_PRUNE; |
| 53 | snprintf(p->baseline_rule, sizeof p->baseline_rule, |
| 54 | "argmin validation DL (fit seeds 1-6, score seed 7) over order-0, order-1 (prev outcome), op-only; chosen order-1"); |
| 55 | p->baseline_mask = TY_V0_BASELINE_MASK; |
| 56 | snprintf(p->candidate_rule, sizeof p->candidate_rule, |
| 57 | "argmin validation DL over op + optional depth + previous outcomes 1..h, h = 1..5 (10 models); " |
| 58 | "chosen op+prev1..4; refit on seeds 1-7"); |
| 59 | p->candidate_mask = TY_V0_CANDIDATE_MASK; |
| 60 | snprintf(p->pass_rule, sizeof p->pass_rule, |
| 61 | "PASS iff pooled T - qerr > margin_ub and, for each held-out seed with full L(B) and L(C) charged " |
| 62 | "to it, T - qerr > 0; otherwise FAIL and STOP"); |
| 63 | p->margin_ub = TY_V0_MARGIN_UB; |
| 64 | p->qerr_milli_ub = TY_QERR_MILLI_UB_PER_SYMBOL; |
| 65 | snprintf(p->energy_denominator, sizeof p->energy_denominator, |
| 66 | "TY-7: T/J = T / E_C, E_C = idle-subtracted energy of scoring the held-out split with C alone; " |
| 67 | "E_C - E_B not used (near zero or negative makes the ratio unbounded)"); |
| 68 | } |