From c847a167bdaeb6e2dc997a46c37057639bb39412 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Mon, 5 Oct 2026 09:59:41 -0500 Subject: [PATCH 1/2] estimation v6 pre-freeze: schedule rule SR-1 (domain separated by run label) fixes the H1/H2 seed collision, with tests (v6 stays NOT FROZEN) The v6 proposal chains 'seed + 1' from each declared seed, which sends H1 (0xD6E6C7) and H2 (0xD6E6C8) to the same seed 0xD6E6CB. est6dev plan6 derives each schedule from (run label, declared seed), refuses plans with equal seeds or schedules, and keeps the balance rule as a schedule-only check. Tests reproduce the old collision and pass on SR-1. No D2 data, no v5 receipt or tool touched. Co-Authored-By: Claude Opus 5.5 --- docs/.crumb | 14 +-- docs/estimation/.crumb | 8 +- .../protocols/est-v6-appendix-prefreeze.md | 46 +++++++ tools/estimation/.crumb | 8 +- tools/estimation/est6dev.c | 117 +++++++++++++++++- tools/estimation/test_est6dev.sh | 32 ++++- 6 files changed, 206 insertions(+), 19 deletions(-) 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/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]