nx_icecream_bench.nx
buildroot/runtime/nx_icecream_bench.nx
about
nx_icecream_bench.nx -- THE RULER. Score a frozen dessert against Ben &
Jerry's Vanilla, the declared SOTA reference for this lane.
===== WHY A RULER COMES FIRST ====================================
"Exceed Ben & Jerry's" is not a formulation instruction until something can
SCORE both products on the same axes. This organ is that scorer. It holds
no ambition and proposes no recipe: it computes what a label implies, what
the law actually permits, and where the reference product is structurally
weak. The formulator is a separate organ and must be argued WITH this one,
never instead of it.
===== THE REFERENCE, FROM THE ACTUAL LABEL =======================
Ben & Jerry's Vanilla, US pint, UPC 076840400058. Ingredient declaration
in order: Cream, Skim Milk, Liquid Sugar (Sugar, Water), Water, Egg Yolks,
Sugar, Guar Gum, Vanilla Extract, Vanilla Beans, Carrageenan.
Nutrition panel, 2/3 cup (143 g) serving: 330 kcal, 21 g fat (14 g sat),
29 g carbohydrate (28 g sugars), 6 g protein, 95 mg cholesterol.
Pint = 16 fl oz = 473 mL, 3 servings => 429 g net. The net weight is
DERIVED (US frozen dessert is sold by volume; weight is not declared), and
bench_net_weight_is_derived says so.
**TWO FACTS IN THAT DECLARATION DECIDE THE WHOLE COMPETITIVE PICTURE:**
1. The only hydrocolloids are GUAR (primary) and CARRAGEENAN (secondary).
There is no locust bean gum -- which matters because this lane's own
gap ledger had named LBG as "how industry slows recrystallisation".
The actual competitor does not use it.
2. There is NO ADDED EMULSIFIER. Egg yolk is the entire emulsifier
system -- no mono- and diglycerides, no polysorbate 80. That is the
exploitable weakness, and it is the reason this organ models meltdown.
===== THE LEGAL FINDING THIS ORGAN CARRIES =======================
21 CFR 135.110 imposes FOUR floors on anything labelled "ice cream":
>=10% milkfat, >=20% total milk solids, >=4.5 lb/gal finished weight, and
>=1.6 lb TOTAL FOOD SOLIDS per gallon. nx_icecream enforces the first
three. It declares IC_FDA_MIN_FOOD_SOLIDS_Q2 = 160 for the fourth and
then never reads it -- a dead constant, so the fourth floor is documented
dependencies 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_icecream_bench_gate.nx
structs
| 114 | struct BenchProduct |
consts
| 72 | const BENCH_MAGIC_10000: i64 = 10000 |
| 73 | const BENCH_MAGIC_1000000: i64 = 1000000 |
| 77 | const BENCH_INVALID: i64 = 0 - 1 |
| 80 | const BENCH_FLOOR_NONE: i64 = 0 |
| 81 | const BENCH_FLOOR_WEIGHT: i64 = 1 |
| 82 | const BENCH_FLOOR_SOLIDS: i64 = 2 |
| 85 | const BENCH_EMUL_NONE: i64 = 0 |
| 86 | const BENCH_EMUL_EGG_YOLK: i64 = 1 |
| 87 | const BENCH_EMUL_MONO_DI: i64 = 2 |
| 88 | const BENCH_EMUL_MONO_DI_PS80: i64 = 3 |
| 94 | const BENCH_SV_FAT_Q3: i64 = 1075 |
| 95 | const BENCH_SV_SNF_Q3: i64 = 630 |
| 96 | const BENCH_SV_WATER_Q3: i64 = 1000 |
| 98 | const BENCH_ML_PER_GAL: i64 = 3785 |
| 99 | const BENCH_G_PER_LB: i64 = 454 |
| 101 | const BENCH_FDA_MIN_LB_PER_GAL_Q2: i64 = 450 // 4.5 lb/gal finished weight |
| 102 | const BENCH_FDA_MIN_FOOD_SOLIDS_Q2: i64 = 160 // 1.6 lb food solids/gal |
| 103 | const BENCH_FDA_MIN_MILKFAT_PERMIL: i64 = 100 |
| 104 | const BENCH_FDA_MIN_MILK_SOL_PERMIL: i64 = 200 |
| 107 | const BENCH_RACC_TENTH_ML: i64 = 1577 |
| 162 | const BENCH_HD_SERVING_G: i64 = 128 |
| 475 | const BENCH_DRIP_LOW_DESTAB_MIN: i64 = 12 |
| 476 | const BENCH_DRIP_HIGH_DESTAB_MIN: i64 = 18 |
| 477 | const BENCH_MELTRATE_LOW_DESTAB_PERMIL: i64 = 22 |
| 478 | const BENCH_MELTRATE_HIGH_DESTAB_PERMIL: i64 = 10 |
functions
| 125 | func bench_product_new() -> *BenchProduct |
| 140 | func bench_ref_benjerry() -> *BenchProduct |
| 164 | func bench_hd_density_q3() -> i64 |
| 168 | func bench_hd_composition_is_known() -> i64 { return 0 } called by 1: t12 |
| 174 | func bench_denser_than_hd_permil(p: *BenchProduct) -> i64 |
| 186 | func bench_density_q3(p: *BenchProduct) -> i64 |
| 192 | func bench_fat_permil(p: *BenchProduct) -> i64 |
| 198 | func bench_total_solids_permil(p: *BenchProduct) -> i64 |
| 204 | func bench_water_permil(p: *BenchProduct) -> i64 |
| 212 | func bench_msnf_permil(p: *BenchProduct) -> i64 |
| 218 | func bench_total_milk_solids_permil(p: *BenchProduct) -> i64 |
| 230 | func bench_mix_density_q3(fat_permil: i64, ts_permil: i64) -> i64 |
| 244 | func bench_mix_density_of(p: *BenchProduct) -> i64 called by 3: bench_overrun_oft3t8 calls 3: bench_fat_permilbench_total_solids_permilbench_mix_density_q3 |
| 253 | func bench_overrun_permil(mix_q3: i64, product_q3: i64) -> i64 |
| 260 | func bench_overrun_of(p: *BenchProduct) -> i64 |
| 272 | func bench_air_permil_from_overrun(overrun_permil: i64) -> i64 called by 1: t5 |
| 277 | func bench_air_equals_overrun(overrun_permil: i64) -> i64 called by 1: t5 |
| 284 | func bench_overrun_is_derived() -> i64 { return 1 } called by 1: t14 |
| 285 | func bench_net_weight_is_derived(p: *BenchProduct) -> i64 { return p.net_weight_derived } called by 1: t14 |
| 290 | func bench_overrun_band(product_q3: i64, mix_lo_q3: i64, mix_hi_q3: i64, out: *i64) -> i64 calls 1: bench_overrun_permil |
| 301 | func bench_min_density_weight_q3() -> i64 |
| 310 | func bench_min_density_solids_q3(ts_permil: i64) -> i64 |
| 318 | func bench_binding_floor(ts_permil: i64) -> i64 |
| 326 | func bench_min_density_q3(ts_permil: i64) -> i64 |
| 336 | func bench_floor_crossover_permil() -> i64 |
| 362 | func bench_ceiling_weight_permil(mix_q3: i64) -> i64 |
| 371 | func bench_ceiling_solids_permil(mix_q3: i64, ts_permil: i64) -> i64 called by 1: bench_max_overrun_permil |
| 381 | func bench_max_overrun_permil(mix_q3: i64, ts_permil: i64) -> i64 called by 4: bench_shipped_law_error_permilt8t9t16 calls 2: bench_ceiling_weight_permilbench_ceiling_solids_permil |
| 392 | func bench_max_overrun_weight_only_permil(mix_q3: i64) -> i64 |
| 398 | func bench_shipped_law_error_permil(mix_q3: i64, ts_permil: i64) -> i64 |
| 408 | func bench_shipped_law_over_permits(mix_q3: i64, ts_permil: i64) -> i64 |
| 417 | func bench_solids_lb_per_gal_q2(product_q3: i64, ts_permil: i64) -> i64 |
| 425 | func bench_weight_lb_per_gal_q2(product_q3: i64) -> i64 |
| 433 | func bench_fda_failures(p: *BenchProduct) -> i64 |
| 447 | func bench_is_ice_cream(p: *BenchProduct) -> i64 |
| 482 | func bench_destab_permil(emul: i64) -> i64 |
| 490 | func bench_first_drip_min(emul: i64) -> i64 |
| 497 | func bench_melt_rate_permil_min(emul: i64) -> i64 |
| 506 | func bench_meltdown_advantage_q3(ref_emul: i64, challenger_emul: i64) -> i64 |
| 521 | func bench_meltdown_claim_is_inferred() -> i64 { return 1 } called by 1: t14 |
| 522 | func bench_reference_was_physically_measured() -> i64 { return 0 } called by 1: t14 |
| 532 | func bench_needs_secondary_colloid(primary_gum_permil: i64) -> i64 |
| 537 | func bench_reference_uses_lbg() -> i64 { return 0 } called by 1: t14 |
| 538 | func bench_reference_uses_added_emulsifier() -> i64 { return 0 } called by 1: t14 |