interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / docs / turing / PRD2_PREDICTION_FORMAT.md

87 lines · 4878 bytes Raw Blame History Rendered
1# PRD2: mixture-capable prediction format (EXP-002D Stage A)
2
3Status: PROTOCOL FREEZE for EXP-002D row 28. Written and hashed before any test vector or
4result existed (receipt `evidence/EXP-002D/01_protocol_freeze.txt`). PRD1 (`src/turing/ty_prd.*`,
5`docs/turing/TURING_QCONT_RECORDS_V0.md`) is not changed by this document; every PRD1 receipt
6and every Wave 1 sealed outcome stands as recorded.
7
8## Why
9
10EXP-002D (Brownian Wave 1 hostile cases) is INCOMPLETE because one hostile rule is not
11evaluable under the Wave 1 prediction format. The rule is the mixture-weight rule of the
12Brownian profile (spec section 5.2: "A finite Gaussian mixture with K <= 8 ... Weights must
13sum to 1 within 1e-9. The scorer refuses the prediction otherwise. It does not renormalize").
14Hostile row 28 expects FAIL_PROTOCOL for weights summing to 0.9, 1.1, and for a negative
15weight. PRD1 carries 24 bytes per record (index, family, loc, scale) and has no weight field,
16so in Wave 1 every mixture is refused by family before any weight can be read; the sealed
17harness prints "PENDING #28" and the row is not counted. This document defines the smallest
18format that makes the weight rule evaluable.
19
20## Wire format PRD2 (little-endian, binary64 IEEE values)
21
22Header, 16 bytes: magic `PRD2`, u32 version = 2, u32 count, u32 first_index.
23Then `count` records, record i:
24
25| field | type | rule |
26| --- | --- | --- |
27| index | u32 | exactly first_index + i |
28| family | u32 | 0 Gaussian, 2 Gaussian mixture; 1 (Student-t) refused (decision A2 deferred stands) |
29| K | u32 | family 0: exactly 1; family 2: 1 <= K <= 8 (TYQ_KMAX) |
30| reserved | u32 | 0 |
31| K components | each f64 pi, f64 loc, f64 scale | see below |
32
33Component rules: `pi` finite and `0 < pi <= 1`; `loc` finite; `scale` finite and `> 0`.
34Family 0 requires `pi == 1.0` exactly. Family 2 requires `|sum(pi) - 1| <= 1e-9`
35(TYQ_NORM_TOL). A file is refused as a whole on the first violation; nothing is renormalized,
36clipped or repaired. Trailing bytes, a short file, a PRD1 magic, or a version other than 2
37are refused. All refusals are TYQ_FAIL_PROTOCOL; a reason code names the violated rule
38(see `src/turing/ty_prd2.h`), so a refusal "by weight" is distinguishable from "by family".
39
40## Scoring a mixture under qint.v1
41
42One point: with `b_j` the qint.v1 Gaussian bits of component j (`ty_qcont_bits`, unchanged,
43sd floor applied per component), the mixture bits are
44
45```text
46bits = -log2( sum_j pi_j * 2^(-b_j) )
47```
48
49computed as `m - log2(sum_j pi_j * 2^(-(b_j - m)))` with `m = min_j b_j`. A point is a floor
50hit if any component was raised to sd_min. Micro-bit conversion, overflow guard and ty_add
51summation are the PRD1 rules verbatim. Consequence used as a check: a K = 1 mixture with
52`pi = 1` scores bit-identically to the Gaussian record, and K identical components score the
53same as one, so declaring a mixture earns nothing by itself.
54
55## Preregistered evaluation rule R28-v2 (row 28 MATCH iff all hold)
56
571. weights 0.5 and 0.4 (sum 0.9): FAIL_PROTOCOL, reason WEIGHT_SUM;
582. weights 0.5 and 0.6 (sum 1.1): FAIL_PROTOCOL, reason WEIGHT_SUM;
593. weights 1.5 and -0.5 (sum 1, one negative): FAIL_PROTOCOL, reason WEIGHT_RANGE;
604. weights 0.5 and 0.5: accepted and scored; the scorer called on case 1 returns
61 FAIL_PROTOCOL and no number (no renormalization path exists);
625. K = 1, pi = 1 mixture bits equal the Gaussian bits exactly on the qint.v1 KAT grid;
636. eight identical components with pi = 1/8 score within 1e-12 bits of the single Gaussian.
64
65## Preregistered negative controls (v2 must not make everything pass)
66
67On one synthetic path of 2000 Gaussian increments from a fixed-seed generator inside the
68test (no sealed world, no Brownian profile data), with the honest predictor H = Gaussian
69(previous value, true increment sd):
70
71- N1 format: PRD1 bytes given to the PRD2 reader are refused (reason MAGIC); PRD2 bytes given
72 to the unchanged PRD1 reader are refused;
73- N2 constant predictor (loc 0 every point, true sd) as a legal K = 2 mixture: summed bits
74 strictly greater than H;
75- N3 shuffled predictions (H's locs under a fixed permutation): summed bits strictly greater
76 than H;
77- N4 padded mixture (H plus a pi = 0.5 component with sd 1e6): summed bits exceed H by at
78 least 0.9 bits per point (the honest component carries half the mass, so the cost is at
79 least 1 bit per point minus the far component's negligible share).
80
81## What this does and does not close
82
83Passing R28-v2 in omega makes row 28 evaluable and gives the omega-side result. EXP-002D is
84closed only when the sealed harness test (`hostile_leak.c` "#28" in the private evaluator
85repository) is re-pointed at PRD2 and the EXP-002D development runner is re-run under a new
86omega pin, with its own receipt. Until then EXP-002D stays INCOMPLETE; this work changes the
87reason from "format cannot carry the rule" to "sealed harness re-run owed".