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
GitHub aien-dev/omega-mv#297 (code only)
Apply it
git checkout -b patch-711ba70c60dde39d f1da16001b962d6c3a11c13fdf037d177e583c1f curl -fsSL https://interplane.io/drakestapleton/omega-mv/patches/711ba70c60dde39d.patch | git am
Provenance
github-import 1
aien-dev/omega-mv
297
28ece0c398ffa00d453331efefb5fdeb5d6e04f0
{"kind":"github-import","owner":"aien-dev","repo":"omega-mv","number":297,"url":"https://github.com/aien-dev/omega-mv/pull/297","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:37:12Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/.crumb b/.crumb index 3ef2da18a..28c4193f5 100644 --- a/.crumb +++ b/.crumb @@ -51,8 +51,8 @@ "purpose": "Directory calibration. Purpose not yet described by a human." }, { - "digest": "6e14289e56c71da98a060589cfd4c23818169b62a9d030c8f76dc4c3c933bac5", - "last_commit": "a386d65", + "digest": "7d4fb8a4ca16a4e4efb7734e098157e697f84678b641df869ed0bb3f0caa37a1", + "last_commit": "c847a16", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." }, @@ -64,7 +64,7 @@ }, { "digest": "2b9abab41d977b59a4c2028721f9eed109694da67caee74a589b795891995ac2", - "last_commit": "a2fe9dd", + "last_commit": "f1da160", "name": "mk", "purpose": "Directory mk. Purpose not yet described by a human." }, @@ -88,32 +88,32 @@ }, { "digest": "9d41b28b5097bcd6375ec285de5ce215bed31cf06816fa34adb0dd529e46cd54", - "last_commit": "fd14686", + "last_commit": "f1da160", "name": "src", "purpose": "Directory src. Purpose not yet described by a human." }, { "digest": "09c803a2d62bcda0b85e84c70399d270bda18d335e77270c58567746abf1f173", - "last_commit": "fd14686", + "last_commit": "f1da160", "name": "tests", "purpose": "Directory tests. Purpose not yet described by a human." }, { - "digest": "43dd39270ced0e0209a37d3b7d37376581f4d54f1e436662472c232c08f1c633", - "last_commit": "57e0e5f", + "digest": "1987becea7850243107a1e552c1a279bc4fca82a7a94c7b2b4c540cdf06fee35", + "last_commit": "c847a16", "name": "tools", "purpose": "Directory tools. Purpose not yet described by a human." } ], - "children_root": "sha256:d13893ad0dcfb66d689c94e44561bba0deae33ff5f962ee76332178fa689aba4", - "compiled_at": "2026-10-05T16:20:55Z", + "children_root": "sha256:f9d2277fcc55ff0a736f1f4551f97efd92d9bbbbe986eda759a58b5e6ecef56d", + "compiled_at": "2026-10-05T16:36:21Z", "compiler": "crumb-compile/1", - "digest": "sha256:569291b1c7e430d864730ddf435ab89d25bd58a0b1bfcb284d0d15ba3201743a", + "digest": "sha256:1ef14545f2defdf28842f90f1a5034f5c158bb2214515ae2af960c0b71eb1284", "evidence_files": 2770, "evidence_root": "sha256:02119bd8a3cb15fc8a83ca7813cb036b850b6bcfdbd6203fac6d247dc9017550", "files": 4569, - "generated_at_commit": "bfe4be858d65d5441ee98434945db8fe816dfeff", - "source_tree": "sha256:c43188d74f542bb091cd783e9a94471718cc7069edbc1c4f00149a431ed4829f" + "generated_at_commit": "c847a167bdaeb6e2dc997a46c37057639bb39412", + "source_tree": "sha256:80880a6285a4e4788daa8a015cc51798ee1089e107366d088f3fa669fa8b2d0a" }, "owner_lane": "", "provenance": { diff --git a/docs/.crumb b/docs/.crumb index bc5750949..a5dd71a54 100644 --- a/docs/.crumb +++ b/docs/.crumb @@ -75,8 +75,8 @@ "purpose": "DUAL (ARCH-0031) documents in omega: applicability experiment method and findings (APPLICABILITY" }, { - "digest": "309099a51e1b169e9efddeec6aaf6003f130181e9d6087d9a2a64f62ed793cf9", - "last_commit": "ca12ad5", + "digest": "e1c9f57d05abe38c7e26d0ff4e03e9a845da7dd09cd0c6f0763d20348b637618", + "last_commit": "a386d65", "name": "estimation", "purpose": "Directory docs/estimation. Purpose not yet described by a human." }, @@ -117,15 +117,15 @@ "purpose": "Directory docs/turing. Purpose not yet described by a human." } ], - "children_root": "sha256:bfed325d083303b9d78a04fe90d4c99d6feb960cf3059b0fc29828699de70803", - "compiled_at": "2026-10-05T14:17:16Z", + "children_root": "sha256:f2a14defafba3c9064172c63652f52182db9471d4002cc77690d164a1736a255", + "compiled_at": "2026-10-05T14:59:30Z", "compiler": "crumb-compile/1", - "digest": "sha256:6e14289e56c71da98a060589cfd4c23818169b62a9d030c8f76dc4c3c933bac5", + "digest": "sha256:7d4fb8a4ca16a4e4efb7734e098157e697f84678b641df869ed0bb3f0caa37a1", "evidence_files": 31, "evidence_root": "sha256:3f4d8ab7c723c9fddacc5a872541933a4b87d1bb39868b8ec376320db6c929af", "files": 109, - "generated_at_commit": "03668208f618092c4e33ba9691e5b1a4ede9a613", - "source_tree": "sha256:8d260d4f48b5fd2d0fe40289fc801b19e02749ef29ad7a7fcf2be7a9777d4e89" + "generated_at_commit": "a386d65ed193a02dccac444de3fd3224c96162b4", + "source_tree": "sha256:8f71f1258afc0c4fb3e80a574409d90fed0f89a5990d31ee50e0ba4e83004f94" }, "owner_lane": "", "provenance": { diff --git a/docs/estimation/.crumb b/docs/estimation/.crumb index 4710a99ca..063967103 100644 --- a/docs/estimation/.crumb +++ b/docs/estimation/.crumb @@ -24,14 +24,14 @@ } ], "children_root": "sha256:35cd3af03e079556db7f3ebcfd7590fa68659e84dd603795ae6b5b048dc2af0d", - "compiled_at": "2026-10-05T14:17:16Z", + "compiled_at": "2026-10-05T14:59:30Z", "compiler": "crumb-compile/1", - "digest": "sha256:309099a51e1b169e9efddeec6aaf6003f130181e9d6087d9a2a64f62ed793cf9", + "digest": "sha256:e1c9f57d05abe38c7e26d0ff4e03e9a845da7dd09cd0c6f0763d20348b637618", "evidence_files": 31, "evidence_root": "sha256:3f4d8ab7c723c9fddacc5a872541933a4b87d1bb39868b8ec376320db6c929af", "files": 44, - "generated_at_commit": "03668208f618092c4e33ba9691e5b1a4ede9a613", - "source_tree": "sha256:ed08f3b155508dfe44e820bb68f822e611cf546ed5c7e802582a4965cc34db69" + "generated_at_commit": "a386d65ed193a02dccac444de3fd3224c96162b4", + "source_tree": "sha256:9c4fd50874b3be4f7d7afe4c52446c3ef9783204640a72b253b684e1cdc7c30c" }, "owner_lane": "", "provenance": { diff --git a/docs/estimation/protocols/est-v6-appendix-prefreeze.md b/docs/estimation/protocols/est-v6-appendix-prefreeze.md index 1719bd9bd..8c506370e 100644 --- a/docs/estimation/protocols/est-v6-appendix-prefreeze.md +++ b/docs/estimation/protocols/est-v6-appendix-prefreeze.md @@ -147,6 +147,52 @@ used, in which case H2 becomes the next passing seed after 0xD6E6CB, which is ** L6 810, L12 569, L18 681; `est6dev pick 0xD6E6CC 2700`). Alternatively choose declared seeds that pass. The schedule alone decides either way; no data is needed. +## 3b. Schedule rule SR-1 (proposed replacement for the seed rule of v6 section 3; v6 stays NOT FROZEN) + +Cause of the collision, from the code and the text, not from data: `est-v6.md` section 3 (lines 117 to 125) says a seed +that fails the balance rule is replaced by "the next seed (+1)". That chain starts at each declared seed and ignores +which run it is for, and H1 and H2 are declared one apart (0xD6E6C7, 0xD6E6C8), so their chains meet. Reproduced with +`est6dev plan6 --rule old 2700 F=0xE6C6D1 H1=0xD6E6C7 H2=0xD6E6C8`: H1 takes k = 4 and H2 takes k = 3, both ending +at 0xD6E6CB (41 segments; idle 522, L6 572, L12 857, L18 749). The 0xD6E6CD "skip used seeds" patch of section 3 would +work but makes H2 depend on what H1 happened to draw. + +Rule SR-1 (implemented in `est6dev plan6`, default rule): +1. Derivation input is the pair (run label, declared seed). `base = splitmix64( declared XOR fnv1a64("est6-sched-v1/" label) )`, + one output of the same splitmix64 used by `est_load.c`. +2. Candidate k is the `est_load` schedule of seed `base + k`, k = 0, 1, 2, ...; the effective seed is the first k whose + schedule passes the balance rule. The only test is the schedule's own balance (idle, L6, L12, L18 each 400 to 900 s); + no data and no score enter. The search is bounded at k = 255 and fails closed (`NO_PASSING_SEED`). +3. Labels are `F`, `H1`, `H2`; a recollection after an INCONCLUSIVE window uses the labels `F.r1`, `H1.r1`, `H2.r1`, `H1.r2`, ... + with the same declared seed (this replaces "seed + 0x10 x n"). +4. A plan is refused (exit 1, `COLLISION`) if any two labels have the same effective seed or the same segment list. This is a + refusal, not a trigger for more searching: a refused plan is fixed by changing the declared text before freeze. +5. The effective seed (64 bit) is what is passed to `est_load` (it reads it with `strtoull`, `est_load.c:73`), and the + whole segment list is written into the frozen file. + +Required properties (checked by `make test-est6dev`, 35 checks in total, of which the schedule ones are in the block +"2b"): the segments of each label sum to exactly 2700 s; every segment is 20 to 120 s except that the last may be +clipped; each level totals 400 to 900 s; H1 and H2 (and F) have different effective seeds and different segment lists; +the same declared seed under two labels gives two schedules; the same input gives byte-identical output; a label's +schedule does not depend on the other labels in the plan. Red/green: the old rule reproduces the collision +(`--rule old` exits 1 with `COLLISION H1 H2 effective 0xd6e6cb`, asserted by the test), SR-1 exits 0 with `distinct PASS`. +A deliberately broken SR-1 (label removed from the derivation) fails the test "same declared seed, two labels". + +No schedule was chosen by trying alternatives: SR-1 was written down above and run once on the declared seeds, and its +output is the one recorded here. The v5 schedule tools (`sched`, `pick`) and `est_load.c` are unchanged. + +Result of SR-1 on the declared seeds (`est6dev plan6 2700 F=0xE6C6D1 H1=0xD6E6C7 H2=0xD6E6C8`; segment list +level/seconds is printed by the same command): + +| label | declared | k | effective seed | segments | idle | L6 | L12 | L18 | +|---|---|---|---|---|---|---|---|---| +| F | 0xE6C6D1 | 1 | 0xc6165660a97249c0 | 46 | 622 | 620 | 669 | 789 | +| H1 | 0xD6E6C7 | 1 | 0x0fe5afc2c2177267 | 36 | 452 | 732 | 634 | 882 | +| H2 | 0xD6E6C8 | 0 | 0xb47c8fc0335c4b5f | 40 | 891 | 676 | 473 | 660 | + +Whether these three are the schedules at freeze is a freeze decision; they are listed so the rule's output is auditable. +The balance rule is a property of the schedule only. It does not remove the section 2 finding that load level +matters to calibration, and it does not claim any schedule is representative. + ## 4. Item 2: G1S fit with block cross-validation (REDUCED, not the full item) Size assessment of the full item. The protocol's G1S fit is a new model plus the whole fit machinery with diff --git a/tools/.crumb b/tools/.crumb index b7921a221..2c2981330 100644 --- a/tools/.crumb +++ b/tools/.crumb @@ -43,8 +43,8 @@ "purpose": "Runner for the DUAL applicability experiment: runs the pre-registered campaign and writes result" }, { - "digest": "d4a6875be9942403548ed74e5f75e57bfe5824237dc985ae51813f42230d6134", - "last_commit": "a386d65", + "digest": "38788064b345d8de8180cf536f5ad4419044db9efe9e7d7645fe83ba77740769", + "last_commit": "c847a16", "name": "estimation", "purpose": "Directory tools/estimation. Purpose not yet described by a human." }, @@ -55,15 +55,15 @@ "purpose": "Directory tools/turing_verify_indep. Purpose not yet described by a human." } ], - "children_root": "sha256:3f9857a8b0946837f5556bcea0b4deaddd3a5aa3a60a31aa08ac917ac69d19f9", - "compiled_at": "2026-10-05T16:04:27Z", + "children_root": "sha256:a66a2b519c9bfbaea8225c349d1cdbdefcdbfb79f4bbc39277d952b7143a98e8", + "compiled_at": "2026-10-05T16:36:21Z", "compiler": "crumb-compile/1", - "digest": "sha256:43dd39270ced0e0209a37d3b7d37376581f4d54f1e436662472c232c08f1c633", + "digest": "sha256:1987becea7850243107a1e552c1a279bc4fca82a7a94c7b2b4c540cdf06fee35", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 133, - "generated_at_commit": "82d9dc09c6c3a673409daf32fb69c70be8bf9850", - "source_tree": "sha256:404eefcebb1075edffd1235fc2d5dd79fdb89773605c22a3aa08dab826e2ceb9" + "generated_at_commit": "c847a167bdaeb6e2dc997a46c37057639bb39412", + "source_tree": "sha256:a1b365dbfedc41fbe312faada3f1050ba68a85bd14460b315d0c8501f732ce2a" }, "owner_lane": "", "provenance": { diff --git a/tools/estimation/.crumb b/tools/estimation/.crumb index 731a09f64..843ea8cdd 100644 --- a/tools/estimation/.crumb +++ b/tools/estimation/.crumb @@ -7,14 +7,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-05T14:17:17Z", + "compiled_at": "2026-10-05T14:59:30Z", "compiler": "crumb-compile/1", - "digest": "sha256:d4a6875be9942403548ed74e5f75e57bfe5824237dc985ae51813f42230d6134", + "digest": "sha256:38788064b345d8de8180cf536f5ad4419044db9efe9e7d7645fe83ba77740769", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 29, - "generated_at_commit": "2275438a645b03cc09c37d51f104fbb8283046f4", - "source_tree": "sha256:a2218268e4b412fa6bf0f0853871fb3335db5d0ee11976f87c8c1eaef3914724" + "generated_at_commit": "a386d65ed193a02dccac444de3fd3224c96162b4", + "source_tree": "sha256:08afcc137381f31ec3c4e0c9a6c733d4ac21b6569b2a2c9571a935bf554f6df1" }, "owner_lane": "", "provenance": { diff --git a/tools/estimation/est6dev.c b/tools/estimation/est6dev.c index 603de5b40..1a80fc444 100644 --- a/tools/estimation/est6dev.c +++ b/tools/estimation/est6dev.c @@ -106,6 +106,118 @@ static int cmd_pick(int argc, char **argv) return 1; } + +/* ------------------------------------------------------------ schedule rule SR-1 (domain separated) + * est-v6 section 3 as proposed chains "seed + 1" from each declared seed, which sends H1 (0xD6E6C7) and + * H2 (0xD6E6C8) to the same seed 0xD6E6CB (appendix section 3). Rule SR-1 removes that: + * base(label, declared) = splitmix64 output of the state declared XOR fnv1a64("est6-sched-v1/" label) + * candidate k = base + k (k = 0, 1, 2, ...) + * effective seed = first candidate whose est_load schedule passes the balance rule, k <= SR1_MAXK + * The label is part of the derivation input, so two labels never share a chain. The balance rule is a + * property of the schedule alone (no data); the search is bounded and fails closed. A plan with two + * identical schedules (or seeds) is refused, never repaired by further search. */ +#define SR1_MAXK 255 +#define SEGMAX 4096 +typedef struct { int level[SEGMAX]; long dur[SEGMAX]; int n; long lv[4]; long total; } sched_t; + +static uint64_t fnv1a64(const char *s) +{ + uint64_t h = 0xcbf29ce484222325ull; + for (; *s; s++) { h ^= (unsigned char)*s; h *= 0x100000001b3ull; } + return h; +} + +static void gen_sched(uint64_t seed, long total, sched_t *o) +{ + static const int levels[4] = { 0, 6, 12, 18 }; + uint64_t s = seed; long acc = 0; + memset(o, 0, sizeof *o); + while (acc < total && o->n < SEGMAX) { + int li = (int)(splitmix64(&s) % 4u); + long d = 20 + (long)(splitmix64(&s) % 101u); + if (acc + d > total) d = total - acc; + o->level[o->n] = levels[li]; o->dur[o->n] = d; o->lv[li] += d; acc += d; o->n++; + } + o->total = acc; +} + +/* required properties: segments sum to the run length; every segment is 20..120 s except a clipped last + * one (1..120); each of idle, L6, L12, L18 totals 400..900 s */ +static int sched_props(const sched_t *o, long total, int *balanced) +{ + long sum = 0; int ok = 1; + for (int i = 0; i < o->n; i++) { + sum += o->dur[i]; + if (o->dur[i] > 120 || o->dur[i] < 1) ok = 0; + if (o->dur[i] < 20 && i != o->n - 1) ok = 0; + } + if (sum != total || o->n >= SEGMAX) ok = 0; + *balanced = 1; + for (int i = 0; i < 4; i++) if (o->lv[i] < 400 || o->lv[i] > 900) *balanced = 0; + return ok; +} + +static uint64_t sr1_base(const char *label, uint64_t declared) +{ + char buf[128 + 32]; + snprintf(buf, sizeof buf, "est6-sched-v1/%.100s", label); + uint64_t st = declared ^ fnv1a64(buf); + return splitmix64(&st); +} + +/* rule 0 = old (v6 proposal: declared + k), rule 1 = SR-1. Returns k or -1. */ +static int sr_pick(int rule, const char *label, uint64_t declared, long total, uint64_t *eff, sched_t *o) +{ + uint64_t base = rule ? sr1_base(label, declared) : declared; + for (int k = 0; k <= (rule ? SR1_MAXK : 100000); k++) { + int bal; + gen_sched(base + (uint64_t)k, total, o); + if (sched_props(o, total, &bal) && bal) { *eff = base + (uint64_t)k; return k; } + } + return -1; +} + +static int same_sched(const sched_t *a, const sched_t *b) +{ + if (a->n != b->n) return 0; + for (int i = 0; i < a->n; i++) if (a->level[i] != b->level[i] || a->dur[i] != b->dur[i]) return 0; + return 1; +} + +/* est6dev plan6 [--rule old|sr1] <seconds> <label>=<declared seed> ... */ +static int cmd_plan6(int argc, char **argv) +{ + int rule = 1; + if (argc >= 2 && !strcmp(argv[0], "--rule")) { + if (!strcmp(argv[1], "old")) rule = 0; else if (!strcmp(argv[1], "sr1")) rule = 1; else { fprintf(stderr, "rule must be old or sr1\n"); return 2; } + argc -= 2; argv += 2; + } + if (argc < 2) { fprintf(stderr, "usage: est6dev plan6 [--rule old|sr1] <seconds> <label>=<seed> ...\n"); return 2; } + long total = strtol(argv[0], NULL, 10); + if (total <= 0) { fprintf(stderr, "seconds must be > 0\n"); return 2; } + int np = argc - 1; + static sched_t sc[16]; uint64_t eff[16]; char lab[16][64]; + if (np > 16) return 2; + printf("rule %s seconds %ld\n", rule ? "SR-1" : "OLD(seed+1)", total); + for (int i = 0; i < np; i++) { + char *eq = strchr(argv[1 + i], '='); + if (!eq || eq - argv[1 + i] >= 63) { fprintf(stderr, "bad plan item %s\n", argv[1 + i]); return 2; } + memcpy(lab[i], argv[1 + i], (size_t)(eq - argv[1 + i])); lab[i][eq - argv[1 + i]] = 0; + uint64_t decl = strtoull(eq + 1, NULL, 0); + int k = sr_pick(rule, lab[i], decl, total, &eff[i], &sc[i]); + if (k < 0) { printf("label %s declared 0x%llx NO_PASSING_SEED\n", lab[i], (unsigned long long)decl); return 1; } + printf("label %s declared 0x%llx effective 0x%llx k %d segments %d idle %ld L6 %ld L12 %ld L18 %ld balance PASS\n", + lab[i], (unsigned long long)decl, (unsigned long long)eff[i], k, sc[i].n, sc[i].lv[0], sc[i].lv[1], sc[i].lv[2], sc[i].lv[3]); + for (int j = 0; j < sc[i].n; j++) printf("schedule %s %d %d %ld\n", lab[i], j, sc[i].level[j], sc[i].dur[j]); + } + int bad = 0; + for (int i = 0; i < np; i++) for (int j = i + 1; j < np; j++) + if (eff[i] == eff[j] || same_sched(&sc[i], &sc[j])) { printf("COLLISION %s %s effective 0x%llx\n", lab[i], lab[j], (unsigned long long)eff[i]); bad = 1; } + if (bad) return 1; + printf("distinct PASS\n"); + return 0; +} + /* ------------------------------------------------------------ one-step G1 PIT trace */ typedef struct { int64_t t; double flo, fhi, z; } step_t; @@ -493,11 +605,12 @@ static int cmd_g1s(int argc, char **argv) int main(int argc, char **argv) { - if (argc < 2) { fprintf(stderr, "usage: est6dev g1pit|g1s|sched|pick ...\n"); return 2; } + if (argc < 2) { fprintf(stderr, "usage: est6dev g1pit|g1s|sched|pick|plan6 ...\n"); return 2; } if (!strcmp(argv[1], "g1pit")) return cmd_g1pit(argc - 2, argv + 2); if (!strcmp(argv[1], "sched")) return cmd_sched(argc - 2, argv + 2); if (!strcmp(argv[1], "pick")) return cmd_pick(argc - 2, argv + 2); + if (!strcmp(argv[1], "plan6")) return cmd_plan6(argc - 2, argv + 2); if (!strcmp(argv[1], "g1s")) return cmd_g1s(argc - 2, argv + 2); - fprintf(stderr, "usage: est6dev g1pit|g1s|sched|pick ...\n"); + fprintf(stderr, "usage: est6dev g1pit|g1s|sched|pick|plan6 ...\n"); return 2; } diff --git a/tools/estimation/test_est6dev.sh b/tools/estimation/test_est6dev.sh index cde6fb8d3..0c8714c53 100755 --- a/tools/estimation/test_est6dev.sh +++ b/tools/estimation/test_est6dev.sh @@ -7,7 +7,8 @@ E=${1:?est6dev binary} O=${2:?est6opchar binary} D1=evidence/EST5/raw/20261001T153156Z-est5-fit-silicon fail=0 -chk() { if [ "$1" = ok ]; then :; else echo "FAIL $2"; fail=1; fi; } +n=0 +chk() { n=$((n+1)); if [ "$1" = ok ]; then :; else echo "FAIL $2"; fail=1; fi; } # 1. held-out refusals (path tags and the v5 D2 date tag), exit status 2, nothing opened for p in evidence/EST5/raw/20261005T112838Z-est5-heldout-silicon evidence/X/raw/zz-est6-heldout-silicon evidence/EST3C/raw/zz-est3c-heldout-q; do @@ -39,6 +40,33 @@ rm -f "${TMPDIR:-/tmp}/e6dev.sched.$$" "$E" sched 0xE5C5D1 2700 | grep -q '^balance FAIL$' && chk ok x || chk bad "balance FAIL expected" "$E" pick 0xE6C6D1 2700 | grep -q '^picked 0xe6c6d3 after 2 failures$' && chk ok x || chk bad "pick 0xE6C6D1" + +# 2b. schedule rule SR-1 (domain separated by run label) against the old chained rule +PLAN="2700 F=0xE6C6D1 H1=0xD6E6C7 H2=0xD6E6C8" +T6=${TMPDIR:-/tmp}/e6dev.plan.$$ +# RED: the old rule (seed + 1 chain) sends H1 and H2 to the same seed and schedule; the plan tool refuses it +rc=0; "$E" plan6 --rule old $PLAN > $T6.old || rc=$? +[ "$rc" = 1 ] && grep -q '^COLLISION H1 H2 effective 0xd6e6cb$' $T6.old && chk ok x || chk bad "old rule must reproduce the H1/H2 collision at 0xd6e6cb (rc $rc)" +grep '^label H1 ' $T6.old | grep -q 'segments 41 idle 522 L6 572 L12 857 L18 749' && chk ok x || chk bad "old rule H1 schedule totals" +# GREEN: SR-1 gives distinct effective seeds and distinct schedules +rc=0; "$E" plan6 $PLAN > $T6.a || rc=$? +[ "$rc" = 0 ] && grep -q '^distinct PASS$' $T6.a && chk ok x || chk bad "SR-1 plan not distinct (rc $rc)" +h1=$(grep '^schedule H1 ' $T6.a | cut -d' ' -f3-); h2=$(grep '^schedule H2 ' $T6.a | cut -d' ' -f3-) +[ -n "$h1" ] && [ -n "$h2" ] && [ "$h1" != "$h2" ] && chk ok x || chk bad "SR-1 H1 and H2 schedules equal" +e1=$(grep '^label H1 ' $T6.a | cut -d' ' -f6); e2=$(grep '^label H2 ' $T6.a | cut -d' ' -f6) +[ "$e1" != "$e2" ] && chk ok x || chk bad "SR-1 H1 and H2 effective seeds equal" +# determinism: same input, same output, and a label's schedule does not depend on the other labels in the plan +"$E" plan6 $PLAN > $T6.b; cmp -s $T6.a $T6.b && chk ok x || chk bad "SR-1 plan not deterministic" +"$E" plan6 2700 H2=0xD6E6C8 | grep '^schedule H2 ' > $T6.c +grep '^schedule H2 ' $T6.a | cmp -s - $T6.c && chk ok x || chk bad "SR-1 H2 schedule depends on the other labels in the plan" +"$E" plan6 2700 A=0xD6E6C7 B=0xD6E6C7 | grep -q '^distinct PASS$' && chk ok x || chk bad "domain separation: same declared seed, two labels" +# balance and structure properties hold for every label (totals sum to 2700, each level 400..900, segments 20..120 but a clipped last) +for L in F H1 H2; do + grep "^label $L " $T6.a | grep -q 'balance PASS' && chk ok x || chk bad "balance $L" + grep "^schedule $L " $T6.a | awk '{ d[NR]=$5; lv[$4]+=$5; s+=$5 } END { ok=(s==2700); for (i=1;i<=NR;i++) { if (d[i]>120 || d[i]<1) ok=0; if (d[i]<20 && i<NR) ok=0 } for (k in lv) if (lv[k]<400 || lv[k]>900) ok=0; exit ok?0:1 }' && chk ok x || chk bad "structure $L (sum 2700, levels 400..900, segments 20..120, last may be clipped)" +done +rm -f $T6.old $T6.a $T6.b $T6.c + # 3. G1 on v5 D1 with the v5 parameters reproduces params.txt (n 2652, bin0 0.075981, cov95 0.952950, mean z 0.046045) out=$("$E" g1pit --raw $D1/machine-state.ndjson --marks $D1/machine-state-marks.txt --dyn 1 --q 10000 --lam 0.1 --nu 1.25 --c 0.7 --boot 200) echo "$out" | grep -q '^n_scored 2652 unscorable 0$' && chk ok x || chk bad "n_scored" @@ -57,4 +85,4 @@ out2=$("$E" g1pit --raw $D1/machine-state.ndjson --marks $D1/machine-state-marks a=$("$O" run --case a --reps 50 --boot 300) ; b=$("$O" run --case a --reps 50 --boot 300) [ "$a" = "$b" ] && chk ok x || chk bad "est6opchar not deterministic" -if [ "$fail" = 0 ]; then echo "test-est6dev: PASS"; else exit 1; fi +if [ "$fail" = 0 ]; then echo "test-est6dev: PASS ($n checks)"; else exit 1; fi