From 5f188399211013bc60aeff9577f5ffd0798efb36 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Sun, 4 Oct 2026 13:11:14 -0500 Subject: [PATCH 1/3] dual_experiment: DUAL applicability experiment (ARCH-0031 offline lane): discrete workload simulator, aggregate predictor, heterogeneity analysis Standalone, experiment-only module answering: when is aggregate (macroscopic) load control predictive, and when must discrete per-item scheduling dominate? New files only: src/dual_experiment/ (pure C11 library: seeded simulator with exact ledger, flow-balance aggregate predictor, heterogeneity measurements, campaign, digests), tools/dual_experiment/applic_run.c (writes CSV + Markdown), tests/dual_experiment/test_applic.c, mk/dual_applicability.mk (not in all or test), docs/dual/APPLICABILITY_EXPERIMENT.md, evidence/DUAL/applicability/ (results.csv, params.txt, results.md). Nothing in src/runtime touched; does not depend on src/dual. Eight pre-registered workloads x 24 seeds (192 runs), parameters digest-bound (e489d25f...87ecea, pinned in the test), results digest 912fb51b...b0c45a, identical in plain and ASan/UBSan builds. Shuffled-window control worse in 192/192 runs; constant metric covariance exactly 0. Throughput error correlates with service-demand CV (+0.70 overall, +0.88 in the sweep) and top-5% load share (+0.69 / +0.90); temporal change is a forecasting problem, not an aggregation problem; blocked fraction is not predictable from aggregates short of sustained overload. Regime rule stated as PROPOSAL only, inserted nowhere. Verdict: EXPERIMENTAL; recommends future regime classifier; nothing inserted into production. Co-authored-by: Drake Stapleton Co-Authored-By: Claude Fable 5.1 --- .crumb | 34 ++-- docs/.crumb | 18 +- docs/dual/.crumb | 19 ++ docs/dual/APPLICABILITY_EXPERIMENT.md | 110 +++++++++++ evidence/DUAL/applicability/params.txt | 46 +++++ evidence/DUAL/applicability/results.csv | 193 +++++++++++++++++++ evidence/DUAL/applicability/results.md | 98 ++++++++++ mk/.crumb | 10 +- mk/dual_applicability.mk | 53 ++++++ src/.crumb | 18 +- src/dual_experiment/.crumb | 19 ++ src/dual_experiment/applic.h | 129 +++++++++++++ src/dual_experiment/applic_metrics.c | 211 +++++++++++++++++++++ src/dual_experiment/applic_params.h | 86 +++++++++ src/dual_experiment/applic_predict.c | 94 ++++++++++ src/dual_experiment/applic_sim.c | 231 +++++++++++++++++++++++ tests/.crumb | 18 +- tests/dual_experiment/.crumb | 19 ++ tests/dual_experiment/test_applic.c | 178 ++++++++++++++++++ tools/.crumb | 18 +- tools/dual_experiment/.crumb | 19 ++ tools/dual_experiment/applic_run.c | 238 ++++++++++++++++++++++++ 22 files changed, 1813 insertions(+), 46 deletions(-) create mode 100644 docs/dual/.crumb create mode 100644 docs/dual/APPLICABILITY_EXPERIMENT.md create mode 100644 evidence/DUAL/applicability/params.txt create mode 100644 evidence/DUAL/applicability/results.csv create mode 100644 evidence/DUAL/applicability/results.md create mode 100644 mk/dual_applicability.mk create mode 100644 src/dual_experiment/.crumb create mode 100644 src/dual_experiment/applic.h create mode 100644 src/dual_experiment/applic_metrics.c create mode 100644 src/dual_experiment/applic_params.h create mode 100644 src/dual_experiment/applic_predict.c create mode 100644 src/dual_experiment/applic_sim.c create mode 100644 tests/dual_experiment/.crumb create mode 100644 tests/dual_experiment/test_applic.c create mode 100644 tools/dual_experiment/.crumb create mode 100644 tools/dual_experiment/applic_run.c diff --git a/.crumb b/.crumb index 492355b59..97a2d30f7 100644 --- a/.crumb +++ b/.crumb @@ -51,8 +51,8 @@ "purpose": "Directory calibration. Purpose not yet described by a human." }, { - "digest": "1e31dff42b3f696c641f95733d670af27b72f77bd0e1708d42e3a879e9e45ffc", - "last_commit": "403ef98", + "digest": "e555caa4954d4dde3e499f37df8c9af2efc41cf349dc8096273b0e062dd07a01", + "last_commit": "3bebcc6", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." }, @@ -63,8 +63,8 @@ "purpose": "Directory doctrine. Purpose not yet described by a human." }, { - "digest": "4bd9775399bb986340328ed1b843506e06ba0cd3126269518e85669c3b79417f", - "last_commit": "403ef98", + "digest": "322e59de081336c07865c29e4143728f3b25333ecd102f662a319074fca76f5c", + "last_commit": "3bebcc6", "name": "mk", "purpose": "Directory mk. Purpose not yet described by a human." }, @@ -87,33 +87,33 @@ "purpose": "Directory spec. Purpose not yet described by a human." }, { - "digest": "4507760d5412654a2c14457a0a900a76a54dd99729acb54d764925bc6dad4d2b", - "last_commit": "403ef98", + "digest": "0f3a63e432e9beed1a353d1570bc416f0bae07e99a45be15b0b885cbbedfb8ea", + "last_commit": "3bebcc6", "name": "src", "purpose": "Directory src. Purpose not yet described by a human." }, { - "digest": "3cf64120d367b0ec3b8cb61415ddc3ba7f8b42e04c79d3a0e958b7eb8eef1622", - "last_commit": "403ef98", + "digest": "e9bfa25f9d911bbcb636a73ecedea1df90b2a7e0ff9782fb43cf794d8aecdb4c", + "last_commit": "3bebcc6", "name": "tests", "purpose": "Directory tests. Purpose not yet described by a human." }, { - "digest": "0d55bd3147479cbeffdcff1c07f38b2b8899beac2b7cc1b23e67185eb220fd43", + "digest": "49be2149359521a3a0f87c12aa31e565c6575309bd099aff8daa216b25052ed6", "last_commit": "6b940fa", "name": "tools", "purpose": "Directory tools. Purpose not yet described by a human." } ], - "children_root": "sha256:53c927616046363118eba9033e24e3cf283edad7f5369da568c4bbe306afbfbd", - "compiled_at": "2026-10-04T18:24:30Z", + "children_root": "sha256:4494a74564f7c8c8c7041f9583c2fa9b03e0fb7039e275587528de1ec291f477", + "compiled_at": "2026-10-04T18:38:56Z", "compiler": "crumb-compile/1", - "digest": "sha256:70665ffd4eae02082919ea7e35a2a9d98f763259a987b743e70c4b4fe20b75aa", - "evidence_files": 1283, - "evidence_root": "sha256:faaf0962528d6ab359bd4702bafe3a263a8c79ab6fc8802c0ea45ed0390c8e05", - "files": 3026, - "generated_at_commit": "403ef98a510f61d77f77c2033ecc31de82d2fc85", - "source_tree": "sha256:ef319b183d3499cb4129cf5a2a05c4c60abfe1dcf0e7d3c16a5c287775f38d90" + "digest": "sha256:ecd61d0527659ceed69a18ec198dde90b9eadf83e06c80c4f510b59684a0746b", + "evidence_files": 1286, + "evidence_root": "sha256:8f489c4e8d82207d28c2c0d7665fdcbad06e88317c2d1f23d24a4731f10f25e0", + "files": 3038, + "generated_at_commit": "3bebcc68321fcc876b88df129f41d6190411a926", + "source_tree": "sha256:9e21b13beadf85bba23a066ace33941dd73a65b1e39070af0b952612bd92c501" }, "owner_lane": "", "provenance": { diff --git a/docs/.crumb b/docs/.crumb index b676081e1..7d2524369 100644 --- a/docs/.crumb +++ b/docs/.crumb @@ -68,6 +68,12 @@ "name": "crumbs", "purpose": "Directory docs/crumbs. Purpose not yet described by a human." }, + { + "digest": "854ab7030882cb50548bdff57507ba8998c474383487f8a0ec7c500388942c39", + "last_commit": "3bebcc6", + "name": "dual", + "purpose": "DUAL (ARCH-0031) documents in omega: applicability experiment method and findings (APPLICABILITY" + }, { "digest": "f6591139efe8ceba03c23a5dd78510b4d990fe0fcade7382082180c74d3faa3e", "last_commit": "85ca49a", @@ -111,15 +117,15 @@ "purpose": "Directory docs/turing. Purpose not yet described by a human." } ], - "children_root": "sha256:c250a1e7a18e576884d3bf007849954a7adbe0b0ab8d6e261303c62e67d8c34c", - "compiled_at": "2026-10-04T18:16:52Z", + "children_root": "sha256:8c5aa863d287effc2ff5df57b7f029cac75a1b0e7b5c71c9fd59c45e308a1e10", + "compiled_at": "2026-10-04T18:38:56Z", "compiler": "crumb-compile/1", - "digest": "sha256:1e31dff42b3f696c641f95733d670af27b72f77bd0e1708d42e3a879e9e45ffc", + "digest": "sha256:e555caa4954d4dde3e499f37df8c9af2efc41cf349dc8096273b0e062dd07a01", "evidence_files": 26, "evidence_root": "sha256:f58236184eadc5f8c8f95499127a9f43c2f4dc702ddca267853d8c3dee0690f1", - "files": 99, - "generated_at_commit": "41dcb768a955c1027d60d8b86d4ff6629118b9e6", - "source_tree": "sha256:4ed995ad9f9645169f2fbf1bbf513db9e0352b200eebfd674ad520d412805289" + "files": 100, + "generated_at_commit": "3bebcc68321fcc876b88df129f41d6190411a926", + "source_tree": "sha256:cdc21061ff898378059abf06f18c234da5dee85662b05f4c811fd79ac6db7fc0" }, "owner_lane": "", "provenance": { diff --git a/docs/dual/.crumb b/docs/dual/.crumb new file mode 100644 index 000000000..dfd9f2a01 --- /dev/null +++ b/docs/dual/.crumb @@ -0,0 +1,19 @@ +{ + "extensions": { + "generated": { + "children": [], + "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "compiled_at": "2026-10-04T18:38:56Z", + "compiler": "crumb-compile/1", + "digest": "sha256:854ab7030882cb50548bdff57507ba8998c474383487f8a0ec7c500388942c39", + "evidence_files": 0, + "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "files": 2, + "generated_at_commit": "3bebcc68321fcc876b88df129f41d6190411a926", + "source_tree": "sha256:b4f60491f7fce8800fc6c21c9ed83cc4bc6b98ed72bfd5536325f2d2245f0df0" + } + }, + "name": "dual", + "purpose": "DUAL (ARCH-0031) documents in omega: applicability experiment method and findings (APPLICABILITY_EXPERIMENT.md). Experimental; no production gate.", + "schema_version": "1.0.0" +} diff --git a/docs/dual/APPLICABILITY_EXPERIMENT.md b/docs/dual/APPLICABILITY_EXPERIMENT.md new file mode 100644 index 000000000..0596cc0fc --- /dev/null +++ b/docs/dual/APPLICABILITY_EXPERIMENT.md @@ -0,0 +1,110 @@ +# DUAL applicability experiment: when is aggregate load control predictive? + +**Status:** EXPERIMENTAL. Offline evidence lane of ADR 0031 (ARCH-0031, DUAL constraint pricing). Not a production gate, not a production classifier. Nothing in this experiment is linked by `src/runtime/` or read by any production path. It recommends a future regime classifier; it does not insert one. + +**Question.** DUAL prices scarcity from aggregate densities (used slots over capacity, used memory over budget, queue density, arrival and service rates). When does such a macroscopic view predict what a discrete scheduler will actually do next, and when does the identity of individual items dominate so that per-item scheduling must stay in charge? + +**Where things live.** Library `src/dual_experiment/` (simulator, aggregate predictor, measurements; pure: no I/O, no allocation, no globals, `nm -u` purity check against `EST_FORBIDDEN`), runner `tools/dual_experiment/applic_run.c` (writes CSV and Markdown), tests `tests/dual_experiment/test_applic.c`, make fragment `mk/dual_applicability.mk` (not in `all` or `test`), outputs `evidence/DUAL/applicability/`. Layout follows the estimation and ANS modules (`src/`, `tests/`, `tools/`, one `mk/*.mk`). The name `dual_experiment` is deliberate: the DUAL record module (`src/dual/`) is written in parallel and this experiment does not depend on it. + +## 1. Method + +### 1.1 Discrete workload simulator (exact outcome) + +Bounded pool of work items, each with a service demand (steps), a slot need, a memory need and a queue class (0 = highest priority). Fixed capacity: 32 slots, 1024 memory units, queue of 256 (overflow is REJECTED and ledgered), 4 classes. One step: arrivals; admission in class-then-FIFO order with backfill against slot and memory capacity; a step is **blocked** if work still waits after admission; one unit of service for every running item; completion frees slots and memory. The exact ledger `arrived = completed + queued + running + rejected` is checked after every step (test) and summed per window. + +Eight seeded workloads, 2000 steps each (100 windows of 20 steps, first 5 windows unscored): + +| id | workload | what changes | +|---|---|---| +| a | homogeneous high-fan-out | near-identical items (demand 11..13, 1 slot), Poisson 2.2/step, offered load about 0.82 | +| b | heterogeneous tool-heavy | log-normal demand (median 6, sigma 1.2, cap 400), slots 1/2/4, skewed memory and classes, Poisson 1.2/step | +| c | step load | a-items, rate 1.0 then 3.0 after step 1000 (sustained overload, rejections) | +| d | square-wave congestion | a-items, rate alternates 0.8 / 3.2 every 100 steps | +| e | bursty arrivals | a-items, burst of 15..35 items with probability 0.08 per step, else Poisson 0.4 | +| f | capacity reduction | a-items at 2.2/step, slot capacity 32 then 20 after step 1000 | +| g | regime change | a-items at 2.2/step, then b-items at 1.2/step after step 1000 | +| h | heterogeneity sweep | b-family with sigma = 1.5 * seed_index / 23, arrival rate set so offered load stays 0.80 | + +24 seeds per workload (192 runs). Every constant is in `src/dual_experiment/applic_params.h`; `ap_params_text()` renders them canonically and SHA-256 of that text is the **parameter digest**, pinned in the test and written into every results file. Changing a parameter breaks the pin on purpose: that is a new experiment version, not a rescoring. + +### 1.2 Aggregate predictor (flow balance v2) + +The predictor sees one window record only (densities, counts in system, last window's arrival count, running means of demand, slots and memory over completed items). It never sees the item list. + +```text +resident_cap = min(slots / mean_slots, memory / mean_mem) +cap_W = resident_cap * W / mean_demand +frac = min(1, W / mean_demand) +completions = min(cap_W, running*frac + queue*frac + A * max(0, W - mean_demand) / W) +in_next = in_system + A - completions +queue = max(0, in_next - resident_cap) / queue_max +blocked = clamp((in_next / resident_cap - 0.75) / 0.25, 0, 1) +``` + +`A` is the arrival forecast. Three variants are scored: **real** (A = last window's count), **known arrivals** (A = next window's true count; still aggregate-only, isolates aggregation error from forecast error) and **shuffled** (record taken from a different window; negative control). + +Error per run: completions NRMSE (RMSE over scored windows divided by the mean actual completions per window; **primary measure**), queue-density RMSE and blocked-fraction RMSE (both already in [0, 1]), and their mean (composite). + +A first draft of the predictor (v1) counted items already running as newly offered work and therefore always predicted full capacity and full blocking. It was replaced before any result was recorded; no v1 number appears anywhere. + +### 1.3 Heterogeneity measurements + +Per run, on the realized item list: coefficient of variation of service demand (`cv_demand`); load share of the top ceil(5 %) items by load, load = demand * slots (`top5_share`); load share of the single largest item (`max_item_share`); normalized Shannon entropy of the class mix (`class_entropy`); and the coefficient of variation of per-window arrival counts (`arrival_cv`, temporal heterogeneity, added so time-varying load can be told apart from item heterogeneity). Two deliberately broken "measurements" are carried as negative controls: a constant (0.5) and seeded noise independent of the run. + +### 1.4 Tests (`make test-dual-applicability`) + +Purity (`nm -u` on every library object against `EST_FORBIDDEN`); determinism (same seed gives byte-identical windows, items and campaign results digest; a different seed gives a different digest); ledger at every step for every workload and three seeds, plus the window sums and capacity bounds, plus a hostile corrupted-ledger check; predictor finite and bounded on every window of every workload; shuffled control worse than real in the majority of runs; constant metric has exactly zero covariance; parameter digest equals the pin; plain and ASan/UBSan builds. + +## 2. Results (parameter digest `e489d25f...87ecea`, results digest `912fb51b...b0c45a`, full tables in `evidence/DUAL/applicability/results.md`) + +Primary measure, completions NRMSE, mean over 24 seeds (known-arrivals variant in parentheses): + +| workload | completions NRMSE | blocked RMSE | cv_demand | top5 share | +|---|---|---|---|---| +| a homogeneous | 0.110 (0.078) | 0.391 | 0.07 | 0.05 | +| b heterogeneous | 0.220 (0.158) | 0.275 | 1.70 | 0.37 | +| c step | 0.099 (0.069) | 0.061 | 0.07 | 0.05 | +| d square wave | 0.174 (0.068) | 0.217 | 0.07 | 0.05 | +| e bursty | 0.171 (0.136) | 0.320 | 0.07 | 0.05 | +| f capacity drop | 0.100 (0.074) | 0.277 | 0.07 | 0.05 | +| g regime change | 0.151 (0.108) | 0.312 | 1.01 | 0.27 | +| h sweep (mean) | 0.197 (0.122) | 0.253 | 0.97 | 0.27 | + +Correlations over all 192 runs (Pearson r with completions NRMSE): cv_demand +0.70, top5_share +0.69, max_item_share +0.61, class_entropy -0.67, arrival_cv +0.07; constant control 0 (zero covariance), noise control +0.10. Within the sweep alone (one variable, constant offered load): r(cv_demand) = +0.88 real, +0.92 with arrivals known; r(top5_share) = +0.90 / +0.93. Throughput error rises monotonically from 0.17 (sigma 0) to 0.31 (sigma 1.5), and with arrivals known from 0.07 to 0.27, so the growth is aggregation error, not forecast noise. + +Negative controls: shuffled predictor worse than real in 192 / 192 runs (CONTROL PASS); constant metric covariance exactly 0 on every error axis. + +Regime grid (pre-registered thresholds, primary measure): runs with cv_demand < 0.8 and top5_share < 0.20 (129 runs): mean 0.133, p90 0.183, max 0.254. Complement cv >= 1.2 or top5_share >= 0.30 (37 runs): mean 0.218, p10 0.189, p90 0.256. Temporal complement arrival_cv >= 0.5 (71 runs): mean 0.148, p90 0.195. + +## 3. Reading the results + +1. **Throughput is where aggregate pressure is useful.** With near-identical items the aggregate flow model predicts next-window completions within about 11 % (8 % once the arrival count is known, which is close to the Poisson floor). Step load, capacity drop and even sustained overload stay near 10 %: the aggregate view handles changes in *how much* work arrives and *how much* capacity exists. +2. **Item heterogeneity is where it fails, and the failure is in the aggregation itself.** Error roughly doubles for the long-tailed family and grows monotonically with the spread of service demand even when arrivals are known exactly. The running mean demand is estimated from completions, so short items bias it low while a few long items hold slots the aggregate cannot see: concentration (top-5 % share) tracks the error as well as the coefficient of variation does. +3. **Time-varying load is a forecasting problem, not an aggregation problem.** Square wave and bursts carry large error with last-window arrivals (0.17) and small error with known arrivals (0.07, 0.14). `arrival_cv` is uncorrelated with throughput error overall and strongly correlated with queue error (+0.77). +4. **Waiting is not predictable from aggregates in any regime short of sustained overload.** Blocked-fraction RMSE is 0.2 to 0.4 everywhere except the step workload, where the system is saturated and blocking is trivially 1. Whether an arriving item waits a step is decided by discrete slot availability, which the flow model has no representation of. Any use of aggregate pressure for per-item admission or latency promises would be unsupported by this evidence. + +## 4. Candidate regime rule (PROPOSAL ONLY, inserted nowhere) + +```text +PROPOSED, NOT ADOPTED: + aggregate throughput prediction is usable (p90 NRMSE <= ~0.18) + when cv_demand < 0.8 AND top-5% load share < 0.20; + discrete per-item scheduling must dominate (p10 NRMSE >= ~0.19) + when cv_demand >= 1.2 OR top-5% load share >= 0.30; + the band between is a transition region, not a decision; + blocked / waiting fractions are out of scope for aggregate prediction in every regime + except sustained overload. +``` + +The thresholds come from the pre-registered grid, but the choice of which grid cell to quote was made after seeing the numbers; they are a hypothesis for a future, separately pre-registered regime classifier (DUAL-3 analysis, ADR 0031 §8), not a rule in any code path. A future classifier should take at least two inputs (an item-heterogeneity measure and a temporal-change measure) because the two failure modes here are different and need different remedies (better per-item representation versus better arrival forecasting). + +## 5. Limits + +- Synthetic workloads with pre-registered generators; **not qualified against any real trace** (no serving-scheduler trace, no J-Space residency series). Real workloads may be more or less heterogeneous than any family here. +- One admission policy (class-then-FIFO with backfill), one capacity shape, one predictor (a deliberately simple flow balance, not a tuned one). A better aggregate predictor would lower the absolute numbers; the claim is about the *trend* with heterogeneity, which the known-arrivals variant isolates. +- The sweep confounds spread with seed (one seed per sigma); the whole-campaign correlation and the per-workload seeds carry the replication. +- The regime thresholds are quoted after seeing the data (section 4) and the grid is coarse (3 x 3). +- The blocked-fraction heuristic (linear ramp from 75 % predicted occupancy) is pre-registered but arbitrary; its poor performance is a finding about the quantity, not a tuned verdict. +- No energy, no thermal state, no uncertainty bands: this experiment measures predictability of a discrete scheduler from aggregates, nothing about ADR 0031 prices themselves. + +Verdict: EXPERIMENTAL; recommends a future regime classifier; nothing inserted into production. diff --git a/evidence/DUAL/applicability/params.txt b/evidence/DUAL/applicability/params.txt new file mode 100644 index 000000000..815988042 --- /dev/null +++ b/evidence/DUAL/applicability/params.txt @@ -0,0 +1,46 @@ +experiment=DUAL-APPLIC-V1 +window=20 +windows=100 +warmup_windows=5 +slots=32 +memory=1024 +max_queue=256 +classes=4 +max_items=32768 +hom_demand=11..13 +hom_mem=16..24 +hom_slots=1 +het_ln_median=1.791759469228055 +het_sigma=1.2 +het_demand_cap=400 +het_slots_p=0.700000,0.900000 +het_mem_base=8 +het_mem_span=120.000000 +het_class_p=0.550000,0.800000,0.950000 +rate_hom=2.200000 +rate_het=1.200000 +step_rate=1.000000,3.000000 +square_rate=0.800000,3.200000 +square_half_period=100 +burst_p=0.080000 +burst_size=15..35 +burst_background=0.400000 +cap_drop_slots=20 +switch_step=1000 +sweep_sigma=0.000000..1.500000 +sweep_load=0.800000 +het_mean_slots=1.700000 +prior_demand=12.000000 +prior_slots=1.000000 +prior_mem=20.000000 +seeds=24 +seed_base=4455414c2d415031 +top_share_fraction=0.050000 +grid_cv=0.400000,0.800000,1.200000 +grid_top=0.100000,0.200000,0.300000 +grid_arrival_cv=0.500000 +broken_const=0.500000 +blocked_ramp_start=0.750000 +predictor=flow_balance_v2 +error=completions_nrmse,queue_rmse,blocked_rmse,composite_mean +primary_measure=completions_nrmse diff --git a/evidence/DUAL/applicability/results.csv b/evidence/DUAL/applicability/results.csv new file mode 100644 index 000000000..47be7c7f2 --- /dev/null +++ b/evidence/DUAL/applicability/results.csv @@ -0,0 +1,193 @@ +workload,seed_index,seed,arrived,completed,rejected,windows,err_completions_nrmse,err_queue_rmse,err_blocked_rmse,err_composite,known_completions_nrmse,known_queue_rmse,known_blocked_rmse,known_composite,shuf_completions_nrmse,shuf_queue_rmse,shuf_blocked_rmse,shuf_composite,cv_demand,top5_share,max_item_share,class_entropy,arrival_cv,broken_const,broken_noise +a_homogeneous,0,95e00b7efcd3bd32,4392,4367,0,94,0.116370,0.011017,0.390659,0.172682,0.080166,0.004422,0.329254,0.137947,0.214877,0.012783,0.464511,0.230724,0.068236,0.054206,0.000246,0.999763,0.153606,0.500000,0.872321 +a_homogeneous,1,e73fd5298e648a37,4513,4490,0,94,0.100365,0.011157,0.410039,0.173853,0.067611,0.004634,0.396946,0.156397,0.206559,0.012300,0.509901,0.242920,0.067855,0.054244,0.000240,0.999970,0.139497,0.500000,0.221372 +a_homogeneous,2,314a9fd459f99738,4338,4312,0,94,0.110008,0.009932,0.365179,0.161706,0.088059,0.005243,0.316482,0.136595,0.218059,0.012221,0.454779,0.228353,0.067978,0.054228,0.000250,0.999967,0.146005,0.500000,0.538998 +a_homogeneous,3,028069876b0ae43d,4418,4399,0,94,0.112274,0.019697,0.388130,0.173367,0.077359,0.007126,0.337720,0.140735,0.230271,0.019934,0.501602,0.250602,0.068464,0.054200,0.000245,0.999954,0.175426,0.500000,0.748433 +a_homogeneous,4,5cdf33b23a9ff13e,4496,4461,0,94,0.102414,0.011890,0.361708,0.158671,0.078067,0.008285,0.377051,0.154468,0.220744,0.015429,0.472422,0.236198,0.067123,0.054180,0.000241,0.999263,0.146896,0.500000,0.175202 +a_homogeneous,5,ae6afc7cc430de23,4328,4306,0,94,0.108687,0.009110,0.354183,0.157327,0.077928,0.002309,0.333858,0.138032,0.239177,0.011477,0.436722,0.229126,0.068821,0.054474,0.000251,0.999760,0.157933,0.500000,0.859170 +a_homogeneous,6,ffa0462f96452b24,4406,4384,0,94,0.112344,0.009326,0.401053,0.174241,0.082023,0.003432,0.358798,0.148084,0.212648,0.009129,0.424939,0.215572,0.067930,0.054327,0.000246,0.999878,0.138199,0.500000,0.048803 +a_homogeneous,7,c9ff10daa1d63829,4372,4338,0,94,0.113097,0.007071,0.368211,0.162793,0.075805,0.004739,0.324904,0.135149,0.226364,0.007260,0.467118,0.233580,0.067256,0.054264,0.000248,0.999828,0.150790,0.500000,0.797596 +a_homogeneous,8,1b0ada85736b052a,4444,4417,0,94,0.100700,0.016799,0.376752,0.164750,0.073324,0.004334,0.318931,0.132196,0.195283,0.018773,0.437960,0.217339,0.067564,0.054383,0.000244,0.999799,0.144692,0.500000,0.133540 +a_homogeneous,9,7541a4b002fc122f,4389,4366,0,94,0.110426,0.006109,0.383611,0.166715,0.076064,0.004378,0.365492,0.148645,0.171738,0.006895,0.428430,0.202354,0.068282,0.054243,0.000247,0.999764,0.138475,0.500000,0.390593 +a_homogeneous,10,469f71632c117f10,4508,4473,0,94,0.106359,0.008818,0.424853,0.180010,0.070137,0.006222,0.371078,0.149145,0.186359,0.013100,0.515019,0.238159,0.067862,0.054356,0.000241,0.999336,0.151776,0.500000,0.954661 +a_homogeneous,11,902a3b2dffa24c15,4417,4399,0,94,0.106426,0.006478,0.412982,0.175295,0.085755,0.003798,0.377833,0.155795,0.218172,0.006525,0.457355,0.227351,0.068108,0.054189,0.000245,0.999836,0.128032,0.500000,0.532943 +a_homogeneous,12,e26185d889375916,4397,4377,0,94,0.109441,0.010388,0.411441,0.177090,0.076575,0.004898,0.377142,0.152872,0.229656,0.010570,0.511886,0.250704,0.067883,0.054143,0.000246,0.999986,0.149704,0.500000,0.692166 +a_homogeneous,13,33bf4f8b5b49a61b,4465,4440,0,94,0.124193,0.006855,0.420030,0.183693,0.078350,0.005115,0.364573,0.149346,0.226394,0.006927,0.541279,0.258200,0.068630,0.054391,0.000243,0.999858,0.162690,0.500000,0.870471 +a_homogeneous,14,0dca19b66adab31c,4387,4369,0,94,0.105359,0.013867,0.379430,0.166218,0.073654,0.005746,0.347084,0.142162,0.233936,0.013699,0.489482,0.245706,0.068572,0.054361,0.000247,0.999661,0.158964,0.500000,0.593192 +a_homogeneous,15,5f01e261346f8001,4418,4394,0,94,0.114525,0.008088,0.380430,0.167681,0.080277,0.004788,0.360291,0.148452,0.231383,0.007781,0.492707,0.243957,0.067940,0.054153,0.000245,0.999909,0.158972,0.500000,0.253592 +a_homogeneous,16,a95cac13c780ed02,4329,4309,0,94,0.117310,0.011069,0.399015,0.175798,0.081406,0.006737,0.347789,0.145311,0.202690,0.010851,0.455707,0.223083,0.067705,0.054319,0.000250,0.999555,0.151135,0.500000,0.890917 +a_homogeneous,17,faea76de9115fa07,4334,4306,0,94,0.105220,0.009397,0.377394,0.164004,0.082371,0.006954,0.366133,0.151820,0.209240,0.008940,0.449655,0.222612,0.068379,0.054283,0.000250,0.999915,0.136707,0.500000,0.050456 +a_homogeneous,18,d421c089a0a6c708,4251,4235,0,94,0.111663,0.004129,0.388849,0.168214,0.073948,0.002783,0.329381,0.135371,0.233032,0.004113,0.421880,0.219675,0.067885,0.054254,0.000255,0.999891,0.152941,0.500000,0.961341 +a_homogeneous,19,267c8ab4723bd40d,4396,4376,0,94,0.116417,0.006196,0.391494,0.171369,0.084544,0.003464,0.392493,0.160167,0.233454,0.006839,0.497387,0.245893,0.068138,0.054235,0.000247,0.999765,0.141181,0.500000,0.390859 +a_homogeneous,20,778a57671c4c210e,4470,4448,0,94,0.091918,0.010955,0.370787,0.157887,0.072258,0.004532,0.320253,0.132348,0.164392,0.010368,0.434010,0.202923,0.067064,0.054222,0.000242,0.999866,0.124900,0.500000,0.413870 +a_homogeneous,21,41c121122fe10e73,4385,4365,0,94,0.117689,0.007575,0.422557,0.182607,0.077156,0.004980,0.355823,0.145986,0.186283,0.006775,0.445118,0.212725,0.068343,0.054320,0.000247,0.999869,0.130742,0.500000,0.726240 +a_homogeneous,22,931cebdcf9721b74,4352,4328,0,94,0.112578,0.004150,0.404382,0.173703,0.079938,0.003216,0.357913,0.147022,0.230521,0.004150,0.488854,0.241175,0.067733,0.054172,0.000248,0.999519,0.145560,0.500000,0.277093 +a_homogeneous,23,ecabb58f88876879,4429,4399,0,94,0.118610,0.005461,0.400379,0.174817,0.081573,0.002909,0.377522,0.154001,0.195865,0.005411,0.453583,0.218286,0.067651,0.054330,0.000245,0.999830,0.132013,0.500000,0.680442 +b_heterogeneous,0,0bd772c78399c127,2395,2387,0,94,0.197723,0.002779,0.299870,0.166791,0.136702,0.002705,0.288351,0.142586,0.315184,0.002779,0.322715,0.213559,1.664306,0.374992,0.022908,0.806247,0.212195,0.500000,0.001720 +b_heterogeneous,1,7908ac90f12ef622,2390,2379,0,94,0.248837,0.002933,0.209911,0.153894,0.175056,0.002933,0.222228,0.133406,0.315432,0.002933,0.265735,0.194700,1.664826,0.372545,0.028446,0.810165,0.203047,0.500000,0.271507 +b_heterogeneous,2,af7de66d26b3eb2d,2386,2373,0,94,0.233385,0.007097,0.244247,0.161576,0.165705,0.006217,0.203184,0.125035,0.315650,0.008156,0.339026,0.220944,1.654804,0.372483,0.012965,0.806296,0.199069,0.500000,0.306908 +b_heterogeneous,3,9cb7103e14409828,2424,2409,0,94,0.199783,0.003843,0.275156,0.159594,0.137189,0.003843,0.286360,0.142464,0.326383,0.003843,0.339089,0.223105,1.648882,0.366542,0.012246,0.804736,0.208496,0.500000,0.000966 +b_heterogeneous,4,c2e84a0b45d58d2b,2326,2308,0,94,0.237211,0.007381,0.270589,0.171727,0.171797,0.008078,0.295231,0.158369,0.348848,0.008180,0.363746,0.240258,1.614516,0.348771,0.012590,0.802855,0.218849,0.500000,0.829421 +b_heterogeneous,5,305d85c5bb7aa236,2326,2312,0,94,0.203825,0.003442,0.215856,0.141041,0.129268,0.003049,0.216065,0.116127,0.267522,0.003442,0.256141,0.175702,1.628260,0.353137,0.013012,0.805496,0.191267,0.500000,0.625678 +b_heterogeneous,6,61973f96e90f5731,2330,2319,0,94,0.218097,0.003669,0.217198,0.146321,0.143809,0.003648,0.255228,0.134229,0.299489,0.003669,0.279474,0.194211,1.543830,0.355703,0.020627,0.784463,0.214378,0.500000,0.291099 +b_heterogeneous,7,57c86963de9c443c,2339,2329,0,94,0.198568,0.007711,0.289797,0.165359,0.148597,0.006798,0.238933,0.131442,0.323009,0.008111,0.336607,0.222576,1.663378,0.383873,0.036518,0.807903,0.197027,0.500000,0.092842 +b_heterogeneous,8,853da33c0c21793f,2399,2384,0,94,0.218646,0.004148,0.244131,0.155642,0.143600,0.004148,0.217582,0.121777,0.274988,0.004148,0.269588,0.182908,1.636963,0.364098,0.015356,0.800429,0.190610,0.500000,0.539942 +b_heterogeneous,9,eb76dd097db66e3a,2420,2408,0,94,0.212475,0.001802,0.153295,0.122524,0.132779,0.001802,0.186697,0.107093,0.261128,0.001802,0.197517,0.153482,1.535568,0.355412,0.019838,0.796809,0.199891,0.500000,0.002061 +b_heterogeneous,10,d8a808da535b0305,2364,2353,0,94,0.220510,0.005365,0.251991,0.159288,0.161490,0.004967,0.256126,0.140861,0.294537,0.005365,0.311440,0.203780,1.615642,0.357807,0.013608,0.803306,0.220334,0.500000,0.269595 +b_heterogeneous,11,0e1d429480e83000,2447,2429,0,94,0.279706,0.019808,0.427994,0.242503,0.254276,0.020119,0.459391,0.244595,0.323824,0.033107,0.546890,0.301274,1.794084,0.402716,0.032479,0.793220,0.193109,0.500000,0.827939 +b_heterogeneous,12,7c56fc61f67d2503,2408,2398,0,94,0.226188,0.005487,0.299263,0.176979,0.157526,0.005243,0.310654,0.157807,0.287430,0.005487,0.320577,0.204498,1.747100,0.387902,0.014346,0.800501,0.202825,0.500000,0.393713 +b_heterogeneous,13,ad8836322403da0e,2336,2315,0,94,0.239551,0.009413,0.303944,0.184303,0.184581,0.008935,0.277688,0.157068,0.322406,0.009546,0.356283,0.229412,1.819338,0.370996,0.022556,0.798687,0.221242,0.500000,0.654933 +b_heterogeneous,14,93fd600f1590cf09,2377,2365,0,94,0.194336,0.005297,0.272085,0.157239,0.134371,0.004532,0.290832,0.143245,0.318784,0.005297,0.346127,0.223403,1.927826,0.391852,0.034989,0.821328,0.201220,0.500000,0.506148 +b_heterogeneous,15,c1369bd84b25fc14,2500,2491,0,94,0.233438,0.007869,0.422709,0.221339,0.162274,0.007450,0.416011,0.195245,0.296764,0.007952,0.409660,0.238125,1.799911,0.384791,0.029758,0.822417,0.214737,0.500000,0.963049 +b_heterogeneous,16,376bd5aab8ca9117,2382,2369,0,94,0.202436,0.006183,0.342403,0.183674,0.158238,0.005747,0.314214,0.159400,0.313624,0.006201,0.387026,0.235617,1.935086,0.397373,0.016383,0.798812,0.176859,0.500000,0.687193 +b_heterogeneous,17,64dd0f67ee5f8612,2457,2442,0,94,0.222126,0.010177,0.323514,0.185272,0.183325,0.010156,0.327702,0.173728,0.286341,0.013465,0.411564,0.237123,1.816453,0.388632,0.013503,0.787710,0.175460,0.500000,0.329321 +b_heterogeneous,18,4a16b930dfecbb1d,2378,2368,0,94,0.236419,0.001858,0.220687,0.152988,0.141396,0.000988,0.207328,0.116571,0.300808,0.001858,0.215106,0.172591,1.726167,0.368819,0.010941,0.820163,0.215131,0.500000,0.813488 +b_heterogeneous,19,b84bf30d0d71a818,2384,2367,0,94,0.194628,0.003758,0.177973,0.125453,0.133269,0.003758,0.170337,0.102455,0.274666,0.003758,0.193508,0.157311,1.710770,0.346035,0.014966,0.800895,0.186340,0.500000,0.212217 +b_heterogeneous,20,e9bd2ede63065d1b,2340,2329,0,94,0.237584,0.007452,0.347422,0.197486,0.191919,0.007036,0.366184,0.188380,0.327198,0.007822,0.405893,0.246971,1.749982,0.376080,0.033103,0.798503,0.208484,0.500000,0.972022 +b_heterogeneous,21,dff658ab50ab7266,2323,2312,0,94,0.201899,0.003671,0.252660,0.152743,0.143434,0.003671,0.262223,0.136443,0.292663,0.003671,0.254778,0.183704,1.607399,0.382523,0.023957,0.812607,0.204905,0.500000,0.780111 +b_heterogeneous,22,0d2b926586386761,2343,2334,0,94,0.202318,0.002310,0.228305,0.144311,0.139976,0.001307,0.216881,0.119388,0.338563,0.001854,0.268120,0.202846,1.438262,0.336128,0.015056,0.803769,0.217900,0.500000,0.927680 +b_heterogeneous,23,729ccc36f7cd146c,2482,2468,0,94,0.221066,0.009202,0.303204,0.177824,0.162678,0.009202,0.320864,0.164248,0.310488,0.009280,0.360795,0.226854,1.811986,0.383089,0.010808,0.803069,0.198641,0.500000,0.010463 +c_step,0,a98ef80c02474518,4050,3689,82,94,0.087817,0.034945,0.039928,0.054230,0.062647,0.010172,0.082864,0.051894,0.615511,0.571725,0.711438,0.632891,0.067518,0.054248,0.000273,0.999931,0.507712,0.500000,0.424445 +c_step,1,db51265b70f0721d,3979,3618,81,94,0.109540,0.032195,0.003950,0.048562,0.073051,0.011076,0.084999,0.056376,0.611743,0.549557,0.649725,0.603675,0.067801,0.054233,0.000278,0.998519,0.528970,0.500000,0.318222 +c_step,2,0d246ca6a76d6f12,4036,3631,129,94,0.094615,0.020445,0.046700,0.053920,0.067642,0.012530,0.056962,0.045711,0.842616,0.730713,0.895051,0.822793,0.067165,0.054347,0.000277,0.999762,0.526796,0.500000,0.911453 +c_step,3,3eee9af5959e1c17,4044,3700,62,94,0.107553,0.027500,0.051571,0.062208,0.072060,0.011529,0.051571,0.045054,0.582386,0.525611,0.654363,0.587453,0.068026,0.054450,0.000272,0.999721,0.495799,0.500000,0.188693 +c_step,4,60b1c0c0c40b0914,3938,3602,61,94,0.096053,0.026322,0.056728,0.059701,0.066038,0.011791,0.046414,0.041414,0.893384,0.706050,0.958181,0.852539,0.068559,0.054298,0.000280,0.999223,0.534012,0.500000,0.900497 +c_step,5,92040f0e3aa42609,4020,3617,126,94,0.097954,0.027400,0.095372,0.073575,0.073103,0.011177,0.098551,0.060944,0.754605,0.671980,0.837645,0.754744,0.068188,0.054179,0.000278,0.999711,0.527316,0.500000,0.541382 +c_step,6,c3ceb55d68d1d30e,3986,3602,103,94,0.105897,0.030046,0.067042,0.067662,0.065142,0.010663,0.036100,0.037302,0.740377,0.677931,0.779542,0.732617,0.067687,0.054305,0.000278,0.999518,0.537968,0.500000,0.151765 +c_step,7,f591e3a85f42c003,3985,3611,94,94,0.103033,0.027467,0.055716,0.062072,0.074580,0.012008,0.097171,0.061253,0.168027,0.102758,0.141779,0.137521,0.068168,0.054334,0.000279,0.999701,0.528544,0.500000,0.191400 +c_step,8,276429f78dfffd00,4082,3644,153,94,0.107961,0.026211,0.056728,0.063633,0.070057,0.011466,0.046414,0.042646,0.731525,0.695439,0.806902,0.744622,0.067373,0.054354,0.000276,0.999857,0.526108,0.500000,0.506572 +c_step,9,492f57c2fc68ea05,3982,3609,92,94,0.100063,0.032701,0.116607,0.083124,0.060421,0.010255,0.065442,0.045372,0.513522,0.426527,0.537966,0.492672,0.067898,0.054236,0.000278,0.999605,0.526588,0.500000,0.652020 +c_step,10,7af18211d285873a,3952,3590,83,94,0.107494,0.034452,0.082514,0.074820,0.061907,0.011884,0.020628,0.031473,0.154247,0.103585,0.105185,0.121006,0.068126,0.054262,0.000280,0.999517,0.547009,0.500000,0.756370 +c_step,11,ac44c85f0136b43f,3950,3612,56,94,0.095326,0.030947,0.046414,0.057562,0.075966,0.011781,0.056728,0.048158,0.644297,0.548750,0.678723,0.623923,0.067873,0.054361,0.000279,0.999863,0.532278,0.500000,0.428334 +c_step,12,de0f76aa77a3a13c,3970,3632,55,94,0.103127,0.025734,0.099159,0.076007,0.070033,0.010309,0.074472,0.051605,0.384816,0.310399,0.404226,0.366481,0.067922,0.054245,0.000277,0.999762,0.521350,0.500000,0.634339 +c_step,13,0fd1bcf9a5dd5e31,4016,3632,101,94,0.088358,0.023627,0.030943,0.047643,0.064211,0.010720,0.072199,0.049043,0.864479,0.707392,0.942439,0.838104,0.067565,0.054176,0.000276,0.999799,0.528167,0.500000,0.700585 +c_step,14,31a4eac4944e4b36,4007,3612,113,94,0.097986,0.034064,0.046414,0.059488,0.076422,0.012006,0.056728,0.048385,0.491448,0.421701,0.518821,0.477323,0.067923,0.054139,0.000278,0.999925,0.532024,0.500000,0.635217 +c_step,15,636f1113cafb782b,4067,3677,109,94,0.108806,0.029941,0.067042,0.068596,0.060147,0.010183,0.036100,0.035477,0.191688,0.110621,0.160534,0.154281,0.067831,0.054209,0.000274,0.999863,0.513969,0.500000,0.256761 +c_step,16,95325f6139141528,4010,3690,40,94,0.108801,0.030347,0.071799,0.070316,0.080996,0.011886,0.060470,0.051117,0.785278,0.573871,0.880173,0.746441,0.067822,0.054332,0.000273,0.999737,0.501545,0.500000,0.079440 +c_step,17,c68485ac6f81022d,4061,3683,98,94,0.087005,0.020611,0.051571,0.053062,0.064569,0.010523,0.051571,0.042221,0.508753,0.462303,0.557826,0.509628,0.067906,0.054415,0.000273,0.999626,0.505551,0.500000,0.666723 +c_step,18,e84f33fb5e323f22,4009,3644,80,94,0.101087,0.025297,0.096895,0.074426,0.069671,0.011393,0.138343,0.073136,0.723701,0.633935,0.817206,0.724947,0.067989,0.054283,0.000276,0.999951,0.510516,0.500000,0.266680 +c_step,19,1a1279c68caf2c27,4047,3653,119,94,0.097021,0.030890,0.015471,0.047794,0.078594,0.013827,0.087671,0.060031,0.544336,0.481685,0.580925,0.535649,0.068018,0.054331,0.000276,0.999435,0.521326,0.500000,0.474589 +c_step,20,4be4a415e2d8d924,3957,3594,84,94,0.100142,0.031529,0.067169,0.066280,0.066879,0.010675,0.053931,0.043828,0.441310,0.379215,0.469057,0.429861,0.067928,0.054220,0.000279,0.999923,0.534007,0.500000,0.528436 +c_step,21,7dafd260d175f659,4095,3679,146,94,0.094040,0.029819,0.061838,0.061899,0.066080,0.011750,0.052739,0.043523,0.412629,0.382373,0.475310,0.423437,0.067672,0.054255,0.000274,0.999889,0.517202,0.500000,0.145063 +c_step,22,af7218ae07e6e35e,3899,3578,47,94,0.098398,0.030599,0.079558,0.069518,0.068906,0.011942,0.067042,0.049297,0.873155,0.635456,0.914394,0.807669,0.067989,0.054231,0.000281,0.999941,0.533316,0.500000,0.857569 +c_step,23,d0c546fd76139053,3940,3591,70,94,0.087415,0.031756,0.047291,0.055487,0.062476,0.011400,0.047462,0.040446,0.491875,0.382646,0.492247,0.455589,0.068133,0.054241,0.000280,0.999404,0.544095,0.500000,0.597903 +d_square_wave,0,4f466652810cc90d,3993,3918,0,94,0.173637,0.058158,0.197182,0.142992,0.064966,0.010997,0.201474,0.092479,0.731962,0.154299,0.840214,0.575492,0.067803,0.054288,0.000271,0.999152,0.621211,0.500000,0.062768 +d_square_wave,1,3d99b805f3bbfe08,3986,3883,0,94,0.156238,0.062712,0.200019,0.139656,0.069930,0.012984,0.211855,0.098257,0.714488,0.126227,0.798701,0.546472,0.067388,0.054424,0.000272,0.999712,0.604184,0.500000,0.355403 +d_square_wave,2,ebecf2f82426e307,4094,4017,0,94,0.171072,0.063600,0.231445,0.155372,0.061303,0.012180,0.199145,0.090876,0.641839,0.141310,0.748298,0.510482,0.067381,0.054253,0.000265,0.999306,0.615310,0.500000,0.931601 +d_square_wave,3,d82604ab16d59002,3873,3804,0,94,0.193038,0.057238,0.240766,0.163681,0.075441,0.012923,0.275395,0.121253,0.702048,0.135184,0.758281,0.531837,0.068617,0.054100,0.000279,0.999892,0.631386,0.500000,0.158914 +d_square_wave,4,86795e9e47408501,4011,3914,0,94,0.176338,0.059173,0.184877,0.140129,0.066889,0.011019,0.272618,0.116842,0.646190,0.129565,0.739946,0.505234,0.067724,0.054299,0.000270,0.999363,0.618540,0.500000,0.167153 +d_square_wave,5,74cc9150b9efaa1c,3957,3869,0,94,0.181242,0.064297,0.236736,0.160758,0.063463,0.012116,0.217796,0.097791,0.646701,0.131302,0.729073,0.502359,0.067954,0.054232,0.000274,0.999702,0.625679,0.500000,0.397684 +d_square_wave,6,25062b03eb9a5f1b,4080,3982,0,94,0.181542,0.062906,0.216291,0.153580,0.072321,0.014255,0.223547,0.103374,0.558065,0.125060,0.612785,0.431970,0.067320,0.054153,0.000265,0.999903,0.618978,0.500000,0.895568 +d_square_wave,7,13597df6dc094c16,3923,3840,0,94,0.172136,0.060139,0.246847,0.159707,0.065722,0.011668,0.272687,0.116692,0.611091,0.098879,0.656874,0.455615,0.068147,0.054428,0.000276,0.999665,0.608313,0.500000,0.727478 +d_square_wave,8,c1acb7a90eb47115,3945,3871,0,94,0.163997,0.057308,0.221093,0.147466,0.066147,0.013029,0.226436,0.101871,0.468538,0.119785,0.523258,0.370527,0.068263,0.054420,0.000275,0.999734,0.624000,0.500000,0.431679 +d_square_wave,9,afe7c99c7f236610,4173,4057,0,94,0.177684,0.066815,0.206562,0.150354,0.068134,0.012889,0.190402,0.090475,0.481437,0.154604,0.561774,0.399272,0.067890,0.054194,0.000259,0.999952,0.640351,0.500000,0.719614 +d_square_wave,10,9c391c4f51ce0b2f,4022,3940,0,94,0.183452,0.061936,0.242643,0.162677,0.072472,0.012951,0.204457,0.096627,0.507240,0.100587,0.555247,0.387691,0.068005,0.054334,0.000269,0.999822,0.613075,0.500000,0.193258 +d_square_wave,11,4a8c5601827d382a,3996,3893,0,94,0.190311,0.063065,0.251205,0.168194,0.070563,0.013273,0.246203,0.110013,0.590901,0.130539,0.629871,0.450437,0.068233,0.054184,0.000271,0.999807,0.618598,0.500000,0.003141 +d_square_wave,12,38c7e8f4f4e82d29,3910,3821,0,94,0.166744,0.058091,0.233024,0.152619,0.070188,0.011887,0.272390,0.118155,0.778707,0.131317,0.842714,0.584246,0.069028,0.054294,0.000277,0.999912,0.613752,0.500000,0.240035 +d_square_wave,13,e91922a72696d224,3975,3893,0,94,0.165773,0.061077,0.212704,0.146518,0.062364,0.011324,0.274099,0.115929,0.775316,0.139860,0.899659,0.604945,0.068222,0.054149,0.000272,0.999203,0.603232,0.500000,0.620791 +d_square_wave,14,d76c749a1705c723,3953,3907,0,94,0.186956,0.064092,0.252815,0.167954,0.082102,0.013525,0.232248,0.109292,0.610114,0.127253,0.694466,0.477278,0.068241,0.054241,0.000274,0.999534,0.609054,0.500000,0.616480 +d_square_wave,15,85a78f4d49b0f43e,4061,4006,0,94,0.168203,0.065675,0.200418,0.144765,0.070479,0.013301,0.187511,0.090430,0.699735,0.163412,0.825983,0.563044,0.068162,0.054365,0.000266,0.999858,0.610110,0.500000,0.516171 +d_square_wave,16,73fac13fba5f993d,4023,3934,0,94,0.170632,0.058307,0.203166,0.144035,0.063677,0.013238,0.202642,0.093186,0.553744,0.129872,0.602124,0.428580,0.067630,0.054414,0.000269,0.999852,0.610765,0.500000,0.411791 +d_square_wave,17,204c1bf2ecca8e38,3914,3832,0,94,0.182712,0.055282,0.221457,0.153150,0.073744,0.012425,0.230958,0.105709,0.648773,0.119423,0.677548,0.481915,0.068028,0.054275,0.000277,0.999786,0.614566,0.500000,0.992396 +d_square_wave,18,0e87ada5dd79b337,4045,3960,0,94,0.162456,0.061938,0.168804,0.131066,0.065100,0.012168,0.223444,0.100238,0.388734,0.072738,0.451910,0.304461,0.068511,0.054452,0.000268,0.999991,0.607186,0.500000,0.257557 +d_square_wave,19,fcdae7980fe4a032,3910,3837,0,94,0.175927,0.069328,0.197400,0.147552,0.075707,0.012933,0.229039,0.105893,0.551025,0.094063,0.570048,0.405045,0.067724,0.054320,0.000277,0.999920,0.623616,0.500000,0.375411 +d_square_wave,20,ad2c3a4b61935531,4084,4018,0,94,0.165121,0.063766,0.198681,0.142523,0.059051,0.012123,0.203109,0.091428,0.466144,0.137632,0.537886,0.380554,0.068315,0.054457,0.000266,0.999800,0.626939,0.500000,0.389598 +d_square_wave,21,9b674c3e523e7a4c,4070,4006,0,94,0.167983,0.063380,0.218615,0.149992,0.070261,0.012845,0.208553,0.097220,0.682252,0.171203,0.825233,0.559563,0.068743,0.054315,0.000266,0.999336,0.620192,0.500000,0.444032 +d_square_wave,22,49ba86f084ad6f4b,3994,3896,0,94,0.164549,0.062751,0.185907,0.137736,0.058832,0.013092,0.231841,0.101255,0.765335,0.143971,0.831893,0.580400,0.068405,0.054171,0.000271,0.999813,0.630935,0.500000,0.258035 +d_square_wave,23,360dd8a3f5581c46,4100,4037,0,94,0.168688,0.062092,0.240013,0.156931,0.066180,0.012893,0.191058,0.090044,0.475643,0.132584,0.553478,0.387235,0.067824,0.054089,0.000264,0.999740,0.614150,0.500000,0.270323 +e_bursty,0,ed3ded9b01fa4d66,4937,4706,6,94,0.131736,0.168015,0.190822,0.163524,0.129804,0.024454,0.217765,0.124008,0.431320,0.462710,0.560187,0.484739,0.067401,0.054255,0.000220,0.999851,0.687351,0.500000,0.104238 +e_bursty,1,9fe233cc734d7a63,4918,4898,0,94,0.162850,0.163408,0.299515,0.208591,0.127530,0.025020,0.250246,0.134265,0.316449,0.252932,0.426116,0.331832,0.068509,0.054276,0.000221,0.999888,0.660981,0.500000,0.957530 +e_bursty,2,49977931a4d0676c,4635,4429,0,94,0.232319,0.152506,0.343734,0.242853,0.154552,0.026414,0.295163,0.158710,0.548603,0.322367,0.679322,0.516764,0.067965,0.054217,0.000234,0.999913,0.693053,0.500000,0.954776 +e_bursty,3,7a5d8f6296231469,4606,4516,0,94,0.186956,0.163140,0.305214,0.218437,0.165759,0.030684,0.277848,0.158097,0.404503,0.271246,0.588939,0.421563,0.068577,0.054417,0.000236,0.999513,0.670135,0.500000,0.324597 +e_bursty,4,2402d557c7b6016a,4745,4687,0,94,0.199635,0.160017,0.404222,0.254625,0.172842,0.031782,0.273545,0.159389,0.369329,0.288402,0.539188,0.398973,0.068312,0.054440,0.000229,0.999869,0.667745,0.500000,0.733082 +e_bursty,5,d6b71a9939192e77,4620,4564,0,94,0.174411,0.130772,0.364455,0.223213,0.191066,0.034399,0.306445,0.177303,0.401860,0.279158,0.558146,0.413055,0.067750,0.054182,0.000235,0.999385,0.597763,0.500000,0.435522 +e_bursty,6,877da0ca6b6cdb70,5405,5237,55,94,0.088039,0.172693,0.208900,0.156544,0.063510,0.018335,0.124092,0.068646,0.129947,0.264643,0.254786,0.216458,0.067973,0.054257,0.000202,0.999924,0.628837,0.500000,0.863111 +e_bursty,7,b122f63f5cffc87d,4818,4724,87,94,0.175105,0.127984,0.385783,0.229624,0.119786,0.024364,0.232261,0.125470,0.381914,0.497723,0.649483,0.509706,0.067894,0.054197,0.000229,0.999864,0.581312,0.500000,0.558694 +e_bursty,8,63d73c608e42f57e,4740,4682,0,94,0.147096,0.135425,0.378092,0.220204,0.153302,0.029829,0.263126,0.148752,0.325814,0.219158,0.548844,0.364605,0.067737,0.054091,0.000228,0.999845,0.569300,0.500000,0.227571 +e_bursty,9,0d9c4255ffd5e27b,5199,4975,0,94,0.117323,0.163446,0.257800,0.179523,0.100634,0.020299,0.156185,0.092373,0.241365,0.406454,0.494333,0.380718,0.068682,0.054174,0.000208,0.999551,0.599193,0.500000,0.967121 +e_bursty,10,3e429786d1388f44,4987,4884,94,94,0.158733,0.159211,0.291905,0.203283,0.127921,0.025054,0.229554,0.127509,0.294630,0.319594,0.460625,0.358283,0.067307,0.054089,0.000221,0.999850,0.678602,0.500000,0.561145 +e_bursty,11,e8f7ddc8028bbc41,5026,5017,0,94,0.111153,0.164598,0.221582,0.165778,0.075641,0.019544,0.196523,0.097236,0.220459,0.422139,0.439787,0.360795,0.067852,0.054287,0.000215,0.999583,0.633452,0.500000,0.608317 +e_bursty,12,9abc633d741ea942,4850,4845,0,94,0.154013,0.149795,0.355392,0.219733,0.128428,0.026101,0.235444,0.129991,0.329447,0.310829,0.457142,0.365806,0.068106,0.054291,0.000223,0.999873,0.664881,0.500000,0.956497 +e_bursty,13,4b62a96ea660564f,4406,4354,0,94,0.212497,0.122318,0.308282,0.214366,0.157218,0.025053,0.297627,0.159966,0.499180,0.289993,0.619061,0.469411,0.067883,0.054376,0.000246,0.999828,0.647429,0.500000,0.310548 +e_bursty,14,7517ff5397f34348,4233,4161,0,94,0.253609,0.109287,0.349608,0.237501,0.183235,0.025647,0.304173,0.171019,0.596916,0.168391,0.658968,0.474758,0.067899,0.054198,0.000256,0.999980,0.645690,0.500000,0.924838 +e_bursty,15,27dc0484c9467055,5320,4960,107,94,0.143168,0.169818,0.317943,0.210310,0.088028,0.020761,0.154372,0.087720,0.291087,0.379321,0.474631,0.381680,0.067441,0.054276,0.000208,0.999754,0.679053,0.500000,0.342240 +e_bursty,16,d1814af63aa91d56,4869,4803,57,94,0.150690,0.146863,0.223987,0.173847,0.122897,0.026917,0.287010,0.145608,0.393092,0.579312,0.577914,0.516773,0.068178,0.054247,0.000225,0.999931,0.710961,0.500000,0.973672 +e_bursty,17,8237903b6c3c0a53,4540,4398,68,94,0.206506,0.142799,0.369915,0.239740,0.153655,0.028009,0.224260,0.135308,0.617344,0.568873,0.711676,0.632631,0.068430,0.054373,0.000243,0.999673,0.752066,0.500000,0.879966 +e_bursty,18,acfc266c5d8f375c,4798,4677,100,94,0.164208,0.156916,0.369962,0.230362,0.119063,0.024468,0.276667,0.140066,0.400861,0.465991,0.584775,0.483876,0.068462,0.054225,0.000231,0.999998,0.692099,0.500000,0.784495 +e_bursty,19,5ea16c518f122459,4508,4478,0,94,0.200699,0.125291,0.286232,0.204074,0.170814,0.030186,0.294638,0.165212,0.503986,0.293744,0.642540,0.480090,0.067414,0.054364,0.000241,0.999932,0.650086,0.500000,0.925576 +e_bursty,20,0f57b182e165d15a,4886,4810,0,94,0.172671,0.144466,0.369142,0.228760,0.153515,0.028196,0.243455,0.141722,0.375079,0.277413,0.571447,0.407980,0.068326,0.054281,0.000222,0.999821,0.613303,0.500000,0.313497 +e_bursty,21,391cc7f7d2c8fe27,4992,4927,0,94,0.146113,0.147922,0.355995,0.216677,0.116678,0.024848,0.267845,0.136457,0.292358,0.405392,0.522823,0.406858,0.068413,0.054323,0.000217,0.999782,0.561346,0.500000,0.222083 +e_bursty,22,ebc10d39045beb20,4777,4761,0,94,0.195498,0.149912,0.331566,0.225658,0.124520,0.023524,0.253344,0.133796,0.355361,0.306038,0.543568,0.401656,0.067980,0.054227,0.000227,0.999917,0.612422,0.500000,0.112719 +e_bursty,23,9476536a75ae982d,4732,4631,0,94,0.210702,0.166496,0.381380,0.252859,0.160226,0.029154,0.304050,0.164476,0.396332,0.291286,0.642919,0.443512,0.067311,0.054235,0.000229,0.999881,0.646550,0.500000,0.221692 +f_capacity_drop,0,82f56be180a7d15b,4414,3861,289,94,0.097375,0.019891,0.301908,0.139725,0.070066,0.010724,0.315300,0.132030,0.300452,0.832693,0.739830,0.624325,0.068003,0.054363,0.000263,0.999713,0.132529,0.500000,0.798813 +f_capacity_drop,1,f02ab5b6f210e65e,4430,3817,342,94,0.100275,0.021554,0.293384,0.138404,0.069800,0.010682,0.224517,0.101667,0.241675,0.716881,0.681993,0.546849,0.067788,0.054317,0.000265,0.999609,0.155068,0.500000,0.508324 +f_capacity_drop,2,265fff4b258dfb51,4409,3857,281,94,0.094218,0.025223,0.268244,0.129228,0.063248,0.009877,0.244191,0.105772,0.263278,0.800960,0.744359,0.602866,0.067470,0.054334,0.000262,0.999812,0.154300,0.500000,0.608568 +f_capacity_drop,3,15950918177e8854,4495,3880,344,94,0.113603,0.020766,0.291675,0.142014,0.082894,0.013625,0.257248,0.117922,0.312993,0.875268,0.777538,0.655266,0.068476,0.054246,0.000261,0.999760,0.140715,0.500000,0.337207 +f_capacity_drop,4,4bca532d46eb9d57,4384,3814,298,94,0.096320,0.021606,0.252217,0.123381,0.064979,0.010340,0.208458,0.094592,0.205476,0.192051,0.345625,0.247717,0.067606,0.054500,0.000266,0.999882,0.162441,0.500000,0.001199 +f_capacity_drop,5,b97f9ce3b844b24a,4351,3856,222,94,0.099925,0.023751,0.285786,0.136487,0.068670,0.014248,0.262808,0.115242,0.301855,0.803597,0.762350,0.622601,0.068596,0.054233,0.000262,0.999942,0.159282,0.500000,0.339186 +f_capacity_drop,6,e8b526b0ea31474d,4333,3825,235,94,0.104375,0.021268,0.290775,0.138806,0.076431,0.009786,0.250515,0.112244,0.233750,0.422483,0.478976,0.378403,0.068011,0.054136,0.000264,0.999834,0.132539,0.500000,0.832914 +f_capacity_drop,7,deea7045dda25440,4350,3841,247,94,0.089230,0.023139,0.242837,0.118402,0.083401,0.013001,0.229515,0.108639,0.264626,0.769071,0.759540,0.597746,0.067731,0.054386,0.000264,0.999688,0.145483,0.500000,0.646050 +f_capacity_drop,8,0c1fba1a0f1f6943,4536,3898,368,94,0.108866,0.023181,0.298399,0.143482,0.076806,0.012393,0.242001,0.110400,0.310163,0.842213,0.752791,0.635055,0.067549,0.054300,0.000260,0.999604,0.140628,0.500000,0.855694 +f_capacity_drop,9,6254c42f7e887e46,4431,3872,286,94,0.092679,0.022079,0.288245,0.134334,0.065343,0.011475,0.253332,0.110050,0.199663,0.220493,0.431721,0.283959,0.068783,0.054392,0.000262,0.999950,0.149861,0.500000,0.547408 +f_capacity_drop,10,518a11fc50651379,4332,3812,249,94,0.099923,0.023274,0.260057,0.127751,0.080275,0.009999,0.245020,0.111765,0.242953,0.612232,0.604598,0.486594,0.068140,0.054354,0.000265,0.999417,0.144856,0.500000,0.408503 +f_capacity_drop,11,873f5bb283d6207c,4376,3818,289,94,0.096605,0.019270,0.261434,0.125770,0.073517,0.010667,0.260202,0.114796,0.270519,0.780097,0.707524,0.586047,0.068746,0.054387,0.000265,0.999859,0.148945,0.500000,0.411583 +f_capacity_drop,12,f574e547f543357f,4420,3866,284,94,0.104447,0.020692,0.292588,0.139242,0.081514,0.012471,0.246753,0.113579,0.270912,0.798344,0.710680,0.593312,0.068010,0.054314,0.000262,0.999876,0.149869,0.500000,0.964949 +f_capacity_drop,13,24aa2f14273dca72,4342,3841,230,94,0.106172,0.026386,0.319817,0.150792,0.076417,0.012050,0.273611,0.120692,0.238759,0.651775,0.629538,0.506691,0.068295,0.054194,0.000263,0.999865,0.139453,0.500000,0.611785 +f_capacity_drop,14,1adf792916aedf75,4394,3860,267,94,0.103121,0.018769,0.302604,0.141498,0.081081,0.012920,0.260754,0.118252,0.241641,0.426803,0.495308,0.387917,0.067571,0.054363,0.000263,0.999653,0.154918,0.500000,0.586221 +f_capacity_drop,15,481482fe481bec68,4273,3772,231,94,0.086576,0.020886,0.244923,0.117462,0.064627,0.008176,0.230551,0.101118,0.237960,0.519258,0.551885,0.436368,0.068670,0.054447,0.000268,0.999889,0.155513,0.500000,0.898639 +f_capacity_drop,16,be49cc8cbbf4816b,4370,3809,294,94,0.098809,0.020742,0.250940,0.123497,0.076629,0.013048,0.200245,0.096640,0.280313,0.791156,0.753529,0.608332,0.067693,0.054215,0.000266,0.999460,0.155084,0.500000,0.086151 +f_capacity_drop,17,edff1641ed61966e,4262,3716,278,94,0.110771,0.018281,0.233800,0.120951,0.080151,0.010072,0.236692,0.108972,0.252335,0.552125,0.560128,0.454863,0.068425,0.054470,0.000272,0.999391,0.168895,0.500000,0.437093 +f_capacity_drop,18,c334a016dcd2ab61,4378,3850,257,94,0.096458,0.026005,0.283828,0.135430,0.071013,0.010921,0.233304,0.105080,0.208460,0.525953,0.544084,0.426166,0.068219,0.054377,0.000263,0.999535,0.151050,0.500000,0.526224 +f_capacity_drop,19,3169ea2b0e4fb864,4388,3821,297,94,0.093295,0.017629,0.296878,0.135934,0.067029,0.010659,0.257003,0.111564,0.178330,0.258544,0.453558,0.296810,0.068147,0.054256,0.000265,0.999782,0.146750,0.500000,0.038688 +f_capacity_drop,20,609f37f860384d67,4245,3784,189,94,0.101247,0.023989,0.243349,0.122862,0.083375,0.011820,0.232241,0.109145,0.288266,0.756641,0.730385,0.591764,0.067594,0.054197,0.000267,0.999834,0.153659,0.500000,0.754329 +f_capacity_drop,21,56d4418d5395621a,4413,3886,257,94,0.092828,0.024815,0.289710,0.135784,0.068926,0.011954,0.279381,0.120087,0.221963,0.412178,0.464845,0.366329,0.067807,0.054246,0.000261,0.999553,0.144908,0.500000,0.570659 +f_capacity_drop,22,84098b438506771d,4308,3811,227,94,0.114620,0.027849,0.296670,0.146380,0.074896,0.011960,0.246607,0.111154,0.260999,0.682290,0.662812,0.535367,0.068140,0.054396,0.000265,0.999882,0.159904,0.500000,0.114584 +f_capacity_drop,23,fbbed510f4f30410,4429,3909,251,94,0.093666,0.021899,0.254788,0.123451,0.075949,0.011491,0.299851,0.129097,0.266699,0.615067,0.590198,0.490655,0.068482,0.054208,0.000259,0.999641,0.143166,0.500000,0.248714 +g_regime_change,0,20acd126076d554c,3451,3434,0,94,0.146430,0.005667,0.329300,0.160466,0.096269,0.004487,0.285318,0.128691,0.510514,0.005616,0.382144,0.299425,1.055672,0.272521,0.015567,0.975944,0.310190,0.500000,0.618098 +g_regime_change,1,52730f7175da6249,3412,3403,0,94,0.127224,0.004085,0.327684,0.152998,0.094147,0.004078,0.304218,0.134148,0.435020,0.004085,0.391381,0.276829,0.938924,0.268481,0.007048,0.970877,0.338261,0.500000,0.346847 +g_regime_change,2,8406458ca2477f46,3376,3365,0,94,0.155509,0.006851,0.322805,0.161722,0.104078,0.004332,0.280606,0.129672,0.474913,0.006899,0.364596,0.282136,1.064779,0.281774,0.008586,0.976874,0.340656,0.500000,0.406636 +g_regime_change,3,b7ccb3df90b40c43,3279,3266,0,94,0.156880,0.003395,0.202324,0.120867,0.120015,0.002026,0.199356,0.107132,0.408887,0.004641,0.356758,0.256762,0.909203,0.229148,0.005962,0.980711,0.335809,0.500000,0.383020 +g_regime_change,4,e993e9eac1211940,3310,3298,0,94,0.151808,0.009678,0.355126,0.172204,0.121165,0.008748,0.344178,0.158030,0.515556,0.009314,0.320988,0.281953,1.152013,0.307038,0.032191,0.974775,0.335674,0.500000,0.628024 +g_regime_change,5,1b2626243f8e365d,3380,3366,0,94,0.147164,0.006035,0.325482,0.159560,0.103843,0.003867,0.304193,0.137301,0.248341,0.006035,0.341637,0.198671,1.244820,0.297078,0.016325,0.973611,0.303453,0.500000,0.428617 +g_regime_change,6,4aec9c776dfbc35a,3468,3461,0,94,0.138771,0.011513,0.340036,0.163440,0.105609,0.007458,0.319436,0.144168,0.286918,0.014120,0.414366,0.238468,0.939035,0.269604,0.008209,0.967265,0.342880,0.500000,0.089266 +g_regime_change,7,7cb3ca825a68d057,3356,3345,0,94,0.160286,0.008626,0.318370,0.162427,0.119388,0.007471,0.263120,0.129993,0.569100,0.009744,0.369986,0.316276,0.946864,0.250241,0.008046,0.969270,0.334191,0.500000,0.713631 +g_regime_change,8,ae4600dd88d5ed54,3446,3434,0,94,0.143178,0.008810,0.349410,0.167133,0.097257,0.003446,0.312620,0.137774,0.356547,0.008796,0.433208,0.266183,1.043435,0.251372,0.008440,0.976286,0.358910,0.500000,0.619320 +g_regime_change,9,c00d7ee8f942fa51,3361,3348,0,94,0.149517,0.006152,0.255260,0.136976,0.111696,0.003471,0.246269,0.120479,0.460939,0.006152,0.314727,0.260606,0.878839,0.240818,0.005114,0.970638,0.320999,0.500000,0.673248 +g_regime_change,10,f3d3ab3bd7af976e,3401,3390,0,94,0.141732,0.004640,0.310487,0.152287,0.100083,0.004639,0.280509,0.128410,0.306297,0.004802,0.294270,0.201790,1.220157,0.285066,0.016141,0.981476,0.316831,0.500000,0.317737 +g_regime_change,11,2566e175041ca46b,3463,3451,0,94,0.141029,0.003322,0.336662,0.160337,0.094803,0.002995,0.296332,0.131377,0.664543,0.003322,0.433525,0.367130,0.865381,0.239665,0.006858,0.976659,0.352477,0.500000,0.122782 +g_regime_change,12,572d5f807289b168,3336,3322,0,94,0.150965,0.005651,0.305355,0.153990,0.103671,0.003245,0.283127,0.130014,0.309320,0.005399,0.348635,0.221118,1.049054,0.278187,0.016540,0.982161,0.337640,0.500000,0.015506 +g_regime_change,13,86f395d3a0f74e65,3248,3236,0,94,0.163740,0.009883,0.235153,0.136259,0.115265,0.004234,0.242659,0.120720,0.499851,0.010047,0.315029,0.274976,0.880731,0.262466,0.008431,0.971827,0.350133,0.500000,0.833912 +g_regime_change,14,b886c3ee91645b62,3519,3504,0,94,0.154889,0.014443,0.374572,0.181302,0.124189,0.014263,0.342778,0.160410,0.369419,0.014541,0.452032,0.278664,1.198097,0.266414,0.012805,0.977690,0.340525,0.500000,0.879782 +g_regime_change,15,ea4d3839cfd1687f,3439,3430,0,94,0.146767,0.006754,0.317122,0.156881,0.117628,0.006171,0.307017,0.143605,0.538064,0.006617,0.339893,0.294858,1.028025,0.255745,0.016818,0.967799,0.307182,0.500000,0.484025 +g_regime_change,16,1c10764b3c3e057c,3346,3330,0,94,0.163520,0.002003,0.319780,0.161768,0.099923,0.002216,0.265530,0.122556,0.426220,0.003057,0.367222,0.265500,0.791977,0.243787,0.011180,0.975138,0.343042,0.500000,0.533490 +g_regime_change,17,4fa6ac866aab1279,3393,3384,0,94,0.137818,0.003562,0.336721,0.159367,0.097647,0.003701,0.307610,0.136320,0.462347,0.003700,0.412510,0.292852,1.038398,0.278068,0.016494,0.973172,0.345576,0.500000,0.679968 +g_regime_change,18,616d1ad15b182f76,3371,3356,0,94,0.152950,0.004158,0.269031,0.142046,0.115278,0.004182,0.248572,0.122677,0.513417,0.005802,0.350581,0.289933,1.022084,0.268878,0.011291,0.975859,0.342093,0.500000,0.575387 +g_regime_change,19,933050ec89853c73,3389,3375,0,94,0.153107,0.004537,0.333827,0.163824,0.099128,0.004214,0.320798,0.141380,0.486722,0.004719,0.377849,0.289764,1.201516,0.286921,0.016202,0.980533,0.352136,0.500000,0.745623 +g_regime_change,20,c2c68d3fe7f2c970,3278,3261,0,94,0.165670,0.002252,0.247951,0.138625,0.110461,0.002251,0.234005,0.115573,0.464017,0.002252,0.273599,0.246623,0.909520,0.259709,0.018018,0.971136,0.330135,0.500000,0.988367 +g_regime_change,21,f48dfb4ad45fe60d,3246,3237,0,94,0.154586,0.003906,0.279404,0.145965,0.104306,0.003806,0.231059,0.113057,0.445667,0.003906,0.306240,0.251938,0.885525,0.278279,0.009818,0.978458,0.337993,0.500000,0.375402 +g_regime_change,22,2650318402ccf30a,3370,3356,0,94,0.156864,0.004674,0.308728,0.156755,0.109305,0.004452,0.269593,0.127783,0.557165,0.004674,0.301911,0.287916,0.941735,0.282774,0.016686,0.968188,0.309218,0.500000,0.791876 +g_regime_change,23,59e76fd773398007,3352,3345,0,94,0.165604,0.012733,0.394830,0.191055,0.123838,0.010004,0.375236,0.169693,0.441555,0.013916,0.447044,0.300839,1.105283,0.268772,0.008527,0.977166,0.354961,0.500000,0.359872 +h_hetero_sweep,0,c6645f6c87dad9a1,4995,4979,0,94,0.171579,0.005612,0.196359,0.124517,0.067913,0.005612,0.156279,0.076601,0.197808,0.005612,0.218375,0.140598,0.000000,0.132485,0.000530,0.803916,0.144321,0.500000,0.672944 +h_hetero_sweep,1,b4bb813bf56deea4,5135,5109,0,94,0.154997,0.005299,0.229967,0.130088,0.074641,0.005299,0.177962,0.085967,0.201156,0.005299,0.229438,0.145298,0.073944,0.137033,0.000606,0.789942,0.139220,0.500000,0.427544 +h_hetero_sweep,2,62cecbc622f0f3ab,4984,4968,0,94,0.168245,0.003826,0.230984,0.134352,0.075765,0.003755,0.166357,0.081959,0.201838,0.003826,0.218053,0.141239,0.139223,0.144830,0.000788,0.786816,0.139550,0.500000,0.746220 +h_hetero_sweep,3,51043d95100380ae,4929,4915,0,94,0.138398,0.004339,0.197061,0.113266,0.071140,0.004339,0.203097,0.092859,0.205858,0.004339,0.253927,0.154708,0.204047,0.153334,0.000881,0.797264,0.129980,0.500000,0.090535 +h_hetero_sweep,4,0f5b67a0419695ad,4802,4788,0,94,0.154327,0.004245,0.216001,0.124858,0.074469,0.004245,0.191899,0.090204,0.191531,0.004245,0.240457,0.145411,0.274938,0.164646,0.001403,0.789018,0.130880,0.500000,0.280427 +h_hetero_sweep,5,fdeea86ebf39bab0,4773,4753,0,94,0.183286,0.003989,0.268296,0.151857,0.084255,0.003901,0.180578,0.089578,0.229776,0.004033,0.290082,0.174631,0.339644,0.166571,0.001240,0.791725,0.149470,0.500000,0.764274 +h_hetero_sweep,6,ac24123ded4c4fb7,4588,4579,0,94,0.159750,0.002991,0.218559,0.127100,0.087638,0.002952,0.156239,0.082276,0.249064,0.002991,0.239706,0.163920,0.408191,0.180443,0.001364,0.807749,0.143830,0.500000,0.558050 +h_hetero_sweep,7,9a7b44c8dadf5cba,4520,4507,0,94,0.157073,0.003626,0.205972,0.122224,0.080088,0.003626,0.199728,0.094481,0.222208,0.003626,0.230794,0.152209,0.466023,0.185569,0.001938,0.813681,0.142420,0.500000,0.823667 +h_hetero_sweep,8,488e8e97086261b9,4470,4461,0,94,0.191337,0.006289,0.278752,0.158793,0.087043,0.006079,0.227151,0.106758,0.272433,0.006289,0.359244,0.212655,0.567550,0.199827,0.003282,0.797216,0.164927,0.500000,0.649426 +h_hetero_sweep,9,26c5f0a279f576bc,4259,4245,0,94,0.167360,0.002379,0.205366,0.125035,0.080750,0.002279,0.152155,0.078395,0.252980,0.002379,0.243202,0.166187,0.650623,0.205806,0.002672,0.807957,0.155360,0.500000,0.575004 +h_hetero_sweep,10,151b257157181b83,4130,4122,0,94,0.183984,0.004350,0.298355,0.162230,0.096392,0.004349,0.227352,0.109364,0.239626,0.004346,0.304004,0.182659,0.713504,0.218937,0.002533,0.803867,0.173576,0.500000,0.247858 +h_hetero_sweep,11,c3ae6f3f84ab2886,3922,3908,0,94,0.186905,0.007097,0.296132,0.163378,0.100550,0.004009,0.245779,0.116779,0.257262,0.006396,0.331348,0.198336,0.843867,0.239836,0.003499,0.808412,0.167530,0.500000,0.107429 +h_hetero_sweep,12,b1e5d1caf23e3d85,3694,3680,0,94,0.162738,0.004934,0.218085,0.128586,0.087532,0.004934,0.261808,0.118092,0.244782,0.004934,0.280092,0.176603,0.906348,0.247345,0.008515,0.799910,0.159366,0.500000,0.306643 +h_hetero_sweep,13,603b1b992040c288,3436,3428,0,94,0.161418,0.003298,0.215192,0.126636,0.098356,0.003298,0.231889,0.111181,0.226282,0.003298,0.241878,0.157153,1.110586,0.268062,0.005433,0.801246,0.144614,0.500000,0.909147 +h_hetero_sweep,14,5e4e4da411d3d78f,3241,3221,0,94,0.214532,0.003929,0.271249,0.163236,0.115014,0.003742,0.260753,0.126503,0.264747,0.003929,0.300836,0.189837,1.108827,0.284254,0.007960,0.801969,0.196071,0.500000,0.914713 +h_hetero_sweep,15,0c85b6734f66e492,3201,3191,0,94,0.188689,0.004646,0.273286,0.155541,0.108814,0.004646,0.274405,0.129289,0.261838,0.004646,0.312198,0.192894,1.248281,0.313644,0.015083,0.802476,0.183840,0.500000,0.814675 +h_hetero_sweep,16,fad8f801bc898991,2921,2902,0,94,0.218122,0.003210,0.301986,0.174439,0.131480,0.003198,0.287805,0.140828,0.256430,0.003210,0.334559,0.198066,1.278717,0.313672,0.010860,0.777738,0.190137,0.500000,0.926981 +h_hetero_sweep,17,a96e22ccea1c9e94,2692,2687,0,94,0.239081,0.011015,0.320264,0.190120,0.168835,0.011186,0.303357,0.161126,0.304613,0.011294,0.401567,0.239158,1.401981,0.344320,0.026171,0.802883,0.213954,0.500000,0.924336 +h_hetero_sweep,18,87a5949bdbafa39b,2487,2469,0,94,0.218723,0.004750,0.230361,0.151278,0.145373,0.004750,0.235736,0.128620,0.304895,0.004750,0.288232,0.199292,1.626589,0.384740,0.012653,0.812596,0.204684,0.500000,0.536373 +h_hetero_sweep,19,75f8dea60932b09e,2338,2325,0,94,0.206469,0.002103,0.223809,0.144127,0.147973,0.001960,0.231923,0.127285,0.270712,0.002103,0.243343,0.172053,1.721227,0.367740,0.010263,0.799669,0.200231,0.500000,0.874132 +h_hetero_sweep,20,240e03756745459d,2173,2161,0,94,0.262424,0.009224,0.359056,0.210235,0.214445,0.009331,0.369165,0.197647,0.337311,0.008911,0.338814,0.228346,1.886497,0.385402,0.010379,0.788093,0.216228,0.500000,0.500060 +h_hetero_sweep,21,1245750054e86ae0,1915,1892,0,94,0.282722,0.011297,0.363539,0.219186,0.250725,0.011004,0.369751,0.210493,0.395463,0.011689,0.429046,0.278733,2.014828,0.443637,0.021661,0.806196,0.249822,0.500000,0.797887 +h_hetero_sweep,22,c098bfce827b7fe7,1798,1789,0,94,0.256022,0.004920,0.216485,0.159142,0.212894,0.002809,0.226419,0.147374,0.345580,0.004920,0.258142,0.202881,2.053744,0.412230,0.018367,0.793801,0.246979,0.500000,0.786892 +h_hetero_sweep,23,bf2fe19df38e0cea,1637,1622,0,94,0.309459,0.003164,0.235058,0.182561,0.271586,0.002909,0.237053,0.170516,0.344386,0.003039,0.223873,0.190433,2.247194,0.481732,0.025996,0.804593,0.251522,0.500000,0.852104 diff --git a/evidence/DUAL/applicability/results.md b/evidence/DUAL/applicability/results.md new file mode 100644 index 000000000..b1339a80b --- /dev/null +++ b/evidence/DUAL/applicability/results.md @@ -0,0 +1,98 @@ +# DUAL applicability experiment: results (DUAL-APPLIC-V1) + +EXPERIMENTAL. Synthetic workloads. Not a production gate, not a production classifier. Nothing inserted into production. + +- parameter digest (SHA-256 of params.txt): `e489d25f5f0d23cfe8624a5cc82a5f770f04cb03fd3b441aac627e1a0087ecea` +- results digest (SHA-256 of results.csv text): `912fb51b13f981c5a5e4cce28211d6eac62d5e9149e9bc32e44eb9f1acb0c45a` +- runs: 192 (8 workloads x 24 seeds), 100 windows of 20 steps each, 5 warm-up windows unscored + +## 1. Aggregate predictor error per workload (mean over seeds, sd in parentheses) + +| workload | completions NRMSE (primary) | known-arrivals completions NRMSE | queue RMSE | blocked RMSE | composite | known-arrivals composite | shuffled composite | cv_demand | top5 share | max item share | class entropy | arrival cv | rejected/run | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +| a_homogeneous | 0.110 (0.007) | 0.078 (0.005) | 0.009 (0.004) | 0.391 (0.020) | 0.170 (0.007) | 0.146 (0.008) | 0.231 (0.015) | 0.068 | 0.054 | 0.0002 | 1.000 | 0.147 | 0.0 | +| b_heterogeneous | 0.220 (0.020) | 0.158 (0.027) | 0.006 (0.004) | 0.275 (0.066) | 0.167 (0.027) | 0.146 (0.031) | 0.212 (0.032) | 1.698 | 0.372 | 0.0200 | 0.804 | 0.203 | 0.0 | +| c_step | 0.099 (0.007) | 0.069 (0.006) | 0.029 (0.004) | 0.061 (0.026) | 0.063 (0.009) | 0.048 (0.009) | 0.566 (0.214) | 0.068 | 0.054 | 0.0003 | 1.000 | 0.524 | 91.0 | +| d_square_wave | 0.174 (0.009) | 0.068 (0.005) | 0.062 (0.003) | 0.217 (0.023) | 0.151 (0.010) | 0.102 (0.010) | 0.476 (0.081) | 0.068 | 0.054 | 0.0003 | 1.000 | 0.618 | 0.0 | +| e_bursty | 0.171 (0.038) | 0.136 (0.032) | 0.150 (0.017) | 0.320 (0.060) | 0.213 (0.027) | 0.137 (0.027) | 0.426 (0.081) | 0.068 | 0.054 | 0.0002 | 1.000 | 0.648 | 23.9 | +| f_capacity_drop | 0.100 (0.007) | 0.074 (0.006) | 0.022 (0.003) | 0.277 (0.024) | 0.133 (0.009) | 0.112 (0.009) | 0.498 (0.119) | 0.068 | 0.054 | 0.0003 | 1.000 | 0.150 | 271.3 | +| g_regime_change | 0.151 (0.009) | 0.108 (0.010) | 0.006 (0.003) | 0.312 (0.044) | 0.157 (0.015) | 0.133 (0.015) | 0.273 (0.035) | 1.013 | 0.268 | 0.0126 | 0.975 | 0.335 | 0.0 | +| h_hetero_sweep | 0.197 (0.044) | 0.122 (0.058) | 0.005 (0.002) | 0.253 (0.048) | 0.152 (0.028) | 0.120 (0.036) | 0.183 (0.033) | 0.970 | 0.266 | 0.0081 | 0.800 | 0.177 | 0.0 | + +## 2. Correlation of aggregate prediction error with heterogeneity measurements (Pearson r over all 192 runs) + +| measurement | r vs completions NRMSE (primary) | r vs known-arrivals completions NRMSE | r vs queue RMSE | r vs blocked RMSE | r vs composite | covariance vs completions NRMSE | note | +|---|---|---|---|---|---|---|---| +| cv_demand | +0.696 | +0.719 | -0.432 | +0.151 | +0.218 | +0.021948 | | +| top5_share | +0.689 | +0.688 | -0.462 | +0.149 | +0.203 | +0.004346 | | +| max_item_share | +0.606 | +0.656 | -0.377 | +0.177 | +0.224 | +0.000250 | | +| class_entropy | -0.673 | -0.550 | +0.407 | -0.022 | -0.120 | -0.002776 | | +| arrival_cv | +0.068 | -0.060 | +0.765 | -0.370 | +0.017 | +0.000678 | | +| broken_const (control) | +0.000 | +0.000 | +0.000 | +0.000 | +0.000 | +0.000000 | zero variance: covariance exactly 0, r reported as 0 | +| broken_noise (control) | +0.103 | +0.149 | +0.034 | +0.108 | +0.132 | +0.001434 | independent of the run: expected near 0 | + +## 2b. Heterogeneity sweep (workload h only, 24 runs, offered load held at 0.80, spread rises with seed index) + +- r(cv_demand, completions NRMSE) = +0.882; r(cv_demand, known-arrivals completions NRMSE) = +0.916 +- r(top5_share, completions NRMSE) = +0.903; r(top5_share, known-arrivals completions NRMSE) = +0.932 + +| seed_index | sigma | cv_demand | top5 share | max item share | completions NRMSE | known-arrivals completions NRMSE | blocked RMSE | +|---|---|---|---|---|---|---|---| +| 0 | 0.000 | 0.000 | 0.132 | 0.0005 | 0.172 | 0.068 | 0.196 | +| 1 | 0.065 | 0.074 | 0.137 | 0.0006 | 0.155 | 0.075 | 0.230 | +| 2 | 0.130 | 0.139 | 0.145 | 0.0008 | 0.168 | 0.076 | 0.231 | +| 3 | 0.196 | 0.204 | 0.153 | 0.0009 | 0.138 | 0.071 | 0.197 | +| 4 | 0.261 | 0.275 | 0.165 | 0.0014 | 0.154 | 0.074 | 0.216 | +| 5 | 0.326 | 0.340 | 0.167 | 0.0012 | 0.183 | 0.084 | 0.268 | +| 6 | 0.391 | 0.408 | 0.180 | 0.0014 | 0.160 | 0.088 | 0.219 | +| 7 | 0.457 | 0.466 | 0.186 | 0.0019 | 0.157 | 0.080 | 0.206 | +| 8 | 0.522 | 0.568 | 0.200 | 0.0033 | 0.191 | 0.087 | 0.279 | +| 9 | 0.587 | 0.651 | 0.206 | 0.0027 | 0.167 | 0.081 | 0.205 | +| 10 | 0.652 | 0.714 | 0.219 | 0.0025 | 0.184 | 0.096 | 0.298 | +| 11 | 0.717 | 0.844 | 0.240 | 0.0035 | 0.187 | 0.101 | 0.296 | +| 12 | 0.783 | 0.906 | 0.247 | 0.0085 | 0.163 | 0.088 | 0.218 | +| 13 | 0.848 | 1.111 | 0.268 | 0.0054 | 0.161 | 0.098 | 0.215 | +| 14 | 0.913 | 1.109 | 0.284 | 0.0080 | 0.215 | 0.115 | 0.271 | +| 15 | 0.978 | 1.248 | 0.314 | 0.0151 | 0.189 | 0.109 | 0.273 | +| 16 | 1.043 | 1.279 | 0.314 | 0.0109 | 0.218 | 0.131 | 0.302 | +| 17 | 1.109 | 1.402 | 0.344 | 0.0262 | 0.239 | 0.169 | 0.320 | +| 18 | 1.174 | 1.627 | 0.385 | 0.0127 | 0.219 | 0.145 | 0.230 | +| 19 | 1.239 | 1.721 | 0.368 | 0.0103 | 0.206 | 0.148 | 0.224 | +| 20 | 1.304 | 1.886 | 0.385 | 0.0104 | 0.262 | 0.214 | 0.359 | +| 21 | 1.370 | 2.015 | 0.444 | 0.0217 | 0.283 | 0.251 | 0.364 | +| 22 | 1.435 | 2.054 | 0.412 | 0.0184 | 0.256 | 0.213 | 0.216 | +| 23 | 1.500 | 2.247 | 0.482 | 0.0260 | 0.309 | 0.272 | 0.235 | + +## 3. Negative control: shuffled-window predictor must be worse than the real predictor + +| workload | runs where shuffled composite > real composite | mean real composite | mean shuffled composite | +|---|---|---|---| +| a_homogeneous | 24 / 24 | 0.170 | 0.231 | +| b_heterogeneous | 24 / 24 | 0.167 | 0.212 | +| c_step | 24 / 24 | 0.063 | 0.566 | +| d_square_wave | 24 / 24 | 0.151 | 0.476 | +| e_bursty | 24 / 24 | 0.213 | 0.426 | +| f_capacity_drop | 24 / 24 | 0.133 | 0.498 | +| g_regime_change | 24 / 24 | 0.157 | 0.273 | +| h_hetero_sweep | 24 / 24 | 0.152 | 0.183 | + +shuffled worse in 192 / 192 runs: CONTROL PASS (majority) + +## 4. Regime grid (pre-registered thresholds): PRIMARY measure = completions NRMSE of runs with cv_demand < Y and top5 share < Z (composite beside it) + +| Y (cv) | Z (top5) | runs | mean completions NRMSE | p90 | max | mean composite | p90 composite | runs also arrival_cv < 0.50 | p90 completions NRMSE (that subset) | +|---|---|---|---|---|---|---|---|---|---| +| 0.4 | 0.10 | 120 | 0.131 | 0.183 | 0.254 | 0.146 | 0.218 | 49 | 0.116 | +| 0.4 | 0.20 | 126 | 0.132 | 0.183 | 0.254 | 0.145 | 0.218 | 55 | 0.138 | +| 0.4 | 0.30 | 126 | 0.132 | 0.183 | 0.254 | 0.145 | 0.218 | 55 | 0.138 | +| 0.8 | 0.10 | 120 | 0.131 | 0.183 | 0.254 | 0.146 | 0.218 | 49 | 0.116 | +| 0.8 | 0.20 | 129 | 0.133 | 0.183 | 0.254 | 0.145 | 0.217 | 58 | 0.155 | +| 0.8 | 0.30 | 132 | 0.134 | 0.184 | 0.254 | 0.145 | 0.217 | 61 | 0.164 | +| 1.2 | 0.10 | 120 | 0.131 | 0.183 | 0.254 | 0.146 | 0.218 | 49 | 0.116 | +| 1.2 | 0.20 | 129 | 0.133 | 0.183 | 0.254 | 0.145 | 0.217 | 58 | 0.155 | +| 1.2 | 0.30 | 155 | 0.137 | 0.184 | 0.254 | 0.146 | 0.210 | 84 | 0.166 | + +complement (cv >= 1.2 or top5 >= 0.30): 37 runs, mean completions NRMSE 0.218, p10 0.189, p90 0.256 +temporal complement (arrival_cv >= 0.50): 71 runs, mean completions NRMSE 0.148, p10 0.095, p90 0.195 + +Verdict line: EXPERIMENTAL; recommends a future regime classifier; nothing inserted into production. diff --git a/mk/.crumb b/mk/.crumb index a659d4fd8..b8591e3d9 100644 --- a/mk/.crumb +++ b/mk/.crumb @@ -7,14 +7,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-04T18:16:52Z", + "compiled_at": "2026-10-04T18:38:56Z", "compiler": "crumb-compile/1", - "digest": "sha256:4bd9775399bb986340328ed1b843506e06ba0cd3126269518e85669c3b79417f", + "digest": "sha256:322e59de081336c07865c29e4143728f3b25333ecd102f662a319074fca76f5c", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 50, - "generated_at_commit": "41dcb768a955c1027d60d8b86d4ff6629118b9e6", - "source_tree": "sha256:078bf208413c507fba44fb779fa801998ee5f961aae7cb0575d3957c1eaf5ca8" + "files": 51, + "generated_at_commit": "3bebcc68321fcc876b88df129f41d6190411a926", + "source_tree": "sha256:bd6e0dd0b4f8b32551e3c35f14fc530b77bd33fbb53fb9c4ad61b13d6ae04f13" }, "owner_lane": "", "provenance": { diff --git a/mk/dual_applicability.mk b/mk/dual_applicability.mk new file mode 100644 index 000000000..687545a56 --- /dev/null +++ b/mk/dual_applicability.mk @@ -0,0 +1,53 @@ +# DUAL applicability experiment (ARCH-0031 / ADR 0031, offline evidence lane): +# when is aggregate (macroscopic) load control predictive, and when must +# discrete per-item scheduling dominate? Standalone: new files only under +# src/dual_experiment/, tools/dual_experiment/, tests/dual_experiment/, +# docs/dual/, evidence/DUAL/applicability/. Picked up by `-include mk/*.mk`; +# not part of `all` or `test`. Nothing in src/runtime/ includes or links it. +# EXPERIMENT ONLY: no production gate, no production classifier. +# +# test-dual-applicability unit suite (determinism, ledger, predictor, controls), +# plain + ASan/UBSan, plus the purity check +# dual-applic-purity nm -u on every src/dual_experiment object +# dual-applic-run run the campaign, write evidence/DUAL/applicability/ +ifndef DUAL_APPLICABILITY_MK +DUAL_APPLICABILITY_MK := 1 +include mk/estimation.mk +.PHONY: test-dual-applicability dual-applic-purity dual-applic-run +DAP_CFLAGS = $(EST_CFLAGS) -Isrc/dual_experiment +DAP_DIR = $(OUT_DIR)/dual-applicability +DAP_SRCS = src/dual_experiment/applic_sim.c src/dual_experiment/applic_predict.c src/dual_experiment/applic_metrics.c src/sha256.c +DAP_HDRS = src/dual_experiment/applic.h src/dual_experiment/applic_params.h src/sha256.h +DAP_EVIDENCE = evidence/DUAL/applicability + +$(DAP_DIR)/%.o: src/dual_experiment/%.c $(DAP_HDRS) + @mkdir -p $(DAP_DIR) + $(CC) $(DAP_CFLAGS) -c -o $@ $< + +# The experiment library is a calculator: no authority, World, generation, +# capability, memory-mapping, process or file operations. +dual-applic-purity: $(DAP_DIR)/applic_sim.o $(DAP_DIR)/applic_predict.o $(DAP_DIR)/applic_metrics.o + @if nm -u $^ | grep -E $(EST_FORBIDDEN) ; then \ + echo "dual_experiment object references an operation an experiment library must not have"; exit 1; fi + @echo "dual-applic-purity: applic_sim.o, applic_predict.o and applic_metrics.o reference no forbidden symbol" + +$(DAP_DIR)/test_applic: tests/dual_experiment/test_applic.c $(DAP_SRCS) $(DAP_HDRS) + @mkdir -p $(DAP_DIR) + $(CC) $(DAP_CFLAGS) -o $@ tests/dual_experiment/test_applic.c $(DAP_SRCS) -lm +$(DAP_DIR)/test_applic_asan: tests/dual_experiment/test_applic.c $(DAP_SRCS) $(DAP_HDRS) + @mkdir -p $(DAP_DIR) + $(CC) $(DAP_CFLAGS) $(EST_ASAN) -o $@ tests/dual_experiment/test_applic.c $(DAP_SRCS) -lm + +$(DAP_DIR)/applic_run: tools/dual_experiment/applic_run.c $(DAP_SRCS) $(DAP_HDRS) + @mkdir -p $(DAP_DIR) + $(CC) $(DAP_CFLAGS) -o $@ tools/dual_experiment/applic_run.c $(DAP_SRCS) -lm + +test-dual-applicability: dual-applic-purity $(DAP_DIR)/test_applic $(DAP_DIR)/test_applic_asan + ./$(DAP_DIR)/test_applic + ./$(DAP_DIR)/test_applic_asan + @echo "test-dual-applicability: determinism, ledger, predictor and negative-control checks pass in plain and ASan/UBSan builds" + +dual-applic-run: $(DAP_DIR)/applic_run + @mkdir -p $(DAP_EVIDENCE) + ./$(DAP_DIR)/applic_run $(DAP_EVIDENCE) +endif diff --git a/src/.crumb b/src/.crumb index 56d340d21..91ed38273 100644 --- a/src/.crumb +++ b/src/.crumb @@ -90,6 +90,12 @@ "name": "crumbline", "purpose": "Directory src/crumbline. Purpose not yet described by a human." }, + { + "digest": "945ae745a338467614bee287efb628f38f53ad83e4842c1a7fbf7d0b91a8da57", + "last_commit": "", + "name": "dual_experiment", + "purpose": "DUAL applicability experiment library (ARCH-0031 offline evidence lane): deterministic discrete " + }, { "digest": "62a0884e7f075eb3c92b22fc400234a06bd8c3020fc75e55a9b0c0f0f6a26d7e", "last_commit": "1a147e4", @@ -163,15 +169,15 @@ "purpose": "Directory src/visor. Purpose not yet described by a human." } ], - "children_root": "sha256:342b19861dd2ee471546469278de0fa357eed3720995ee57366bbaaf75cf4f49", - "compiled_at": "2026-10-04T18:16:52Z", + "children_root": "sha256:012a29562eacfedf192c3784423554a0e6bb28432e32d1c4b36b24dd9d7884f0", + "compiled_at": "2026-10-04T18:38:56Z", "compiler": "crumb-compile/1", - "digest": "sha256:4507760d5412654a2c14457a0a900a76a54dd99729acb54d764925bc6dad4d2b", + "digest": "sha256:0f3a63e432e9beed1a353d1570bc416f0bae07e99a45be15b0b885cbbedfb8ea", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 396, - "generated_at_commit": "41dcb768a955c1027d60d8b86d4ff6629118b9e6", - "source_tree": "sha256:ae9262b9e9d06668b482e95027148f7c5df9a94c6a276adaf19e02588f09c29e" + "files": 401, + "generated_at_commit": "3bebcc68321fcc876b88df129f41d6190411a926", + "source_tree": "sha256:e2650d5adf6e6892199cd649097d7c347bf6240a1b743c79431d744358ede5a0" }, "owner_lane": "", "provenance": { diff --git a/src/dual_experiment/.crumb b/src/dual_experiment/.crumb new file mode 100644 index 000000000..24ce183c0 --- /dev/null +++ b/src/dual_experiment/.crumb @@ -0,0 +1,19 @@ +{ + "extensions": { + "generated": { + "children": [], + "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "compiled_at": "2026-10-04T18:11:13Z", + "compiler": "crumb-compile/1", + "digest": "sha256:945ae745a338467614bee287efb628f38f53ad83e4842c1a7fbf7d0b91a8da57", + "evidence_files": 0, + "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "files": 5, + "generated_at_commit": "cb7cc216147664549484fcca8e8ceadbd6f6cdbf", + "source_tree": "sha256:4db0b6ac2d69acee18b953ab7d5fe77bafb2c577c30ce33bb79a25ed088944ea" + } + }, + "name": "dual_experiment", + "purpose": "DUAL applicability experiment library (ARCH-0031 offline evidence lane): deterministic discrete workload simulator with exact ledger, aggregate flow-balance predictor, heterogeneity measurements, campaign driver, digests. Pure calculator: no I/O, no allocation, no globals; nm -u purity check. EXPERIMENT ONLY, never linked by src/runtime/.", + "schema_version": "1.0.0" +} diff --git a/src/dual_experiment/applic.h b/src/dual_experiment/applic.h new file mode 100644 index 000000000..b089892cd --- /dev/null +++ b/src/dual_experiment/applic.h @@ -0,0 +1,129 @@ +/* DUAL applicability experiment: deterministic discrete workload simulator, + * aggregate (macroscopic) predictor, heterogeneity measurements, campaign. + * Plain C11, no I/O, no allocation, no globals (the caller owns ap_sim). + * Vocabulary: heterogeneity, concentration, regime, aggregate predictor. */ +#ifndef DUAL_APPLIC_H +#define DUAL_APPLIC_H + +#include +#include +#include "applic_params.h" + +typedef enum { + AP_WL_HOMOGENEOUS = 0, /* (a) many near-identical items */ + AP_WL_HETEROGENEOUS, /* (b) long-tailed service, few items hold most load */ + AP_WL_STEP, /* (c) arrival rate steps up mid-run */ + AP_WL_SQUARE, /* (d) square-wave congestion */ + AP_WL_BURSTY, /* (e) bursty arrivals */ + AP_WL_CAPACITY_DROP, /* (f) slot capacity reduced mid-run */ + AP_WL_REGIME_CHANGE, /* (g) item family a -> b mid-run */ + AP_WL_HETERO_SWEEP, /* (h) heterogeneous family, spread rises with seed index, constant offered load */ + AP_WL_COUNT +} ap_workload; + +typedef struct { uint64_t s; } ap_rng; +uint64_t ap_rng_next(ap_rng *r); +double ap_rng_unit(ap_rng *r); /* [0, 1) */ + +typedef struct { + uint32_t arrival; /* step of arrival */ + uint32_t demand0; /* service demand in steps */ + uint32_t remaining; + uint16_t mem; /* memory units held while running */ + uint8_t slots; /* slots held while running */ + uint8_t cls; /* queue class, 0 = highest priority */ +} ap_item; + +/* Aggregates observed at the close of one window. The predictor sees only + * this record (densities, rates, running means), never the item list. */ +typedef struct { + double used_slots_frac, used_mem_frac, queue_density; + uint32_t arrivals, completions, blocked_steps, rejected; + uint32_t in_system, queue_len, running, slots_capacity; + double mean_demand, mean_slots, mean_mem; /* running means over completions */ +} ap_window; + +typedef struct { + ap_item items[AP_MAX_ITEMS]; + uint32_t n_items; + uint32_t queue[AP_MAX_QUEUE]; + uint32_t queue_len; + uint32_t running[AP_SLOTS]; + uint32_t running_len; + uint32_t used_slots, used_mem, slots_capacity; + uint64_t arrived, completed, rejected, pool_exhausted; + double sum_demand, sum_slots, sum_mem; + uint64_t n_completed_stats; + ap_window windows[AP_WINDOWS]; + uint32_t n_windows; + ap_rng rng; + ap_workload wl; + double het_sigma; /* log-spread of the heterogeneous family for this run */ + double sweep_rate; /* arrival rate for (h); 0 elsewhere */ + uint32_t step; + uint32_t w_arrivals, w_completions, w_blocked, w_rejected; +} ap_sim; + +void ap_sim_init(ap_sim *s, ap_workload wl, uint64_t seed); +/* (h): sets het_sigma and the arrival rate that keeps offered load at + * AP_SWEEP_LOAD for that sigma. Other workloads ignore seed_index here. */ +void ap_sim_init_indexed(ap_sim *s, ap_workload wl, uint64_t seed, uint32_t seed_index); +double ap_sweep_sigma(uint32_t seed_index); +int ap_sim_step(ap_sim *s); /* 0 ok; 1 ledger violation; 2 pool exhausted */ +int ap_sim_ledger_ok(const ap_sim *s); /* arrived == completed + queued + running + rejected */ +int ap_sim_run(ap_sim *s); /* all AP_STEPS; 0 only if every step returned 0 */ + +typedef struct { double completions, queue_density, blocked; } ap_prediction; +ap_prediction ap_predict(const ap_window *w); /* next window from this window's aggregates */ + +typedef struct { + double completions_nrmse; /* RMSE / mean actual completions per window */ + double queue_rmse; /* queue density is already in [0,1] */ + double blocked_rmse; /* blocked fraction is already in [0,1] */ + double composite; /* mean of the three */ + uint32_t windows; /* windows scored */ +} ap_error; +ap_error ap_error_real(const ap_sim *s); +/* Same aggregate model fed the NEXT window's true arrival count: isolates + * aggregation error from arrival-forecast error. Still aggregate-only. */ +ap_error ap_error_known_arrivals(const ap_sim *s); +/* Negative control: predict window t+1 from the aggregates of window + * ((t + offset) mod scored), offset in [1, scored-1]: the labels are shuffled. */ +ap_error ap_error_shuffled(const ap_sim *s, uint32_t offset); + +typedef struct { + double cv_demand; /* coefficient of variation of service demand */ + double top_share; /* load share of the top ceil(5%) items (load = demand * slots) */ + double max_item_share; /* load share of the single largest item */ + double class_entropy; /* normalized Shannon entropy of class mix, [0,1] */ + double arrival_cv; /* CV of per-window arrival counts (temporal heterogeneity) */ + double broken_const; /* negative control: constant */ + double broken_noise; /* negative control: seeded noise independent of the run */ +} ap_hetero; +ap_hetero ap_measure(const ap_sim *s, uint32_t *scratch /* AP_MAX_ITEMS */, ap_rng *noise); + +typedef struct { + uint8_t wl; + uint32_t seed_index; + uint64_t seed; + uint64_t arrived, completed, rejected; + ap_error real, known_arrivals, shuffled; + ap_hetero h; +} ap_row; + +uint64_t ap_seed(ap_workload wl, uint32_t seed_index); +/* Runs AP_WL_COUNT * AP_SEEDS runs into rows (capacity max_rows). scratch is + * caller-owned (one ap_sim plus AP_MAX_ITEMS uint32). Returns 0 on success. */ +int ap_campaign(ap_sim *scratch, uint32_t *scratch_idx, ap_row *rows, size_t max_rows, size_t *n_out); + +const char *ap_workload_name(ap_workload wl); +const char *ap_row_header(void); +int ap_row_format(const ap_row *r, char *buf, size_t n); /* one CSV line, no newline */ +void ap_rows_digest(const ap_row *rows, size_t n, uint8_t out[32]); /* over CSV text */ +int ap_params_text(char *buf, size_t n); +void ap_params_digest(uint8_t out[32]); +/* Pearson r over n pairs; cov_out receives the raw covariance. Zero variance + * in either series yields r = 0 (reported, never NaN). */ +double ap_pearson(const double *x, const double *y, size_t n, double *cov_out); + +#endif diff --git a/src/dual_experiment/applic_metrics.c b/src/dual_experiment/applic_metrics.c new file mode 100644 index 000000000..b4d7fa41c --- /dev/null +++ b/src/dual_experiment/applic_metrics.c @@ -0,0 +1,211 @@ +/* Heterogeneity measurements, campaign driver, canonical row text, digests + * and Pearson correlation for the DUAL applicability experiment. */ +#include "applic.h" +#include "sha256.h" + +#include +#include +#include + +/* load of one item in slot-steps */ +static double item_load(const ap_item *it) { return (double)it->demand0 * (double)it->slots; } + +/* Deterministic in-place heapsort of item indexes by load, descending; ties + * broken by index so the order never depends on the sort algorithm. */ +static int load_before(const ap_sim *s, uint32_t a, uint32_t b) +{ + double la = item_load(&s->items[a]), lb = item_load(&s->items[b]); + if (la != lb) return la > lb; + return a < b; +} +static void sift(const ap_sim *s, uint32_t *idx, uint32_t root, uint32_t n) +{ + /* max-heap on "smaller load first" so that popping yields descending order */ + for (;;) { + uint32_t child = 2u * root + 1u, pick = root, tmp; + if (child >= n) return; + if (!load_before(s, idx[child], idx[pick])) pick = child; + if (child + 1u < n && !load_before(s, idx[child + 1u], idx[pick])) pick = child + 1u; + if (pick == root) return; + tmp = idx[root]; idx[root] = idx[pick]; idx[pick] = tmp; root = pick; + } +} +static void sort_desc(const ap_sim *s, uint32_t *idx, uint32_t n) +{ + uint32_t i; + if (n < 2) return; + for (i = n / 2u; i-- > 0;) sift(s, idx, i, n); + for (i = n - 1u; i > 0; i--) { uint32_t t = idx[0]; idx[0] = idx[i]; idx[i] = t; sift(s, idx, 0, i); } +} + +ap_hetero ap_measure(const ap_sim *s, uint32_t *idx, ap_rng *noise) +{ + ap_hetero h; + uint32_t n = s->n_items, i, k; + double sum = 0.0, sum2 = 0.0, total_load = 0.0, top = 0.0; + uint32_t cls_count[AP_CLASSES]; + memset(&h, 0, sizeof h); + memset(cls_count, 0, sizeof cls_count); + h.broken_const = AP_BROKEN_CONST; + h.broken_noise = ap_rng_unit(noise); + if (n == 0) return h; + for (i = 0; i < n; i++) { + double d = (double)s->items[i].demand0; + sum += d; sum2 += d * d; total_load += item_load(&s->items[i]); + cls_count[s->items[i].cls]++; idx[i] = i; + } + { + double mean = sum / (double)n, var = sum2 / (double)n - mean * mean; + if (var < 0.0) var = 0.0; + h.cv_demand = mean > 0.0 ? sqrt(var) / mean : 0.0; + } + sort_desc(s, idx, n); + k = (uint32_t)ceil(AP_TOP_SHARE_FRACTION * (double)n); + if (k < 1u) k = 1u; + if (k > n) k = n; + for (i = 0; i < k; i++) top += item_load(&s->items[idx[i]]); + h.top_share = total_load > 0.0 ? top / total_load : 0.0; + h.max_item_share = total_load > 0.0 ? item_load(&s->items[idx[0]]) / total_load : 0.0; + { + double H = 0.0; + for (i = 0; i < AP_CLASSES; i++) { + double p = (double)cls_count[i] / (double)n; + if (p > 0.0) H -= p * log2(p); + } + h.class_entropy = H / log2((double)AP_CLASSES); + } + { + double a = 0.0, a2 = 0.0, m, v; + for (i = 0; i < s->n_windows; i++) { double x = (double)s->windows[i].arrivals; a += x; a2 += x * x; } + if (s->n_windows) { + m = a / (double)s->n_windows; v = a2 / (double)s->n_windows - m * m; + if (v < 0.0) v = 0.0; + h.arrival_cv = m > 0.0 ? sqrt(v) / m : 0.0; + } + } + return h; +} + +int ap_campaign(ap_sim *scratch, uint32_t *scratch_idx, ap_row *rows, size_t max_rows, size_t *n_out) +{ + size_t n = 0; + uint32_t wl, si; + *n_out = 0; + for (wl = 0; wl < (uint32_t)AP_WL_COUNT; wl++) { + for (si = 0; si < AP_SEEDS; si++) { + ap_row *r; + ap_rng noise; + if (n >= max_rows) return -1; + r = &rows[n]; + memset(r, 0, sizeof *r); + r->wl = (uint8_t)wl; r->seed_index = si; r->seed = ap_seed((ap_workload)wl, si); + ap_sim_init_indexed(scratch, (ap_workload)wl, r->seed, si); + if (ap_sim_run(scratch) != 0) return -2; + r->arrived = scratch->arrived; r->completed = scratch->completed; r->rejected = scratch->rejected; + r->real = ap_error_real(scratch); + r->known_arrivals = ap_error_known_arrivals(scratch); + r->shuffled = ap_error_shuffled(scratch, (uint32_t)(r->seed >> 7)); + noise.s = r->seed ^ 0xA5A5A5A5A5A5A5A5ull; + if (!noise.s) noise.s = 1u; + r->h = ap_measure(scratch, scratch_idx, &noise); + n++; + } + } + *n_out = n; + return 0; +} + +const char *ap_row_header(void) +{ + return "workload,seed_index,seed,arrived,completed,rejected,windows," + "err_completions_nrmse,err_queue_rmse,err_blocked_rmse,err_composite," + "known_completions_nrmse,known_queue_rmse,known_blocked_rmse,known_composite," + "shuf_completions_nrmse,shuf_queue_rmse,shuf_blocked_rmse,shuf_composite," + "cv_demand,top5_share,max_item_share,class_entropy,arrival_cv,broken_const,broken_noise"; +} + +int ap_row_format(const ap_row *r, char *buf, size_t n) +{ + int w = snprintf(buf, n, "%s,%u,%016llx,%llu,%llu,%llu,%u," + "%.6f,%.6f,%.6f,%.6f,%.6f,%.6f,%.6f,%.6f,%.6f,%.6f,%.6f,%.6f," + "%.6f,%.6f,%.6f,%.6f,%.6f,%.6f,%.6f", + ap_workload_name((ap_workload)r->wl), r->seed_index, (unsigned long long)r->seed, + (unsigned long long)r->arrived, (unsigned long long)r->completed, (unsigned long long)r->rejected, + r->real.windows, + r->real.completions_nrmse, r->real.queue_rmse, r->real.blocked_rmse, r->real.composite, + r->known_arrivals.completions_nrmse, r->known_arrivals.queue_rmse, r->known_arrivals.blocked_rmse, r->known_arrivals.composite, + r->shuffled.completions_nrmse, r->shuffled.queue_rmse, r->shuffled.blocked_rmse, r->shuffled.composite, + r->h.cv_demand, r->h.top_share, r->h.max_item_share, r->h.class_entropy, r->h.arrival_cv, + r->h.broken_const, r->h.broken_noise); + return (w < 0 || (size_t)w >= n) ? -1 : w; +} + +void ap_rows_digest(const ap_row *rows, size_t n, uint8_t out[32]) +{ + sha256_ctx c; + char line[512]; + size_t i; + const char *hdr = ap_row_header(); + sha256_init(&c); + sha256_update(&c, (const uint8_t *)hdr, strlen(hdr)); + sha256_update(&c, (const uint8_t *)"\n", 1); + for (i = 0; i < n; i++) { + int w = ap_row_format(&rows[i], line, sizeof line); + if (w < 0) continue; + sha256_update(&c, (const uint8_t *)line, (size_t)w); + sha256_update(&c, (const uint8_t *)"\n", 1); + } + sha256_final(&c, out); +} + +int ap_params_text(char *buf, size_t n) +{ + static const double grid_cv[AP_GRID_CV_COUNT] = AP_GRID_CV; + static const double grid_top[AP_GRID_TOP_COUNT] = AP_GRID_TOP; + int w = snprintf(buf, n, + "experiment=%s\nwindow=%u\nwindows=%u\nwarmup_windows=%u\nslots=%u\nmemory=%u\nmax_queue=%u\nclasses=%u\nmax_items=%u\n" + "hom_demand=%u..%u\nhom_mem=%u..%u\nhom_slots=%u\n" + "het_ln_median=%.16g\nhet_sigma=%.16g\nhet_demand_cap=%u\nhet_slots_p=%.6f,%.6f\nhet_mem_base=%u\nhet_mem_span=%.6f\nhet_class_p=%.6f,%.6f,%.6f\n" + "rate_hom=%.6f\nrate_het=%.6f\nstep_rate=%.6f,%.6f\nsquare_rate=%.6f,%.6f\nsquare_half_period=%u\n" + "burst_p=%.6f\nburst_size=%u..%u\nburst_background=%.6f\ncap_drop_slots=%u\nswitch_step=%u\n" + "sweep_sigma=%.6f..%.6f\nsweep_load=%.6f\nhet_mean_slots=%.6f\n" + "prior_demand=%.6f\nprior_slots=%.6f\nprior_mem=%.6f\n" + "seeds=%u\nseed_base=%016llx\ntop_share_fraction=%.6f\n" + "grid_cv=%.6f,%.6f,%.6f\ngrid_top=%.6f,%.6f,%.6f\ngrid_arrival_cv=%.6f\nbroken_const=%.6f\n" + "blocked_ramp_start=%.6f\npredictor=flow_balance_v2\nerror=completions_nrmse,queue_rmse,blocked_rmse,composite_mean\nprimary_measure=completions_nrmse\n", + AP_EXPERIMENT_NAME, AP_WINDOW, AP_WINDOWS, AP_WARMUP_WINDOWS, AP_SLOTS, AP_MEMORY, AP_MAX_QUEUE, AP_CLASSES, AP_MAX_ITEMS, + AP_HOM_DEMAND_MIN, AP_HOM_DEMAND_MAX, AP_HOM_MEM_MIN, AP_HOM_MEM_MAX, AP_HOM_SLOTS, + AP_HET_LN_MEDIAN, AP_HET_SIGMA, AP_HET_DEMAND_CAP, AP_HET_SLOTS_P1, AP_HET_SLOTS_P2, AP_HET_MEM_BASE, AP_HET_MEM_SPAN, + AP_HET_CLASS_P0, AP_HET_CLASS_P1, AP_HET_CLASS_P2, + AP_RATE_HOM, AP_RATE_HET, AP_STEP_RATE_LOW, AP_STEP_RATE_HIGH, AP_SQUARE_RATE_LOW, AP_SQUARE_RATE_HIGH, AP_SQUARE_HALF_PERIOD, + AP_BURST_P, AP_BURST_MIN, AP_BURST_MAX, AP_BURST_BACKGROUND, AP_CAP_DROP_SLOTS, AP_SWITCH_STEP, + AP_SWEEP_SIGMA_MIN, AP_SWEEP_SIGMA_MAX, AP_SWEEP_LOAD, AP_HET_MEAN_SLOTS, + AP_PRIOR_DEMAND, AP_PRIOR_SLOTS, AP_PRIOR_MEM, + AP_SEEDS, (unsigned long long)AP_SEED_BASE, AP_TOP_SHARE_FRACTION, + grid_cv[0], grid_cv[1], grid_cv[2], grid_top[0], grid_top[1], grid_top[2], AP_GRID_ARRIVAL_CV, AP_BROKEN_CONST, AP_BLOCKED_RAMP_START); + return (w < 0 || (size_t)w >= n) ? -1 : w; +} + +void ap_params_digest(uint8_t out[32]) +{ + char buf[2048]; + int w = ap_params_text(buf, sizeof buf); + sha256_hash((const uint8_t *)buf, w < 0 ? 0u : (size_t)w, out); +} + +double ap_pearson(const double *x, const double *y, size_t n, double *cov_out) +{ + double mx = 0.0, my = 0.0, sxx = 0.0, syy = 0.0, sxy = 0.0; + size_t i; + if (cov_out) *cov_out = 0.0; + if (n < 2) return 0.0; + for (i = 0; i < n; i++) { mx += x[i]; my += y[i]; } + mx /= (double)n; my /= (double)n; + for (i = 0; i < n; i++) { + double dx = x[i] - mx, dy = y[i] - my; + sxx += dx * dx; syy += dy * dy; sxy += dx * dy; + } + if (cov_out) *cov_out = sxy / (double)(n - 1); + if (sxx <= 0.0 || syy <= 0.0) return 0.0; + return sxy / sqrt(sxx * syy); +} diff --git a/src/dual_experiment/applic_params.h b/src/dual_experiment/applic_params.h new file mode 100644 index 000000000..484bd1d6a --- /dev/null +++ b/src/dual_experiment/applic_params.h @@ -0,0 +1,86 @@ +/* DUAL applicability experiment (ARCH-0031 / ADR 0031, offline evidence lane): + * pre-registered parameters. Every constant below is part of the experiment + * identity: ap_params_digest() hashes the canonical text of these values + * (ap_params_text) and the digest is written into every results file. A + * change to any value is a new experiment version, never a rescoring. + * + * This is an EXPERIMENT, not a production gate and not a production + * classifier. Nothing here is linked by src/runtime/. */ +#ifndef DUAL_APPLIC_PARAMS_H +#define DUAL_APPLIC_PARAMS_H + +#define AP_EXPERIMENT_NAME "DUAL-APPLIC-V1" + +/* --- time --- */ +#define AP_WINDOW 20u /* steps per aggregate window */ +#define AP_WINDOWS 100u /* windows per run */ +#define AP_STEPS (AP_WINDOW * AP_WINDOWS) +#define AP_WARMUP_WINDOWS 5u /* windows excluded from error scoring */ + +/* --- capacity --- */ +#define AP_SLOTS 32u /* slot capacity (service lanes) */ +#define AP_MEMORY 1024u /* memory budget in units */ +#define AP_MAX_QUEUE 256u /* queue capacity; overflow is REJECTED (ledgered) */ +#define AP_CLASSES 4u /* queue classes, 0 = highest priority */ +#define AP_MAX_ITEMS 32768u /* bounded pool per run; exhaustion fails the run */ + +/* --- homogeneous item family (workloads a, c, d, e, f, first half of g) --- */ +#define AP_HOM_DEMAND_MIN 11u /* service demand in steps, uniform [MIN, MAX] */ +#define AP_HOM_DEMAND_MAX 13u +#define AP_HOM_MEM_MIN 16u +#define AP_HOM_MEM_MAX 24u +#define AP_HOM_SLOTS 1u + +/* --- heterogeneous tool-heavy item family (workload b, second half of g) --- + * demand = clamp(round(exp(LN_MEDIAN + SIGMA * z)), 1, DEMAND_CAP), z ~ N(0,1) */ +#define AP_HET_LN_MEDIAN 1.7917594692280550 /* ln 6 */ +#define AP_HET_SIGMA 1.2 +#define AP_HET_DEMAND_CAP 400u +#define AP_HET_SLOTS_P1 0.70 /* P(slots = 1); P(2) = P2 - P1; else 4 */ +#define AP_HET_SLOTS_P2 0.90 +#define AP_HET_MEM_BASE 8u /* mem = BASE + round(SPAN * u^3) */ +#define AP_HET_MEM_SPAN 120.0 +#define AP_HET_CLASS_P0 0.55 /* cumulative class probabilities */ +#define AP_HET_CLASS_P1 0.80 +#define AP_HET_CLASS_P2 0.95 + +/* --- arrival processes (items per step, Poisson unless stated) --- */ +#define AP_RATE_HOM 2.2 /* (a), (f) before the drop, (g) first half */ +#define AP_RATE_HET 1.2 /* (b), (g) second half */ +#define AP_STEP_RATE_LOW 1.0 /* (c) before AP_SWITCH_STEP */ +#define AP_STEP_RATE_HIGH 3.0 /* (c) after */ +#define AP_SQUARE_RATE_LOW 0.8 /* (d) alternating every AP_SQUARE_HALF_PERIOD steps */ +#define AP_SQUARE_RATE_HIGH 3.2 +#define AP_SQUARE_HALF_PERIOD 100u +#define AP_BURST_P 0.08 /* (e) per-step burst probability */ +#define AP_BURST_MIN 15u /* (e) burst size uniform [MIN, MAX] */ +#define AP_BURST_MAX 35u +#define AP_BURST_BACKGROUND 0.4 /* (e) Poisson rate on non-burst steps */ +#define AP_CAP_DROP_SLOTS 20u /* (f) slot capacity after AP_SWITCH_STEP */ +#define AP_SWITCH_STEP (AP_STEPS / 2u) + +/* --- (h) heterogeneity sweep: sigma = MIN + (MAX - MIN) * seed_index / (AP_SEEDS - 1); + * rate = LOAD * slots / (exp(LN_MEDIAN + sigma^2 / 2) * E[slots]) so offered load stays at LOAD --- */ +#define AP_SWEEP_SIGMA_MIN 0.0 +#define AP_SWEEP_SIGMA_MAX 1.5 +#define AP_SWEEP_LOAD 0.80 +#define AP_HET_MEAN_SLOTS 1.7 /* 0.7*1 + 0.2*2 + 0.1*4 */ + +/* --- aggregate predictor priors (used until the first completion) --- */ +#define AP_PRIOR_DEMAND 12.0 +#define AP_PRIOR_SLOTS 1.0 +#define AP_PRIOR_MEM 20.0 +#define AP_BLOCKED_RAMP_START 0.75 /* predicted blocked fraction ramps 0 -> 1 as predicted occupancy goes RAMP_START -> 1 */ + +/* --- analysis --- */ +#define AP_SEEDS 24u /* seeds per workload (>= 20 pre-registered) */ +#define AP_SEED_BASE 0x4455414C2D415031ull /* "DUAL-AP1" */ +#define AP_TOP_SHARE_FRACTION 0.05 /* top-k concentration, k = ceil(5% of items) */ +#define AP_GRID_CV_COUNT 3u +#define AP_GRID_TOP_COUNT 3u +#define AP_GRID_CV {0.4, 0.8, 1.2} +#define AP_GRID_TOP {0.10, 0.20, 0.30} +#define AP_GRID_ARRIVAL_CV 0.5 +#define AP_BROKEN_CONST 0.5 /* negative control: constant "metric" */ + +#endif diff --git a/src/dual_experiment/applic_predict.c b/src/dual_experiment/applic_predict.c new file mode 100644 index 000000000..39e1261e7 --- /dev/null +++ b/src/dual_experiment/applic_predict.c @@ -0,0 +1,94 @@ +/* Aggregate (macroscopic) predictor and its error against the exact discrete + * outcome. The predictor sees one ap_window record only: densities, last + * window's arrival count, the counts in system, and running means over + * completed items. It never sees the item list. Flow balance (v2): + * resident_cap = min(slots / mean_slots, memory / mean_mem) items + * cap_W = resident_cap * W / mean_demand max completions in a window + * frac = min(1, W / mean_demand) share of a resident item finished within W + * completions = min(cap_W, running*frac + queue*frac + A*max(0, W - mean_demand)/W) + * in_next = in_system + A - completions + * queue = max(0, in_next - resident_cap) / queue_max + * occupancy = in_next / resident_cap + * blocked = clamp((occupancy - RAMP_START) / (1 - RAMP_START), 0, 1) + * A is the arrival forecast: the last window's count (real predictor), the + * next window's true count (known-arrivals variant, isolates aggregation + * error from forecast error) or a shuffled window's record (negative control). + * These formulas are pre-registered. A first draft (v1) counted running items + * as newly offered work and always predicted full capacity; it was replaced + * before any result was recorded, and no v1 number is reported anywhere. */ +#include "applic.h" + +#include + +static double clamp01(double x) { return x < 0.0 ? 0.0 : (x > 1.0 ? 1.0 : x); } + +static ap_prediction predict_with_arrivals(const ap_window *w, double A) +{ + ap_prediction p; + double W = (double)AP_WINDOW; + double mean_d = w->mean_demand > 0.0 ? w->mean_demand : AP_PRIOR_DEMAND; + double mean_s = w->mean_slots > 0.0 ? w->mean_slots : AP_PRIOR_SLOTS; + double mean_m = w->mean_mem > 0.0 ? w->mean_mem : AP_PRIOR_MEM; + double by_slots = (double)w->slots_capacity / mean_s; + double by_mem = (double)AP_MEMORY / mean_m; + double resident_cap = by_slots < by_mem ? by_slots : by_mem; + double cap_W = resident_cap * W / mean_d; + double frac = W / mean_d < 1.0 ? W / mean_d : 1.0; + double late = (W - mean_d) > 0.0 ? (W - mean_d) / W : 0.0; + double flow = (double)w->running * frac + (double)w->queue_len * frac + A * late; + double in_next, occ; + p.completions = flow < cap_W ? flow : cap_W; + in_next = (double)w->in_system + A - p.completions; + if (in_next < 0.0) in_next = 0.0; + p.queue_density = clamp01((in_next - resident_cap) / (double)AP_MAX_QUEUE); + occ = resident_cap > 0.0 ? in_next / resident_cap : 1.0; + p.blocked = clamp01((occ - AP_BLOCKED_RAMP_START) / (1.0 - AP_BLOCKED_RAMP_START)); + return p; +} + +ap_prediction ap_predict(const ap_window *w) { return predict_with_arrivals(w, (double)w->arrivals); } + +/* mode 0: real (A = last window's arrivals); 1: known arrivals (A = next + * window's true count); 2: shuffled (record and A from window src). */ +static ap_error score(const ap_sim *s, int mode, uint32_t offset) +{ + ap_error e; + uint32_t first = AP_WARMUP_WINDOWS, last = s->n_windows ? s->n_windows - 1u : 0u; + uint32_t scored = last > first ? last - first : 0u; /* predictions for windows first+1..last */ + double se_c = 0.0, se_q = 0.0, se_b = 0.0, sum_actual_c = 0.0; + uint32_t t; + e.completions_nrmse = e.queue_rmse = e.blocked_rmse = e.composite = 0.0; + e.windows = scored; + if (scored == 0) return e; + for (t = first; t < last; t++) { + const ap_window *a = &s->windows[t + 1]; + uint32_t src = mode == 2 ? first + ((t - first + offset) % scored) : t; + ap_prediction p = mode == 1 ? predict_with_arrivals(&s->windows[t], (double)a->arrivals) + : ap_predict(&s->windows[src]); + double ac = (double)a->completions; + double ab = (double)a->blocked_steps / (double)AP_WINDOW; + se_c += (p.completions - ac) * (p.completions - ac); + se_q += (p.queue_density - a->queue_density) * (p.queue_density - a->queue_density); + se_b += (p.blocked - ab) * (p.blocked - ab); + sum_actual_c += ac; + } + { + double n = (double)scored, mean_c = sum_actual_c / n; + e.completions_nrmse = mean_c > 0.0 ? sqrt(se_c / n) / mean_c : sqrt(se_c / n); + e.queue_rmse = sqrt(se_q / n); + e.blocked_rmse = sqrt(se_b / n); + e.composite = (e.completions_nrmse + e.queue_rmse + e.blocked_rmse) / 3.0; + } + return e; +} + +ap_error ap_error_real(const ap_sim *s) { return score(s, 0, 0); } +ap_error ap_error_known_arrivals(const ap_sim *s) { return score(s, 1, 0); } +ap_error ap_error_shuffled(const ap_sim *s, uint32_t offset) +{ + uint32_t first = AP_WARMUP_WINDOWS, last = s->n_windows ? s->n_windows - 1u : 0u; + uint32_t scored = last > first ? last - first : 0u; + if (scored < 2) return score(s, 0, 0); + offset = 1u + (offset % (scored - 1u)); /* never the true window */ + return score(s, 2, offset); +} diff --git a/src/dual_experiment/applic_sim.c b/src/dual_experiment/applic_sim.c new file mode 100644 index 000000000..c848a2b4f --- /dev/null +++ b/src/dual_experiment/applic_sim.c @@ -0,0 +1,231 @@ +/* Deterministic discrete workload simulator for the DUAL applicability + * experiment. One step: arrivals (enqueue or REJECT when the queue is full), + * admission in class-then-FIFO order with backfill against slot and memory + * capacity, blocked check, then one unit of service for every running item + * and completion. The exact ledger + * arrived == completed + queued + running + rejected + * is checked after every step. No I/O, no allocation, no globals. */ +#include "applic.h" + +#include +#include + +uint64_t ap_rng_next(ap_rng *r) +{ + r->s ^= r->s >> 12; r->s ^= r->s << 25; r->s ^= r->s >> 27; + return r->s * 0x2545F4914F6CDD1Dull; +} +double ap_rng_unit(ap_rng *r) { return (double)(ap_rng_next(r) >> 11) / 9007199254740992.0; } + +static uint32_t rng_range(ap_rng *r, uint32_t lo, uint32_t hi) /* inclusive */ +{ + return lo + (uint32_t)(ap_rng_next(r) % (uint64_t)(hi - lo + 1u)); +} +/* Standard normal by Box-Muller; the pair's second value is discarded so the + * draw count per item is fixed. */ +static double rng_normal(ap_rng *r) +{ + double u1 = ap_rng_unit(r), u2 = ap_rng_unit(r); + if (u1 < 1e-300) u1 = 1e-300; + return sqrt(-2.0 * log(u1)) * cos(6.283185307179586 * u2); +} +/* Poisson count (Knuth); rates here are at most a few per step. */ +static uint32_t rng_poisson(ap_rng *r, double lambda) +{ + double L = exp(-lambda), p = 1.0; + uint32_t k = 0; + if (lambda <= 0.0) return 0; + do { k++; p *= ap_rng_unit(r); } while (p > L); + return k - 1u; +} + +/* ---- item families ---- */ +static void gen_homogeneous(ap_rng *r, ap_item *it) +{ + it->demand0 = rng_range(r, AP_HOM_DEMAND_MIN, AP_HOM_DEMAND_MAX); + it->mem = (uint16_t)rng_range(r, AP_HOM_MEM_MIN, AP_HOM_MEM_MAX); + it->slots = (uint8_t)AP_HOM_SLOTS; + it->cls = (uint8_t)rng_range(r, 0, AP_CLASSES - 1u); +} +static void gen_heterogeneous(ap_rng *r, ap_item *it, double sigma) +{ + double d = exp(AP_HET_LN_MEDIAN + sigma * rng_normal(r)); + double u; + if (d < 1.0) d = 1.0; + if (d > (double)AP_HET_DEMAND_CAP) d = (double)AP_HET_DEMAND_CAP; + it->demand0 = (uint32_t)floor(d + 0.5); + u = ap_rng_unit(r); + it->slots = (uint8_t)(u < AP_HET_SLOTS_P1 ? 1u : (u < AP_HET_SLOTS_P2 ? 2u : 4u)); + u = ap_rng_unit(r); + it->mem = (uint16_t)(AP_HET_MEM_BASE + (uint32_t)floor(AP_HET_MEM_SPAN * u * u * u + 0.5)); + u = ap_rng_unit(r); + it->cls = (uint8_t)(u < AP_HET_CLASS_P0 ? 0u : (u < AP_HET_CLASS_P1 ? 1u : (u < AP_HET_CLASS_P2 ? 2u : 3u))); +} + +/* ---- workload regime: arrivals this step, item family, capacity ---- */ +static int family_is_heterogeneous(ap_workload wl, uint32_t step) +{ + if (wl == AP_WL_HETEROGENEOUS || wl == AP_WL_HETERO_SWEEP) return 1; + if (wl == AP_WL_REGIME_CHANGE) return step >= AP_SWITCH_STEP; + return 0; +} +static uint32_t arrivals_this_step(ap_rng *r, ap_workload wl, uint32_t step, double sweep_rate) +{ + switch (wl) { + case AP_WL_HOMOGENEOUS: + case AP_WL_CAPACITY_DROP: return rng_poisson(r, AP_RATE_HOM); + case AP_WL_HETEROGENEOUS: return rng_poisson(r, AP_RATE_HET); + case AP_WL_STEP: return rng_poisson(r, step < AP_SWITCH_STEP ? AP_STEP_RATE_LOW : AP_STEP_RATE_HIGH); + case AP_WL_SQUARE: return rng_poisson(r, ((step / AP_SQUARE_HALF_PERIOD) & 1u) ? AP_SQUARE_RATE_HIGH : AP_SQUARE_RATE_LOW); + case AP_WL_BURSTY: + if (ap_rng_unit(r) < AP_BURST_P) return rng_range(r, AP_BURST_MIN, AP_BURST_MAX); + return rng_poisson(r, AP_BURST_BACKGROUND); + case AP_WL_REGIME_CHANGE: return rng_poisson(r, step < AP_SWITCH_STEP ? AP_RATE_HOM : AP_RATE_HET); + case AP_WL_HETERO_SWEEP: return rng_poisson(r, sweep_rate); + default: return 0; + } +} +static uint32_t capacity_this_step(ap_workload wl, uint32_t step) +{ + if (wl == AP_WL_CAPACITY_DROP && step >= AP_SWITCH_STEP) return AP_CAP_DROP_SLOTS; + return AP_SLOTS; +} + +uint64_t ap_seed(ap_workload wl, uint32_t seed_index) +{ + uint64_t s = AP_SEED_BASE ^ ((uint64_t)wl * 0x9E3779B97F4A7C15ull) ^ (((uint64_t)seed_index + 1u) * 0xD1B54A32D192ED03ull); + return s ? s : 1u; +} + +void ap_sim_init(ap_sim *s, ap_workload wl, uint64_t seed) +{ + memset(s, 0, sizeof *s); + s->wl = wl; + s->rng.s = seed ? seed : 1u; + s->slots_capacity = AP_SLOTS; + s->het_sigma = AP_HET_SIGMA; + s->sweep_rate = 0.0; +} + +double ap_sweep_sigma(uint32_t seed_index) +{ + double f = AP_SEEDS > 1u ? (double)seed_index / (double)(AP_SEEDS - 1u) : 0.0; + return AP_SWEEP_SIGMA_MIN + (AP_SWEEP_SIGMA_MAX - AP_SWEEP_SIGMA_MIN) * f; +} + +void ap_sim_init_indexed(ap_sim *s, ap_workload wl, uint64_t seed, uint32_t seed_index) +{ + ap_sim_init(s, wl, seed); + if (wl == AP_WL_HETERO_SWEEP) { + double sigma = ap_sweep_sigma(seed_index); + double mean_demand = exp(AP_HET_LN_MEDIAN + 0.5 * sigma * sigma); + s->het_sigma = sigma; + s->sweep_rate = AP_SWEEP_LOAD * (double)AP_SLOTS / (mean_demand * AP_HET_MEAN_SLOTS); + } +} + +int ap_sim_ledger_ok(const ap_sim *s) +{ + return s->arrived == s->completed + (uint64_t)s->queue_len + (uint64_t)s->running_len + s->rejected; +} + +static void close_window(ap_sim *s) +{ + ap_window *w = &s->windows[s->n_windows++]; + w->slots_capacity = s->slots_capacity; + w->used_slots_frac = (double)s->used_slots / (double)s->slots_capacity; + w->used_mem_frac = (double)s->used_mem / (double)AP_MEMORY; + w->queue_density = (double)s->queue_len / (double)AP_MAX_QUEUE; + w->arrivals = s->w_arrivals; w->completions = s->w_completions; + w->blocked_steps = s->w_blocked; w->rejected = s->w_rejected; + w->queue_len = s->queue_len; w->running = s->running_len; + w->in_system = s->queue_len + s->running_len; + if (s->n_completed_stats) { + double n = (double)s->n_completed_stats; + w->mean_demand = s->sum_demand / n; w->mean_slots = s->sum_slots / n; w->mean_mem = s->sum_mem / n; + } else { + w->mean_demand = AP_PRIOR_DEMAND; w->mean_slots = AP_PRIOR_SLOTS; w->mean_mem = AP_PRIOR_MEM; + } + s->w_arrivals = s->w_completions = s->w_blocked = s->w_rejected = 0; +} + +int ap_sim_step(ap_sim *s) +{ + uint32_t n, i, c; + if (s->step >= AP_STEPS) return 0; + s->slots_capacity = capacity_this_step(s->wl, s->step); + + /* 1. arrivals */ + n = arrivals_this_step(&s->rng, s->wl, s->step, s->sweep_rate); + for (i = 0; i < n; i++) { + ap_item it; + memset(&it, 0, sizeof it); + if (family_is_heterogeneous(s->wl, s->step)) gen_heterogeneous(&s->rng, &it, s->het_sigma); + else gen_homogeneous(&s->rng, &it); + it.arrival = s->step; it.remaining = it.demand0; + if (s->n_items >= AP_MAX_ITEMS) { s->pool_exhausted++; return 2; } + s->arrived++; s->w_arrivals++; + if (s->queue_len >= AP_MAX_QUEUE) { s->rejected++; s->w_rejected++; continue; } + s->items[s->n_items] = it; + s->queue[s->queue_len++] = s->n_items++; + } + + /* 2. admission: class order, FIFO within class, backfill */ + for (c = 0; c < AP_CLASSES; c++) { + i = 0; + while (i < s->queue_len) { + const ap_item *it = &s->items[s->queue[i]]; + if (it->cls == c && s->used_slots + it->slots <= s->slots_capacity + && s->used_mem + it->mem <= AP_MEMORY && s->running_len < AP_SLOTS) { + s->running[s->running_len++] = s->queue[i]; + s->used_slots += it->slots; s->used_mem += it->mem; + memmove(&s->queue[i], &s->queue[i + 1], (s->queue_len - i - 1u) * sizeof s->queue[0]); + s->queue_len--; + } else { + i++; + } + } + } + + /* 3. blocked: work waited that could not be admitted this step */ + if (s->queue_len > 0) s->w_blocked++; + + /* 4. service and completion */ + i = 0; + while (i < s->running_len) { + ap_item *it = &s->items[s->running[i]]; + if (it->remaining) it->remaining--; + if (it->remaining == 0) { + s->used_slots -= it->slots; s->used_mem -= it->mem; + s->completed++; s->w_completions++; + s->sum_demand += (double)it->demand0; s->sum_slots += (double)it->slots; s->sum_mem += (double)it->mem; + s->n_completed_stats++; + s->running[i] = s->running[--s->running_len]; /* swap-remove; order irrelevant */ + } else { + i++; + } + } + + s->step++; + if (s->step % AP_WINDOW == 0 && s->n_windows < AP_WINDOWS) close_window(s); + return ap_sim_ledger_ok(s) ? 0 : 1; +} + +int ap_sim_run(ap_sim *s) +{ + int rc = 0; + while (s->step < AP_STEPS) { + int r = ap_sim_step(s); + if (r && !rc) rc = r; + if (r == 2) break; + } + return rc; +} + +const char *ap_workload_name(ap_workload wl) +{ + static const char *const names[AP_WL_COUNT] = { + "a_homogeneous", "b_heterogeneous", "c_step", "d_square_wave", + "e_bursty", "f_capacity_drop", "g_regime_change", "h_hetero_sweep" }; + return (unsigned)wl < (unsigned)AP_WL_COUNT ? names[wl] : "?"; +} diff --git a/tests/.crumb b/tests/.crumb index 83424cbce..043f22d95 100644 --- a/tests/.crumb +++ b/tests/.crumb @@ -150,6 +150,12 @@ "name": "crumbline", "purpose": "Directory tests/crumbline. Purpose not yet described by a human." }, + { + "digest": "d57833fb3f63ef6475cf25e2e16319d818a0a407b825d5b4c5cbdd3cc0e06492", + "last_commit": "", + "name": "dual_experiment", + "purpose": "Tests for the DUAL applicability experiment: determinism (same seed, byte-identical results dige" + }, { "digest": "fb0a9296a93d065d5e016ad0a950fc6b9691f8ddca12ad0111cee2e35791cdb4", "last_commit": "c819b37", @@ -277,15 +283,15 @@ "purpose": "Directory tests/visor. Purpose not yet described by a human." } ], - "children_root": "sha256:4401e9b1951727dd948e583dc596ca7330946f64fe8aba7466569aa7e09e8672", - "compiled_at": "2026-10-04T18:16:52Z", + "children_root": "sha256:bcae6f913b37bfcb59d06e2942acc649d5803a2521f4d50beb450a04e6f24b81", + "compiled_at": "2026-10-04T18:38:56Z", "compiler": "crumb-compile/1", - "digest": "sha256:3cf64120d367b0ec3b8cb61415ddc3ba7f8b42e04c79d3a0e958b7eb8eef1622", + "digest": "sha256:e9bfa25f9d911bbcb636a73ecedea1df90b2a7e0ff9782fb43cf794d8aecdb4c", "evidence_files": 11, "evidence_root": "sha256:d5c1bceb4d57ef0eb42797c58801b5926509711614c3e38bb7105b6efa3942f2", - "files": 784, - "generated_at_commit": "41dcb768a955c1027d60d8b86d4ff6629118b9e6", - "source_tree": "sha256:4fd150be03a6ea339696b23754f5048eec519a311613508eeca32069d87453c6" + "files": 785, + "generated_at_commit": "3bebcc68321fcc876b88df129f41d6190411a926", + "source_tree": "sha256:e3fa566d5c75465dd85467a30bc713269c6e125280fdaef48b1a0f196e20d79f" }, "owner_lane": "", "provenance": { diff --git a/tests/dual_experiment/.crumb b/tests/dual_experiment/.crumb new file mode 100644 index 000000000..1930d9616 --- /dev/null +++ b/tests/dual_experiment/.crumb @@ -0,0 +1,19 @@ +{ + "extensions": { + "generated": { + "children": [], + "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "compiled_at": "2026-10-04T18:11:13Z", + "compiler": "crumb-compile/1", + "digest": "sha256:d57833fb3f63ef6475cf25e2e16319d818a0a407b825d5b4c5cbdd3cc0e06492", + "evidence_files": 0, + "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "files": 1, + "generated_at_commit": "cb7cc216147664549484fcca8e8ceadbd6f6cdbf", + "source_tree": "sha256:e67b406ebe17cd276a80a85cbcc604f287a544bbd855ae0e14b23d67b4bf6621" + } + }, + "name": "dual_experiment", + "purpose": "Tests for the DUAL applicability experiment: determinism (same seed, byte-identical results digest), exact ledger at every step, predictor finite and bounded, shuffled and constant negative controls, pinned parameter digest. Run with make test-dual-applicability (plain + ASan/UBSan + purity).", + "schema_version": "1.0.0" +} diff --git a/tests/dual_experiment/test_applic.c b/tests/dual_experiment/test_applic.c new file mode 100644 index 000000000..e3f8325d8 --- /dev/null +++ b/tests/dual_experiment/test_applic.c @@ -0,0 +1,178 @@ +/* DUAL applicability experiment tests: determinism (same seed -> byte-identical + * results digest), exact ledger conservation at every step, predictor finite + * and bounded outputs, negative controls (shuffled predictor worse, constant + * metric has zero covariance), parameter digest pinned. Plain C, assert-style: + * every CHECK counts as one test case; any failure exits nonzero. */ +#include "applic.h" +#include "sha256.h" + +#include +#include +#include +#include + +static int g_checks, g_fail; +#define CHECK(c) do { g_checks++; if (!(c)) { g_fail++; \ + fprintf(stderr, "FAIL %s:%d: %s\n", __FILE__, __LINE__, #c); } } while (0) + +/* Pre-registered: SHA-256 of ap_params_text(). Any parameter change breaks + * this pin on purpose; a new value means a new experiment version. */ +#define AP_PARAMS_DIGEST_PIN "e489d25f5f0d23cfe8624a5cc82a5f770f04cb03fd3b441aac627e1a0087ecea" + +static ap_sim g_a, g_b; +static uint32_t g_idx[AP_MAX_ITEMS]; +static ap_row g_rows_a[AP_WL_COUNT * AP_SEEDS], g_rows_b[AP_WL_COUNT * AP_SEEDS]; + +static void hex(const uint8_t *d, char *out) +{ + static const char *h = "0123456789abcdef"; + int i; + for (i = 0; i < 32; i++) { out[2 * i] = h[d[i] >> 4]; out[2 * i + 1] = h[d[i] & 15]; } + out[64] = 0; +} + +static void test_ledger_every_step(void) +{ + uint32_t wl, si; + for (wl = 0; wl < (uint32_t)AP_WL_COUNT; wl++) for (si = 0; si < 3; si++) { + uint32_t t, w; + ap_sim_init_indexed(&g_a, (ap_workload)wl, ap_seed((ap_workload)wl, si), si); + for (t = 0; t < AP_STEPS; t++) { + int r = ap_sim_step(&g_a); + if (r != 0 || !ap_sim_ledger_ok(&g_a)) { CHECK(0 && "ledger violated or pool exhausted"); break; } + } + CHECK(g_a.step == AP_STEPS); + CHECK(g_a.n_windows == AP_WINDOWS); + CHECK(g_a.pool_exhausted == 0); + CHECK(g_a.arrived > 0 && g_a.completed > 0); + /* window ledger: window counts sum to totals */ + { + uint64_t a = 0, c = 0, rj = 0; + for (w = 0; w < g_a.n_windows; w++) { a += g_a.windows[w].arrivals; c += g_a.windows[w].completions; rj += g_a.windows[w].rejected; } + CHECK(a == g_a.arrived); CHECK(c == g_a.completed); CHECK(rj == g_a.rejected); + /* capacity respected in every window */ + for (w = 0; w < g_a.n_windows; w++) { + CHECK(g_a.windows[w].used_slots_frac <= 1.0 + 1e-12); + CHECK(g_a.windows[w].used_mem_frac <= 1.0 + 1e-12); + CHECK(g_a.windows[w].queue_density <= 1.0 + 1e-12); + CHECK(g_a.windows[w].blocked_steps <= AP_WINDOW); + } + } + } + /* workload (f) actually drops capacity; (c) actually rejects under overload */ + ap_sim_init(&g_a, AP_WL_CAPACITY_DROP, ap_seed(AP_WL_CAPACITY_DROP, 0)); ap_sim_run(&g_a); + CHECK(g_a.windows[0].slots_capacity == AP_SLOTS); + CHECK(g_a.windows[AP_WINDOWS - 1].slots_capacity == AP_CAP_DROP_SLOTS); + ap_sim_init(&g_a, AP_WL_STEP, ap_seed(AP_WL_STEP, 0)); ap_sim_run(&g_a); + CHECK(g_a.rejected > 0); + /* (h): the sweep covers every seed index; spread and rate are set and the ledger holds */ + for (si = 0; si < AP_SEEDS; si++) { + ap_sim_init_indexed(&g_a, AP_WL_HETERO_SWEEP, ap_seed(AP_WL_HETERO_SWEEP, si), si); + CHECK(g_a.sweep_rate > 0.0 && g_a.het_sigma == ap_sweep_sigma(si)); + CHECK(ap_sim_run(&g_a) == 0 && g_a.pool_exhausted == 0); + } + CHECK(ap_sweep_sigma(0) == AP_SWEEP_SIGMA_MIN && ap_sweep_sigma(AP_SEEDS - 1u) == AP_SWEEP_SIGMA_MAX); + /* hostile: a corrupted ledger is detected */ + g_a.completed++; + CHECK(!ap_sim_ledger_ok(&g_a)); + g_a.completed--; + CHECK(ap_sim_ledger_ok(&g_a)); +} + +static void test_determinism(void) +{ + size_t na = 0, nb = 0; + uint8_t da[32], db[32]; + char ha[65], hb[65]; + ap_sim_init(&g_a, AP_WL_HETEROGENEOUS, 12345u); ap_sim_run(&g_a); + ap_sim_init(&g_b, AP_WL_HETEROGENEOUS, 12345u); ap_sim_run(&g_b); + CHECK(memcmp(g_a.windows, g_b.windows, sizeof g_a.windows) == 0); + CHECK(g_a.n_items == g_b.n_items && memcmp(g_a.items, g_b.items, sizeof(ap_item) * g_a.n_items) == 0); + ap_sim_init(&g_b, AP_WL_HETEROGENEOUS, 12346u); ap_sim_run(&g_b); + CHECK(memcmp(g_a.windows, g_b.windows, sizeof g_a.windows) != 0); /* the seed matters */ + + CHECK(ap_campaign(&g_a, g_idx, g_rows_a, AP_WL_COUNT * AP_SEEDS, &na) == 0); + CHECK(ap_campaign(&g_b, g_idx, g_rows_b, AP_WL_COUNT * AP_SEEDS, &nb) == 0); + CHECK(na == nb && na == (size_t)AP_WL_COUNT * AP_SEEDS); + ap_rows_digest(g_rows_a, na, da); ap_rows_digest(g_rows_b, nb, db); + hex(da, ha); hex(db, hb); + CHECK(strcmp(ha, hb) == 0); + printf("results digest: %s\n", ha); + { + uint8_t pd[32]; char ph[65]; + ap_params_digest(pd); hex(pd, ph); + printf("params digest: %s\n", ph); + CHECK(strcmp(ph, AP_PARAMS_DIGEST_PIN) == 0); + } +} + +static void test_predictor_finite(void) +{ + size_t i; + uint32_t w; + for (i = 0; i < (size_t)AP_WL_COUNT; i++) { + ap_sim_init(&g_a, (ap_workload)i, ap_seed((ap_workload)i, 7)); ap_sim_run(&g_a); + for (w = 0; w < g_a.n_windows; w++) { + ap_prediction p = ap_predict(&g_a.windows[w]); + CHECK(isfinite(p.completions) && p.completions >= 0.0); + CHECK(isfinite(p.queue_density) && p.queue_density >= 0.0 && p.queue_density <= 1.0); + CHECK(isfinite(p.blocked) && p.blocked >= 0.0 && p.blocked <= 1.0); + } + { + ap_error e = ap_error_real(&g_a), s = ap_error_shuffled(&g_a, 3), k = ap_error_known_arrivals(&g_a); + CHECK(isfinite(e.composite) && e.composite >= 0.0 && isfinite(s.composite) && isfinite(k.composite) && k.composite >= 0.0); + CHECK(e.windows == AP_WINDOWS - 1 - AP_WARMUP_WINDOWS); + } + } + /* a zero window (nothing in system, no arrivals) predicts zero everywhere */ + { + ap_window z; ap_prediction p; + memset(&z, 0, sizeof z); z.slots_capacity = AP_SLOTS; + p = ap_predict(&z); + CHECK(p.completions == 0.0 && p.queue_density == 0.0 && p.blocked == 0.0); + } +} + +static void test_negative_controls(void) +{ + size_t i, worse = 0; + static double x[AP_WL_COUNT * AP_SEEDS], y[AP_WL_COUNT * AP_SEEDS]; + double cov = 1.0, r; + for (i = 0; i < (size_t)AP_WL_COUNT * AP_SEEDS; i++) { + if (g_rows_a[i].shuffled.composite > g_rows_a[i].real.composite) worse++; + x[i] = g_rows_a[i].h.broken_const; y[i] = g_rows_a[i].real.composite; + CHECK(isfinite(g_rows_a[i].h.cv_demand) && g_rows_a[i].h.cv_demand >= 0.0); + CHECK(g_rows_a[i].h.top_share >= 0.0 && g_rows_a[i].h.top_share <= 1.0); + CHECK(g_rows_a[i].h.max_item_share >= 0.0 && g_rows_a[i].h.max_item_share <= g_rows_a[i].h.top_share + 1e-12); + CHECK(g_rows_a[i].h.class_entropy >= 0.0 && g_rows_a[i].h.class_entropy <= 1.0 + 1e-12); + } + printf("shuffled worse than real in %zu / %u runs\n", worse, (unsigned)(AP_WL_COUNT * AP_SEEDS)); + CHECK(worse * 2 > (size_t)AP_WL_COUNT * AP_SEEDS); + r = ap_pearson(x, y, AP_WL_COUNT * AP_SEEDS, &cov); + CHECK(cov == 0.0 && r == 0.0); + /* heterogeneous workload is measurably more heterogeneous than homogeneous */ + { + double cv_a = 0.0, cv_b = 0.0, top_a = 0.0, top_b = 0.0; + for (i = 0; i < (size_t)AP_WL_COUNT * AP_SEEDS; i++) { + if (g_rows_a[i].wl == AP_WL_HOMOGENEOUS) { cv_a += g_rows_a[i].h.cv_demand; top_a += g_rows_a[i].h.top_share; } + if (g_rows_a[i].wl == AP_WL_HETEROGENEOUS) { cv_b += g_rows_a[i].h.cv_demand; top_b += g_rows_a[i].h.top_share; } + } + CHECK(cv_b > cv_a && top_b > top_a); + } + /* pearson sanity */ + { + double a[4] = {1, 2, 3, 4}, b[4] = {2, 4, 6, 8}, c[4] = {4, 3, 2, 1}; + CHECK(fabs(ap_pearson(a, b, 4, NULL) - 1.0) < 1e-12); + CHECK(fabs(ap_pearson(a, c, 4, NULL) + 1.0) < 1e-12); + } +} + +int main(void) +{ + test_ledger_every_step(); + test_determinism(); + test_predictor_finite(); + test_negative_controls(); + printf("test_applic: %d checks, %d failures\n", g_checks, g_fail); + return g_fail ? 1 : 0; +} diff --git a/tools/.crumb b/tools/.crumb index d932ed2bd..db7d883c2 100644 --- a/tools/.crumb +++ b/tools/.crumb @@ -36,6 +36,12 @@ "name": "brownian", "purpose": "Directory tools/brownian. Purpose not yet described by a human." }, + { + "digest": "64fe22fe57fab7e61e65cb7652e73dbde613c260cb8677b05d8b98a067231e83", + "last_commit": "", + "name": "dual_experiment", + "purpose": "Runner for the DUAL applicability experiment: runs the pre-registered campaign and writes result" + }, { "digest": "a2a3e0f17b6cc6719fb15112608ce7e52c44233492cdd9b7a8e6a105127e569f", "last_commit": "c8b09d0", @@ -49,15 +55,15 @@ "purpose": "Directory tools/turing_verify_indep. Purpose not yet described by a human." } ], - "children_root": "sha256:77c2391752936a34221b357ad4d5e230181c7ce0fe96691572daf8549286212e", - "compiled_at": "2026-10-04T13:47:05Z", + "children_root": "sha256:0920c282c31e3be9b4745fab718ceb60dbfe2ea90dda2108986f60fc2ac53e23", + "compiled_at": "2026-10-04T18:11:13Z", "compiler": "crumb-compile/1", - "digest": "sha256:0d55bd3147479cbeffdcff1c07f38b2b8899beac2b7cc1b23e67185eb220fd43", + "digest": "sha256:49be2149359521a3a0f87c12aa31e565c6575309bd099aff8daa216b25052ed6", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 119, - "generated_at_commit": "834ee93e4314a42c1127a2fcda8b29cf3b511245", - "source_tree": "sha256:6aacb0cbd859556e8aa065553fd8037bc3dbf763b0644b7e704a276bb43f98b6" + "files": 120, + "generated_at_commit": "cb7cc216147664549484fcca8e8ceadbd6f6cdbf", + "source_tree": "sha256:c4f08a23f53d0fee5dccc1efe157efdf0275735fbb68200875e19d63f0c5ada9" }, "owner_lane": "", "provenance": { diff --git a/tools/dual_experiment/.crumb b/tools/dual_experiment/.crumb new file mode 100644 index 000000000..251fe8308 --- /dev/null +++ b/tools/dual_experiment/.crumb @@ -0,0 +1,19 @@ +{ + "extensions": { + "generated": { + "children": [], + "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "compiled_at": "2026-10-04T18:11:13Z", + "compiler": "crumb-compile/1", + "digest": "sha256:64fe22fe57fab7e61e65cb7652e73dbde613c260cb8677b05d8b98a067231e83", + "evidence_files": 0, + "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "files": 1, + "generated_at_commit": "cb7cc216147664549484fcca8e8ceadbd6f6cdbf", + "source_tree": "sha256:6514192d9fefd25f1cec3e777928306220967c0cbf10d3241ae059037e5d2cd3" + } + }, + "name": "dual_experiment", + "purpose": "Runner for the DUAL applicability experiment: runs the pre-registered campaign and writes results.csv, params.txt and results.md under evidence/DUAL/applicability/. make dual-applic-run.", + "schema_version": "1.0.0" +} diff --git a/tools/dual_experiment/applic_run.c b/tools/dual_experiment/applic_run.c new file mode 100644 index 000000000..8bfaea886 --- /dev/null +++ b/tools/dual_experiment/applic_run.c @@ -0,0 +1,238 @@ +/* DUAL applicability experiment runner. Runs the pre-registered campaign + * (AP_WL_COUNT workloads x AP_SEEDS seeds), prints the summary to stdout and + * writes results.csv, params.txt and results.md under the given directory. + * EXPERIMENTAL output only: nothing here is read by any production path. + * Usage: applic_run */ +#include "applic.h" +#include "sha256.h" + +#include +#include +#include +#include +#include + +#define NROWS (AP_WL_COUNT * AP_SEEDS) + +static ap_sim g_sim; +static uint32_t g_idx[AP_MAX_ITEMS]; +static ap_row g_rows[NROWS]; +static char g_params[2048]; + +static void hex(const uint8_t *d, char *out) +{ + static const char *h = "0123456789abcdef"; + int i; + for (i = 0; i < 32; i++) { out[2 * i] = h[d[i] >> 4]; out[2 * i + 1] = h[d[i] & 15]; } + out[64] = 0; +} +static int cmp_double(const void *a, const void *b) +{ + double x = *(const double *)a, y = *(const double *)b; + return x < y ? -1 : (x > y ? 1 : 0); +} +static double quantile(double *v, size_t n, double q) +{ + size_t k; + if (n == 0) return 0.0; + qsort(v, n, sizeof v[0], cmp_double); + k = (size_t)floor(q * (double)(n - 1) + 0.5); + return v[k]; +} +typedef struct { double sum, sum2; size_t n; } acc; +static void add(acc *a, double x) { a->sum += x; a->sum2 += x * x; a->n++; } +static double mean(const acc *a) { return a->n ? a->sum / (double)a->n : 0.0; } +static double sd(const acc *a) +{ + double m = mean(a), v = a->n ? a->sum2 / (double)a->n - m * m : 0.0; + return v > 0.0 ? sqrt(v) : 0.0; +} +static void emit(FILE *md, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); vprintf(fmt, ap); va_end(ap); + if (md) { va_start(ap, fmt); vfprintf(md, fmt, ap); va_end(ap); } +} +static double metric(const ap_hetero *h, int m) +{ + switch (m) { + case 0: return h->cv_demand; + case 1: return h->top_share; + case 2: return h->max_item_share; + case 3: return h->class_entropy; + case 4: return h->arrival_cv; + case 5: return h->broken_const; + default: return h->broken_noise; + } +} + +static void section_per_workload(FILE *md, size_t n) +{ + size_t i, j; + emit(md, "## 1. Aggregate predictor error per workload (mean over seeds, sd in parentheses)\n\n"); + emit(md, "| workload | completions NRMSE (primary) | known-arrivals completions NRMSE | queue RMSE | blocked RMSE | composite | known-arrivals composite | shuffled composite | cv_demand | top5 share | max item share | class entropy | arrival cv | rejected/run |\n"); + emit(md, "|---|---|---|---|---|---|---|---|---|---|---|---|---|---|\n"); + for (i = 0; i < (size_t)AP_WL_COUNT; i++) { + acc cn = {0,0,0}, kn = {0,0,0}, qn = {0,0,0}, bn = {0,0,0}, comp = {0,0,0}, kc = {0,0,0}, sh = {0,0,0}; + acc cv = {0,0,0}, top = {0,0,0}, mx = {0,0,0}, ent = {0,0,0}, acv = {0,0,0}, rej = {0,0,0}; + for (j = 0; j < n; j++) { + const ap_row *r = &g_rows[j]; + if (r->wl != (uint8_t)i) continue; + add(&cn, r->real.completions_nrmse); add(&kn, r->known_arrivals.completions_nrmse); + add(&qn, r->real.queue_rmse); add(&bn, r->real.blocked_rmse); + add(&comp, r->real.composite); add(&kc, r->known_arrivals.composite); add(&sh, r->shuffled.composite); + add(&cv, r->h.cv_demand); add(&top, r->h.top_share); add(&mx, r->h.max_item_share); + add(&ent, r->h.class_entropy); add(&acv, r->h.arrival_cv); add(&rej, (double)r->rejected); + } + emit(md, "| %s | %.3f (%.3f) | %.3f (%.3f) | %.3f (%.3f) | %.3f (%.3f) | %.3f (%.3f) | %.3f (%.3f) | %.3f (%.3f) | %.3f | %.3f | %.4f | %.3f | %.3f | %.1f |\n", + ap_workload_name((ap_workload)i), mean(&cn), sd(&cn), mean(&kn), sd(&kn), mean(&qn), sd(&qn), mean(&bn), sd(&bn), + mean(&comp), sd(&comp), mean(&kc), sd(&kc), mean(&sh), sd(&sh), + mean(&cv), mean(&top), mean(&mx), mean(&ent), mean(&acv), mean(&rej)); + } +} + +static void section_correlations(FILE *md, size_t n) +{ + static double xs[NROWS], yc[NROWS], yn[NROWS], yq[NROWS], yb[NROWS], yk[NROWS]; + static const char *const names[7] = { "cv_demand", "top5_share", "max_item_share", "class_entropy", "arrival_cv", + "broken_const (control)", "broken_noise (control)" }; + size_t i; + int m; + emit(md, "\n## 2. Correlation of aggregate prediction error with heterogeneity measurements (Pearson r over all %zu runs)\n\n", n); + emit(md, "| measurement | r vs completions NRMSE (primary) | r vs known-arrivals completions NRMSE | r vs queue RMSE | r vs blocked RMSE | r vs composite | covariance vs completions NRMSE | note |\n|---|---|---|---|---|---|---|---|\n"); + for (i = 0; i < n; i++) { + yc[i] = g_rows[i].real.composite; yn[i] = g_rows[i].real.completions_nrmse; + yq[i] = g_rows[i].real.queue_rmse; yb[i] = g_rows[i].real.blocked_rmse; + yk[i] = g_rows[i].known_arrivals.completions_nrmse; + } + for (m = 0; m < 7; m++) { + double cov; + for (i = 0; i < n; i++) xs[i] = metric(&g_rows[i].h, m); + emit(md, "| %s | %+.3f | %+.3f | %+.3f | %+.3f | %+.3f | %+.6f | %s |\n", names[m], + ap_pearson(xs, yn, n, &cov), ap_pearson(xs, yk, n, NULL), ap_pearson(xs, yq, n, NULL), + ap_pearson(xs, yb, n, NULL), ap_pearson(xs, yc, n, NULL), cov, + m == 5 ? "zero variance: covariance exactly 0, r reported as 0" : m == 6 ? "independent of the run: expected near 0" : ""); + } +} + +static void section_sweep(FILE *md, size_t n) +{ + static double sx[AP_SEEDS], st[AP_SEEDS], sy[AP_SEEDS], sk[AP_SEEDS]; + size_t i, k = 0; + emit(md, "\n## 2b. Heterogeneity sweep (workload h only, %u runs, offered load held at %.2f, spread rises with seed index)\n\n", AP_SEEDS, AP_SWEEP_LOAD); + for (i = 0; i < n; i++) if (g_rows[i].wl == (uint8_t)AP_WL_HETERO_SWEEP && k < AP_SEEDS) { + sx[k] = g_rows[i].h.cv_demand; st[k] = g_rows[i].h.top_share; + sy[k] = g_rows[i].real.completions_nrmse; sk[k] = g_rows[i].known_arrivals.completions_nrmse; k++; + } + emit(md, "- r(cv_demand, completions NRMSE) = %+.3f; r(cv_demand, known-arrivals completions NRMSE) = %+.3f\n", + ap_pearson(sx, sy, k, NULL), ap_pearson(sx, sk, k, NULL)); + emit(md, "- r(top5_share, completions NRMSE) = %+.3f; r(top5_share, known-arrivals completions NRMSE) = %+.3f\n\n", + ap_pearson(st, sy, k, NULL), ap_pearson(st, sk, k, NULL)); + emit(md, "| seed_index | sigma | cv_demand | top5 share | max item share | completions NRMSE | known-arrivals completions NRMSE | blocked RMSE |\n|---|---|---|---|---|---|---|---|\n"); + for (i = 0; i < n; i++) if (g_rows[i].wl == (uint8_t)AP_WL_HETERO_SWEEP) { + const ap_row *r = &g_rows[i]; + emit(md, "| %u | %.3f | %.3f | %.3f | %.4f | %.3f | %.3f | %.3f |\n", r->seed_index, ap_sweep_sigma(r->seed_index), + r->h.cv_demand, r->h.top_share, r->h.max_item_share, r->real.completions_nrmse, + r->known_arrivals.completions_nrmse, r->real.blocked_rmse); + } +} + +static void section_shuffled(FILE *md, size_t n) +{ + size_t i, j, worse_total = 0; + emit(md, "\n## 3. Negative control: shuffled-window predictor must be worse than the real predictor\n\n"); + emit(md, "| workload | runs where shuffled composite > real composite | mean real composite | mean shuffled composite |\n|---|---|---|---|\n"); + for (i = 0; i < (size_t)AP_WL_COUNT; i++) { + size_t worse = 0, cnt = 0; acc re = {0,0,0}, sh = {0,0,0}; + for (j = 0; j < n; j++) { + if (g_rows[j].wl != (uint8_t)i) continue; + cnt++; add(&re, g_rows[j].real.composite); add(&sh, g_rows[j].shuffled.composite); + if (g_rows[j].shuffled.composite > g_rows[j].real.composite) worse++; + } + worse_total += worse; + emit(md, "| %s | %zu / %zu | %.3f | %.3f |\n", ap_workload_name((ap_workload)i), worse, cnt, mean(&re), mean(&sh)); + } + emit(md, "\nshuffled worse in %zu / %zu runs: %s\n", worse_total, n, worse_total * 2 > n ? "CONTROL PASS (majority)" : "CONTROL FAIL"); +} + +static void section_grid(FILE *md, size_t n) +{ + static const double grid_cv[AP_GRID_CV_COUNT] = AP_GRID_CV; + static const double grid_top[AP_GRID_TOP_COUNT] = AP_GRID_TOP; + static double v[NROWS], v2[NROWS], vc[NROWS]; + size_t a, b, j, k; + acc m1, mc; + emit(md, "\n## 4. Regime grid (pre-registered thresholds): PRIMARY measure = completions NRMSE of runs with cv_demand < Y and top5 share < Z (composite beside it)\n\n"); + emit(md, "| Y (cv) | Z (top5) | runs | mean completions NRMSE | p90 | max | mean composite | p90 composite | runs also arrival_cv < %.2f | p90 completions NRMSE (that subset) |\n|---|---|---|---|---|---|---|---|---|---|\n", AP_GRID_ARRIVAL_CV); + for (a = 0; a < AP_GRID_CV_COUNT; a++) for (b = 0; b < AP_GRID_TOP_COUNT; b++) { + size_t k2 = 0; double mx = 0.0; + k = 0; memset(&m1, 0, sizeof m1); memset(&mc, 0, sizeof mc); + for (j = 0; j < n; j++) { + const ap_row *r = &g_rows[j]; + if (r->h.cv_demand < grid_cv[a] && r->h.top_share < grid_top[b]) { + v[k] = r->real.completions_nrmse; vc[k] = r->real.composite; k++; + add(&m1, r->real.completions_nrmse); add(&mc, r->real.composite); + if (r->real.completions_nrmse > mx) mx = r->real.completions_nrmse; + if (r->h.arrival_cv < AP_GRID_ARRIVAL_CV) v2[k2++] = r->real.completions_nrmse; + } + } + emit(md, "| %.1f | %.2f | %zu | %.3f | %.3f | %.3f | %.3f | %.3f | %zu | %.3f |\n", grid_cv[a], grid_top[b], k, mean(&m1), + quantile(v, k, 0.9), mx, mean(&mc), quantile(vc, k, 0.9), k2, quantile(v2, k2, 0.9)); + } + k = 0; memset(&m1, 0, sizeof m1); + for (j = 0; j < n; j++) if (g_rows[j].h.cv_demand >= grid_cv[AP_GRID_CV_COUNT - 1] || g_rows[j].h.top_share >= grid_top[AP_GRID_TOP_COUNT - 1]) { + v[k++] = g_rows[j].real.completions_nrmse; add(&m1, g_rows[j].real.completions_nrmse); + } + emit(md, "\ncomplement (cv >= %.1f or top5 >= %.2f): %zu runs, mean completions NRMSE %.3f, p10 %.3f, p90 %.3f\n", + grid_cv[AP_GRID_CV_COUNT - 1], grid_top[AP_GRID_TOP_COUNT - 1], k, mean(&m1), quantile(v, k, 0.1), quantile(v, k, 0.9)); + k = 0; memset(&m1, 0, sizeof m1); + for (j = 0; j < n; j++) if (g_rows[j].h.arrival_cv >= AP_GRID_ARRIVAL_CV) { + v[k++] = g_rows[j].real.completions_nrmse; add(&m1, g_rows[j].real.completions_nrmse); + } + emit(md, "temporal complement (arrival_cv >= %.2f): %zu runs, mean completions NRMSE %.3f, p10 %.3f, p90 %.3f\n", + AP_GRID_ARRIVAL_CV, k, mean(&m1), quantile(v, k, 0.1), quantile(v, k, 0.9)); +} + +int main(int argc, char **argv) +{ + size_t n = 0, i; + uint8_t dig[32]; + char hx[65], path[1024]; + FILE *f, *md; + const char *out_dir = argc > 1 ? argv[1] : "evidence/DUAL/applicability"; + + if (ap_params_text(g_params, sizeof g_params) < 0) { fprintf(stderr, "params text overflow\n"); return 2; } + if (ap_campaign(&g_sim, g_idx, g_rows, NROWS, &n) != 0) { fprintf(stderr, "campaign failed (ledger or pool)\n"); return 2; } + + snprintf(path, sizeof path, "%s/results.csv", out_dir); + f = fopen(path, "w"); + if (!f) { fprintf(stderr, "cannot write %s\n", path); return 2; } + fprintf(f, "%s\n", ap_row_header()); + for (i = 0; i < n; i++) { char line[512]; if (ap_row_format(&g_rows[i], line, sizeof line) >= 0) fprintf(f, "%s\n", line); } + fclose(f); + snprintf(path, sizeof path, "%s/params.txt", out_dir); + f = fopen(path, "w"); + if (!f) { fprintf(stderr, "cannot write %s\n", path); return 2; } + fputs(g_params, f); fclose(f); + snprintf(path, sizeof path, "%s/results.md", out_dir); + md = fopen(path, "w"); + if (!md) { fprintf(stderr, "cannot write %s\n", path); return 2; } + + emit(md, "# DUAL applicability experiment: results (%s)\n\n", AP_EXPERIMENT_NAME); + emit(md, "EXPERIMENTAL. Synthetic workloads. Not a production gate, not a production classifier. Nothing inserted into production.\n\n"); + ap_params_digest(dig); hex(dig, hx); + emit(md, "- parameter digest (SHA-256 of params.txt): `%s`\n", hx); + ap_rows_digest(g_rows, n, dig); hex(dig, hx); + emit(md, "- results digest (SHA-256 of results.csv text): `%s`\n", hx); + emit(md, "- runs: %zu (%u workloads x %u seeds), %u windows of %u steps each, %u warm-up windows unscored\n\n", + n, (unsigned)AP_WL_COUNT, AP_SEEDS, AP_WINDOWS, AP_WINDOW, AP_WARMUP_WINDOWS); + section_per_workload(md, n); + section_correlations(md, n); + section_sweep(md, n); + section_shuffled(md, n); + section_grid(md, n); + emit(md, "\nVerdict line: EXPERIMENTAL; recommends a future regime classifier; nothing inserted into production.\n"); + fclose(md); + printf("wrote %s/results.csv, params.txt, results.md\n", out_dir); + return 0; +} From c8e9d2e8e293079f197382ad7dd116113dd21939 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Sun, 4 Oct 2026 13:13:10 -0500 Subject: [PATCH 2/3] evidence(DUAL/applicability): receipt for the applicability experiment at 2a582fd Repo, base and candidate SHAs, clean tree, toolchain, exact commands and outputs, parameter and results digests (identical in plain and ASan/UBSan builds), results table, negative controls, conclusion, limits. Verdict: EXPERIMENTAL; recommends future regime classifier; nothing inserted into production. Co-authored-by: Drake Stapleton Co-Authored-By: Claude Fable 5.1 --- evidence/DUAL/applicability/receipt.md | 88 ++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 evidence/DUAL/applicability/receipt.md diff --git a/evidence/DUAL/applicability/receipt.md b/evidence/DUAL/applicability/receipt.md new file mode 100644 index 000000000..9662f196f --- /dev/null +++ b/evidence/DUAL/applicability/receipt.md @@ -0,0 +1,88 @@ +# Receipt: DUAL applicability experiment (DUAL-APPLIC-V1) + +**Verdict: EXPERIMENTAL; recommends a future regime classifier; nothing inserted into production.** + +| field | value | +|---|---| +| repository | aien-dev/omega (fresh clone, `~/workspace/dual/omega-applic`) | +| base (GitHub `main` at clone) | `cb7cc216147664549484fcca8e8ceadbd6f6cdbf` | +| candidate (code, docs, results) | `2a582fded48102a713a2790a613e1936a5beb032` on branch `dual/applicability-experiment` | +| tree state at run | clean (`git status --porcelain` empty before and after the run) | +| host | spark-b87b, aarch64, Linux 7.0.0-1019-nvidia; host-only, no accelerator, no chip time | +| compiler | `cc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0`, GNU Make 4.3 | +| flags | `EST_CFLAGS` (`-std=c11 -Wall -Wextra -Werror -pedantic -O2 -ffp-contract=off -fno-fast-math`), ASan build adds `-O1 -g -fsanitize=address,undefined -fno-sanitize-recover=all` | +| workstream | ADR 0031 / ARCH-0031 (DUAL constraint pricing), offline applicability lane; no DUAL-N gate token claimed | +| scope | experiment only; no production gate, no production classifier; `src/runtime/` untouched; no dependency on `src/dual/` | + +## Pre-registration + +- Parameters: `src/dual_experiment/applic_params.h`, rendered canonically by `ap_params_text()`; written to `params.txt`. +- **Parameter digest (SHA-256 of params.txt):** `e489d25f5f0d23cfe8624a5cc82a5f770f04cb03fd3b441aac627e1a0087ecea`, pinned in `tests/dual_experiment/test_applic.c` (`AP_PARAMS_DIGEST_PIN`). Any parameter change fails the test: new experiment version, no rescoring. +- Predictor formulas and error measures: `src/dual_experiment/applic_predict.c` header comment and `docs/dual/APPLICABILITY_EXPERIMENT.md` §1.2. A v1 draft that counted running items as offered work was replaced before any result was recorded; no v1 number is reported. +- Primary measure: completions NRMSE. Regime grid thresholds: cv in {0.4, 0.8, 1.2}, top-5 % share in {0.10, 0.20, 0.30}, arrival_cv 0.5. + +## Commands and results (run at candidate SHA, clean tree) + +```text +$ make test-dual-applicability +dual-applic-purity: applic_sim.o, applic_predict.o and applic_metrics.o reference no forbidden symbol +./build/dual-applicability/test_applic +results digest: 912fb51b13f981c5a5e4cce28211d6eac62d5e9149e9bc32e44eb9f1acb0c45a +params digest: e489d25f5f0d23cfe8624a5cc82a5f770f04cb03fd3b441aac627e1a0087ecea +shuffled worse than real in 192 / 192 runs +test_applic: 13020 checks, 0 failures +./build/dual-applicability/test_applic_asan +results digest: 912fb51b13f981c5a5e4cce28211d6eac62d5e9149e9bc32e44eb9f1acb0c45a +params digest: e489d25f5f0d23cfe8624a5cc82a5f770f04cb03fd3b441aac627e1a0087ecea +shuffled worse than real in 192 / 192 runs +test_applic: 13020 checks, 0 failures +test-dual-applicability: determinism, ledger, predictor and negative-control checks pass in plain and ASan/UBSan builds + +$ make dual-applic-run +wrote evidence/DUAL/applicability/results.csv, params.txt, results.md + +$ sha256sum evidence/DUAL/applicability/results.csv params.txt results.md +912fb51b13f981c5a5e4cce28211d6eac62d5e9149e9bc32e44eb9f1acb0c45a results.csv (193 lines: header + 192 runs) +e489d25f5f0d23cfe8624a5cc82a5f770f04cb03fd3b441aac627e1a0087ecea params.txt +c4803da3fa8844b991f3cfea63352a61e8dddadfb975192e8c54892c1d3aa9d5 results.md +``` + +Determinism: the results digest printed by the plain build, by the ASan/UBSan build and the SHA-256 of the written `results.csv` are the same value. Re-running `make dual-applic-run` on the committed files left the tree clean (byte-identical rewrite). + +Purity: `nm -u` on `applic_sim.o`, `applic_predict.o`, `applic_metrics.o` against `EST_FORBIDDEN` (`rx_|aienos_|argus_|forge_|aegis|mmap|mprotect|fork|exec|dlopen|system|socket|fopen|open$`): no hit. + +## Results table (mean over 24 seeds; full tables with sd in `results.md`) + +| workload | completions NRMSE (primary) | known-arrivals NRMSE | queue RMSE | blocked RMSE | shuffled composite vs real | cv_demand | top5 share | arrival cv | rejected/run | +|---|---|---|---|---|---|---|---|---|---| +| a homogeneous | 0.110 | 0.078 | 0.009 | 0.391 | 0.231 vs 0.170 | 0.068 | 0.054 | 0.147 | 0 | +| b heterogeneous | 0.220 | 0.158 | 0.006 | 0.275 | 0.212 vs 0.167 | 1.698 | 0.372 | 0.203 | 0 | +| c step | 0.099 | 0.069 | 0.029 | 0.061 | 0.566 vs 0.063 | 0.068 | 0.054 | 0.524 | 91.0 | +| d square wave | 0.174 | 0.068 | 0.062 | 0.217 | 0.476 vs 0.151 | 0.068 | 0.054 | 0.618 | 0 | +| e bursty | 0.171 | 0.136 | 0.150 | 0.320 | 0.426 vs 0.213 | 0.068 | 0.054 | 0.648 | 23.9 | +| f capacity drop | 0.100 | 0.074 | 0.022 | 0.277 | 0.498 vs 0.133 | 0.068 | 0.054 | 0.150 | 271.3 | +| g regime change | 0.151 | 0.108 | 0.006 | 0.312 | 0.273 vs 0.157 | 1.013 | 0.268 | 0.335 | 0 | +| h heterogeneity sweep | 0.197 | 0.122 | 0.005 | 0.253 | 0.183 vs 0.152 | 0.970 | 0.266 | 0.177 | 0 | + +Correlation with completions NRMSE, Pearson r over 192 runs: cv_demand +0.696, top5_share +0.689, max_item_share +0.606, class_entropy -0.673, arrival_cv +0.068. Sweep only (24 runs, offered load fixed at 0.80): r(cv_demand) +0.882 (known arrivals +0.916), r(top5_share) +0.903 (known arrivals +0.932); completions NRMSE rises monotonically 0.172 -> 0.309 with sigma 0 -> 1.5 (known arrivals 0.068 -> 0.272). + +Regime grid, primary measure: cv < 0.8 and top5 < 0.20: 129 runs, mean 0.133, p90 0.183, max 0.254. Complement cv >= 1.2 or top5 >= 0.30: 37 runs, mean 0.218, p10 0.189, p90 0.256. arrival_cv >= 0.5: 71 runs, mean 0.148, p90 0.195. + +## Negative controls + +| control | expectation | result | +|---|---|---| +| shuffled-window predictor (densities from a different window) | worse than the real predictor | worse in **192 / 192** runs; per workload 24/24 each; CONTROL PASS | +| constant "heterogeneity" metric (0.5) | no correlation | covariance exactly 0.000000 on every error axis, r reported 0 | +| seeded noise metric independent of the run (extra) | near zero | r = +0.103 (primary), +0.149 (known arrivals), +0.034 (queue), +0.108 (blocked) | +| hostile corrupted ledger (test) | detected | `ap_sim_ledger_ok` returns 0 after `completed++`, 1 after restoring | + +## Conclusion + +Aggregate pressure predicts **throughput** well when items are near-identical, including under step load, capacity loss and sustained overload (about 10 % error, 7 to 8 % once the arrival count is known). It degrades monotonically with item heterogeneity, and the degradation survives knowing the arrivals exactly, so it is aggregation error: a few long items hold slots the aggregate cannot see. Time-varying load is a forecasting problem (large error with last-window arrivals, small with known arrivals), not an aggregation problem. **Waiting (blocked fraction) is not predictable from aggregates** in any regime short of saturation. Candidate regime rule, PROPOSAL only, inserted nowhere: aggregate throughput prediction usable (p90 NRMSE <= about 0.18) when cv_demand < 0.8 and top-5 % load share < 0.20; discrete per-item scheduling must dominate (p10 NRMSE >= about 0.19) when cv_demand >= 1.2 or top-5 % share >= 0.30; the band between is a transition region; blocked fractions are out of scope. + +## Limits + +Synthetic workloads only, not qualified against any real trace; one admission policy, one capacity shape, one deliberately simple predictor; the sweep confounds spread with seed; the quoted thresholds were chosen from the pre-registered grid after seeing the numbers; the blocked-fraction heuristic is arbitrary (pre-registered). No claim about ADR 0031 prices, energy, thermal state or uncertainty. + +Verdict: EXPERIMENTAL; recommends a future regime classifier; nothing inserted into production. From be1a489fce5e54732b688b6a756912e59e7c3919 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Sun, 4 Oct 2026 13:13:54 -0500 Subject: [PATCH 3/3] crumb: recompile root crumb after dual_experiment commits (last_commit fields) The root .crumb records each child directory's last commit; the first commit of this branch introduced new directories, so those fields lagged by one commit. crumb compile . then crumb verify . OK. Co-authored-by: Drake Stapleton Co-Authored-By: Claude Fable 5.1 --- .crumb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.crumb b/.crumb index 97a2d30f7..091c4fa26 100644 --- a/.crumb +++ b/.crumb @@ -52,7 +52,7 @@ }, { "digest": "e555caa4954d4dde3e499f37df8c9af2efc41cf349dc8096273b0e062dd07a01", - "last_commit": "3bebcc6", + "last_commit": "5f18839", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." }, @@ -64,7 +64,7 @@ }, { "digest": "322e59de081336c07865c29e4143728f3b25333ecd102f662a319074fca76f5c", - "last_commit": "3bebcc6", + "last_commit": "5f18839", "name": "mk", "purpose": "Directory mk. Purpose not yet described by a human." }, @@ -88,19 +88,19 @@ }, { "digest": "0f3a63e432e9beed1a353d1570bc416f0bae07e99a45be15b0b885cbbedfb8ea", - "last_commit": "3bebcc6", + "last_commit": "5f18839", "name": "src", "purpose": "Directory src. Purpose not yet described by a human." }, { "digest": "e9bfa25f9d911bbcb636a73ecedea1df90b2a7e0ff9782fb43cf794d8aecdb4c", - "last_commit": "3bebcc6", + "last_commit": "5f18839", "name": "tests", "purpose": "Directory tests. Purpose not yet described by a human." }, { "digest": "49be2149359521a3a0f87c12aa31e565c6575309bd099aff8daa216b25052ed6", - "last_commit": "6b940fa", + "last_commit": "5f18839", "name": "tools", "purpose": "Directory tools. Purpose not yet described by a human." } @@ -108,12 +108,12 @@ "children_root": "sha256:4494a74564f7c8c8c7041f9583c2fa9b03e0fb7039e275587528de1ec291f477", "compiled_at": "2026-10-04T18:38:56Z", "compiler": "crumb-compile/1", - "digest": "sha256:ecd61d0527659ceed69a18ec198dde90b9eadf83e06c80c4f510b59684a0746b", - "evidence_files": 1286, - "evidence_root": "sha256:8f489c4e8d82207d28c2c0d7665fdcbad06e88317c2d1f23d24a4731f10f25e0", - "files": 3038, - "generated_at_commit": "3bebcc68321fcc876b88df129f41d6190411a926", - "source_tree": "sha256:9e21b13beadf85bba23a066ace33941dd73a65b1e39070af0b952612bd92c501" + "digest": "sha256:1f47bad7815a9be11b9dc20381e3c58441e331a7a29759fb2363e1dc3ea600c8", + "evidence_files": 1287, + "evidence_root": "sha256:5e4b538bcd3cc124b345b1f12b0953c988f327cf3c3e9fc989cdb02cdb2dcd3e", + "files": 3039, + "generated_at_commit": "c8e9d2e8e293079f197382ad7dd116113dd21939", + "source_tree": "sha256:f8b6cb55822b0aba92caf34688c984c5ed578085b73730e32a8c15b44bb66ebe" }, "owner_lane": "", "provenance": {