diff --git a/.github/workflows/universality-controls.yml b/.github/workflows/universality-controls.yml index 91db1c9a2..7deacba70 100644 --- a/.github/workflows/universality-controls.yml +++ b/.github/workflows/universality-controls.yml @@ -34,6 +34,10 @@ jobs: run: | python3 -B -E -S -m unittest discover -s experiments/universality -p 'test_*.py' -v python3 -B -E -O -S -m unittest discover -s experiments/universality -p 'test_*.py' -v + - name: Exact population certificate controls in both modes + run: | + python3 -B -E -S -m unittest discover -s experiments/universality/two_parameter_cusp_population -p 'test_population_certificate.py' -v + python3 -B -E -O -S -m unittest discover -s experiments/universality/two_parameter_cusp_population -p 'test_population_certificate.py' -v - name: Execute and audit all fifty exploratory law candidates run: | set -euo pipefail diff --git a/experiments/universality/results/exact_population_1/CERTIFICATE.json b/experiments/universality/results/exact_population_1/CERTIFICATE.json new file mode 100644 index 000000000..afeb64aa5 --- /dev/null +++ b/experiments/universality/results/exact_population_1/CERTIFICATE.json @@ -0,0 +1,1586 @@ +{ + "analytic_premises": [ + "consumed global-selection proof", + "iid-copy law", + "core monotonicity and tail convexity derivations" + ], + "arithmetic": { + "core_panels": 65536, + "mathematical_values": "Fraction", + "outward_bits": 128, + "point_rounding": "outward fixed 128-bit dyadic", + "split_root_bisections": 96, + "tail_panels_per_octave": 512, + "void_method": "shared outward log_bounds and exp_neg_bounds" + }, + "coefficient_interval": [ + "382817662786055771396296433360739237888/1500551209471094366432841716734779043249", + "63802943797675961899382738893456539648/250091868245182394405473619455796507207" + ], + "exposure": "Source-exposed OpenAI/Codex provider/team; no organizational independence", + "negative_controls": { + "conditioned_mass": [ + "1", + "1" + ], + "controls": [ + { + "a": "1/262144", + "count": 1, + "critical_heights": [ + "-575/4835703278458516698824704", + "-639/4835703278458516698824704", + "47/37778931862957161709568" + ], + "curvatures": [ + "-13/549755813888", + "11/549755813888", + "-143/1099511627776" + ], + "discriminant": "20449/332306998946228968225951765070086144", + "h": "1/1048576", + "hessian_signs": [ + -1, + 1, + -1 + ], + "lifetime": "1/75557863725914323419136", + "rectangle": true, + "roots": [ + "-5/1048576", + "-3/1048576", + "1/131072" + ], + "sign": 1, + "stationary": true, + "status": "FINITE_BAR", + "u": "49/1099511627776", + "v": "15/144115188075855872", + "younger_side": "left" + }, + { + "a": "1/262144", + "count": 1, + "critical_heights": [ + "47/37778931862957161709568", + "-639/4835703278458516698824704", + "-575/4835703278458516698824704" + ], + "curvatures": [ + "-143/1099511627776", + "11/549755813888", + "-13/549755813888" + ], + "discriminant": "20449/332306998946228968225951765070086144", + "h": "1/1048576", + "hessian_signs": [ + -1, + 1, + -1 + ], + "lifetime": "1/75557863725914323419136", + "rectangle": true, + "roots": [ + "-1/131072", + "3/1048576", + "5/1048576" + ], + "sign": -1, + "stationary": true, + "status": "FINITE_BAR", + "u": "49/1099511627776", + "v": "-15/144115188075855872", + "younger_side": "right" + }, + { + "a": "1/262144", + "count": 1, + "critical_heights": [ + "9/302231454903657293676544", + "-23/302231454903657293676544", + "11/9444732965739290427392" + ], + "curvatures": [ + "-7/137438953472", + "5/137438953472", + "-35/274877906944" + ], + "discriminant": "1225/5192296858534827628530496329220096", + "h": "1/524288", + "hessian_signs": [ + -1, + 1, + -1 + ], + "lifetime": "1/9444732965739290427392", + "rectangle": true, + "roots": [ + "-3/524288", + "-1/524288", + "1/131072" + ], + "sign": 1, + "stationary": true, + "status": "FINITE_BAR", + "u": "13/274877906944", + "v": "3/36028797018963968", + "younger_side": "left" + }, + { + "a": "1/262144", + "count": 1, + "critical_heights": [ + "11/9444732965739290427392", + "-23/302231454903657293676544", + "9/302231454903657293676544" + ], + "curvatures": [ + "-35/274877906944", + "5/137438953472", + "-7/137438953472" + ], + "discriminant": "1225/5192296858534827628530496329220096", + "h": "1/524288", + "hessian_signs": [ + -1, + 1, + -1 + ], + "lifetime": "1/9444732965739290427392", + "rectangle": true, + "roots": [ + "-1/131072", + "1/524288", + "3/524288" + ], + "sign": -1, + "stationary": true, + "status": "FINITE_BAR", + "u": "13/274877906944", + "v": "-3/36028797018963968", + "younger_side": "right" + }, + { + "a": "1/262144", + "count": 1, + "critical_heights": [ + "1617/4835703278458516698824704", + "-111/4835703278458516698824704", + "39/37778931862957161709568" + ], + "curvatures": [ + "-45/549755813888", + "27/549755813888", + "-135/1099511627776" + ], + "discriminant": "164025/332306998946228968225951765070086144", + "h": "3/1048576", + "hessian_signs": [ + -1, + 1, + -1 + ], + "lifetime": "27/75557863725914323419136", + "rectangle": true, + "roots": [ + "-7/1048576", + "-1/1048576", + "1/131072" + ], + "sign": 1, + "stationary": true, + "status": "FINITE_BAR", + "u": "57/1099511627776", + "v": "7/144115188075855872", + "younger_side": "left" + }, + { + "a": "1/262144", + "count": 1, + "critical_heights": [ + "39/37778931862957161709568", + "-111/4835703278458516698824704", + "1617/4835703278458516698824704" + ], + "curvatures": [ + "-135/1099511627776", + "27/549755813888", + "-45/549755813888" + ], + "discriminant": "164025/332306998946228968225951765070086144", + "h": "3/1048576", + "hessian_signs": [ + -1, + 1, + -1 + ], + "lifetime": "27/75557863725914323419136", + "rectangle": true, + "roots": [ + "-1/131072", + "1/1048576", + "7/1048576" + ], + "sign": -1, + "stationary": true, + "status": "FINITE_BAR", + "u": "57/1099511627776", + "v": "-7/144115188075855872", + "younger_side": "right" + }, + { + "a": "1/262144", + "count": 0, + "critical_heights": [ + "-3/18889465931478580854784", + "-3/18889465931478580854784", + "3/2361183241434822606848" + ], + "curvatures": [ + "0", + "0", + "-9/68719476736" + ], + "discriminant": "0", + "h": "0", + "hessian_signs": [ + 0, + 0, + -1 + ], + "lifetime": "0", + "rectangle": true, + "roots": [ + "-1/262144", + "-1/262144", + "1/131072" + ], + "sign": 1, + "stationary": true, + "status": "EXCLUDED_DISCRIMINANT", + "u": "3/68719476736", + "v": "1/9007199254740992", + "younger_side": null + }, + { + "a": "1/262144", + "count": 0, + "critical_heights": [ + "3/2361183241434822606848", + "-3/18889465931478580854784", + "-3/18889465931478580854784" + ], + "curvatures": [ + "-9/68719476736", + "0", + "0" + ], + "discriminant": "0", + "h": "0", + "hessian_signs": [ + -1, + 0, + 0 + ], + "lifetime": "0", + "rectangle": true, + "roots": [ + "-1/131072", + "1/262144", + "1/262144" + ], + "sign": -1, + "stationary": true, + "status": "EXCLUDED_DISCRIMINANT", + "u": "3/68719476736", + "v": "-1/9007199254740992", + "younger_side": null + }, + { + "a": "1/262144", + "count": 0, + "critical_heights": [ + "1/1180591620717411303424", + "0", + "1/1180591620717411303424" + ], + "curvatures": [ + "-1/8589934592", + "1/17179869184", + "-1/8589934592" + ], + "discriminant": "1/1267650600228229401496703205376", + "h": "1/262144", + "hessian_signs": [ + -1, + 1, + -1 + ], + "lifetime": "0", + "rectangle": true, + "roots": [ + "-1/131072", + "0", + "1/131072" + ], + "sign": 1, + "stationary": true, + "status": "EXCLUDED_TIE", + "u": "1/17179869184", + "v": "0", + "younger_side": null + }, + { + "a": "1/262144", + "count": 0, + "critical_heights": [ + "1/1180591620717411303424", + "0", + "1/1180591620717411303424" + ], + "curvatures": [ + "-1/8589934592", + "1/17179869184", + "-1/8589934592" + ], + "discriminant": "1/1267650600228229401496703205376", + "h": "1/262144", + "hessian_signs": [ + -1, + 1, + -1 + ], + "lifetime": "0", + "rectangle": true, + "roots": [ + "-1/131072", + "0", + "1/131072" + ], + "sign": -1, + "stationary": true, + "status": "EXCLUDED_TIE", + "u": "1/17179869184", + "v": "0", + "younger_side": null + }, + { + "a": "1/262144", + "count": 0, + "critical_heights": [ + "3/147573952589676412928", + "-3/1180591620717411303424", + "-3/1180591620717411303424" + ], + "curvatures": [ + "-9/17179869184", + "0", + "0" + ], + "discriminant": "0", + "h": "3/262144", + "hessian_signs": [ + -1, + 0, + 0 + ], + "lifetime": "0", + "rectangle": true, + "roots": [ + "-1/65536", + "1/131072", + "1/131072" + ], + "sign": 1, + "stationary": true, + "status": "EXCLUDED_DISCRIMINANT", + "u": "3/17179869184", + "v": "-1/1125899906842624", + "younger_side": null + }, + { + "a": "1/262144", + "count": 0, + "critical_heights": [ + "-3/1180591620717411303424", + "-3/1180591620717411303424", + "3/147573952589676412928" + ], + "curvatures": [ + "0", + "0", + "-9/17179869184" + ], + "discriminant": "0", + "h": "3/262144", + "hessian_signs": [ + 0, + 0, + -1 + ], + "lifetime": "0", + "rectangle": true, + "roots": [ + "-1/131072", + "-1/131072", + "1/65536" + ], + "sign": -1, + "stationary": true, + "status": "EXCLUDED_DISCRIMINANT", + "u": "3/17179869184", + "v": "1/1125899906842624", + "younger_side": null + }, + { + "a": "1/262144", + "count": 1, + "critical_heights": [ + "117/18889465931478580854784", + "-11/18889465931478580854784", + "-1/2361183241434822606848" + ], + "curvatures": [ + "-5/17179869184", + "1/17179869184", + "-5/68719476736" + ], + "discriminant": "25/20282409603651670423947251286016", + "h": "1/131072", + "hessian_signs": [ + -1, + 1, + -1 + ], + "lifetime": "3/18889465931478580854784", + "rectangle": true, + "roots": [ + "-3/262144", + "1/262144", + "1/131072" + ], + "sign": 1, + "stationary": true, + "status": "FINITE_BAR", + "u": "7/68719476736", + "v": "-3/9007199254740992", + "younger_side": "right" + }, + { + "a": "1/262144", + "count": 1, + "critical_heights": [ + "-1/2361183241434822606848", + "-11/18889465931478580854784", + "117/18889465931478580854784" + ], + "curvatures": [ + "-5/68719476736", + "1/17179869184", + "-5/17179869184" + ], + "discriminant": "25/20282409603651670423947251286016", + "h": "1/131072", + "hessian_signs": [ + -1, + 1, + -1 + ], + "lifetime": "3/18889465931478580854784", + "rectangle": true, + "roots": [ + "-1/131072", + "-1/262144", + "3/262144" + ], + "sign": -1, + "stationary": true, + "status": "FINITE_BAR", + "u": "7/68719476736", + "v": "3/9007199254740992", + "younger_side": "left" + } + ], + "gates": { + "actual_theta2_gap": true, + "all_stationary_and_inside_rectangle": true, + "boundary_exclusion": true, + "chart_gaps": true, + "conditioning_detected": true, + "missing_sign_detected": true, + "outer_height_identity": true, + "reject_fixed_left": true, + "whole_rectangle_mass": true + }, + "missing_sign_mass": [ + "1/10", + "1/10" + ], + "status": "PASS", + "whole_rectangle_mass": [ + "1/5", + "1/5" + ] + }, + "poisson_target_interval": [ + "350463322308452862342756000390952727903421288082416376725075231759535363689/452312848583266388373324160190187140051835877600158453279131187530910662656", + "44859305255481966379872768050041949171691312537290570488888100841330813686635/57896044618658097711785492504343953926634992332820282019728792003956564819968" + ], + "rational_guards": { + "B0_upper": "1/2048", + "B1_upper": "33/32", + "D0_upper": "1/32", + "D1_upper": "65", + "R": "1/8", + "a_star": "1/128", + "analytic_cutoff_derivative_premise": "REVIEW_REQUIRED", + "complete_surgery_field": "NOT_RUN", + "delta": "1/67108864", + "g_star_lower": "1/2097152", + "gates": { + "chart": true, + "gradient": true, + "height": true, + "root_u": true, + "root_v": true, + "wedge_coverage": true + }, + "gradient_perturbation": "101441/140737488355328", + "height_perturbation": "1537/4503599627370496", + "independent_global_selector": "NOT_RUN", + "r1": "1/32", + "status": "PASS_RATIONAL_GUARDS", + "u0": "3/4294967296", + "v0": "1/140737488355328" + }, + "rows": [ + { + "cdf_mass": [ + "9698669598254516463664625632439578707/170141183460469231731687303715884105728", + "19397339196509032927329251266404394463/340282366920938463463374607431768211456" + ], + "cdf_normalized": [ + "9698669598254516463664625632439578707/42535295865117307932921825928971026432", + "19397339196509032927329251266404394463/85070591730234615865843651857942052864" + ], + "cdf_width": "1525237049/85070591730234615865843651857942052864", + "cdf_width_gate": true, + "coefficient_interval": [ + "382817662786055771396296433360739237888/1500551209471094366432841716734779043249", + "63802943797675961899382738893456539648/250091868245182394405473619455796507207" + ], + "coefficient_status": "PASS", + "direct": { + "arithmetic_components": { + "core_lower": "9181/2787593149816327892691964784081045188247552", + "core_upper": "73449/22300745198530623141535718272648361505980416", + "tail_lower": "17928823205402903742190656271235/494173754346680887669684154205273769117608451613322544863289874055168", + "tail_upper": "80482525469205421676355656259163/2223781894560063994513578693923731961029238032259951451884804433248256" + }, + "arithmetic_width": "45007482831053935846370286751054885/569288165007376382595476145644475382023484936258547571682509934911553536", + "core_interval": [ + "2647536933864141728483005680796778756164377/22300745198530623141535718272648361505980416", + "2647613907383517744327793305329746933280243/22300745198530623141535718272648361505980416" + ], + "discretization_components": { + "core": "76973519376015844787624532968177042417/22300745198530623141535718272648361505980416", + "tail": "886161973965527659142865650933522289122665720666585102117232885/2965042526080085326018104925231642614705650709679935269179739244331008" + }, + "discretization_width": "711701650534787808307978553824818632651449979659248044905143740759/189762721669125460865158715214825127341161645419515857227503311637184512", + "evaluations": 67586, + "gates": { + "arithmetic_width": true, + "core_discretization": true, + "core_monotonicity": true, + "core_range": true, + "core_scale": true, + "evaluation_budget": true, + "normalized_width": true, + "point_widths": true, + "root_auxiliary_lower": true, + "root_positive": true, + "root_upper": true, + "root_width": true, + "runtime_budget": true, + "tail_coefficient": true, + "tail_convexity": true, + "tail_discretization": true, + "tail_second_derivative": true + }, + "interval": [ + "14422776566555442204534881040013962495586059078251129750036675910047077/253016962225500614486878286953100169788215527226021142970004415516246016", + "649035621019752921021194266565160806711685919276331324648714451385933547/11385763300147527651909522912889507640469698725170951433650198698231070720" + ], + "j": 1, + "n": 4, + "normalized_interval": [ + "14422776566555442204534881040013962495586059078251129750036675910047077/63254240556375153621719571738275042447053881806505285742501103879061504", + "649035621019752921021194266565160806711685919276331324648714451385933547/2846440825036881912977380728222376910117424681292737858412549674557767680" + ], + "normalized_width": "5337762379010908562309882266247205156630377515242948532017716907541/1423220412518440956488690364111188455058712340646368929206274837278883840", + "partial": { + "completed_octaves": 2, + "core_nodes": 65537, + "tail_nodes": 2049 + }, + "root_bracket": [ + "6381941051065036702961263205/19807040628566084398385987584", + "25527764204260146811845052821/79228162514264337593543950336" + ], + "sliver_width": "3/99035203142830421991929937920", + "status": "CERTIFIED", + "tail_coefficient_interval": [ + "2163105094276530561568059254552629565/85070591730234615865843651857942052864", + "4326210188553061123136118509105259131/170141183460469231731687303715884105728" + ], + "tail_interval": [ + "13502450201659131712820309632589526548654808648023916464055720109997/123543438586670221917421038551318442279402112903330636215822468513792", + "972179073005379379906039722143398712391943692531705671872740824655091/8895127578240255978054314775694927844116952129039805807539217732993024" + ], + "tau": "1/8" + }, + "error_interval": [ + "196870968659600591411822434254493678457/340282366920938463463374607431768211456", + "49217742164900147852955608563623419615/85070591730234615865843651857942052864" + ], + "intersection_mass": [ + "9698669598254516463664625632439578707/170141183460469231731687303715884105728", + "19397339196509032927329251266404394463/340282366920938463463374607431768211456" + ], + "intersection_normalized": [ + "9698669598254516463664625632439578707/42535295865117307932921825928971026432", + "19397339196509032927329251266404394463/85070591730234615865843651857942052864" + ], + "j": 1, + "n": 4, + "outer_envelope_distance": "0", + "predicted_envelopes": { + "inner": [ + "-27524811623321476883053698492227923830235404788885185576866440466478229332111/85101852874150154136242729307427632078469484335131188369036314617658203963392", + "425681070523890301001356907222915335652647991011619586689860963856455373431721/510611117244900924817456375844565792473198882579233699458461509957971601260544" + ], + "outer": [ + "-41287217434982215324580547738341885746823044785585400175094981247213792217903/127652779311225231204364093961141448118299720644808424864615377489492900315136", + "17736711271828762541723204467621472318990481160808986068719863831953260617177/21275463218537538534060682326856908019617371083782797092259078654414550990848" + ] + }, + "schedule_identity": "1", + "status": "PASS", + "target_interval": [ + "350463322308452862342756000390952727903421288082416376725075231759535363689/452312848583266388373324160190187140051835877600158453279131187530910662656", + "44859305255481966379872768050041949171691312537290570488888100841330813686635/57896044618658097711785492504343953926634992332820282019728792003956564819968" + ], + "target_width_gate": true, + "tau": "1/8", + "void_interval": [ + "91562770438416798920980719739254274250601322857586406632375056348051373805975/115792089237316195423570985008687907853269984665640564039457584007913129639936", + "22890692609604199730245179935248786530917950482392610481724636293926016492663/28948022309329048855892746252171976963317496166410141009864396001978282409984" + ], + "void_width": "1740871873070479071984035294523488827652692164677/115792089237316195423570985008687907853269984665640564039457584007913129639936", + "void_width_gate": true + }, + { + "cdf_mass": [ + "2624695468104673502443769142824657795/170141183460469231731687303715884105728", + "328086933513084187805471142903044919/21267647932558653966460912964485513216" + ], + "cdf_normalized": [ + "2624695468104673502443769142824657795/10633823966279326983230456482242756608", + "328086933513084187805471142903044919/1329227995784915872903807060280344576" + ], + "cdf_width": "399701557/10633823966279326983230456482242756608", + "cdf_width_gate": true, + "coefficient_interval": [ + "382817662786055771396296433360739237888/1500551209471094366432841716734779043249", + "63802943797675961899382738893456539648/250091868245182394405473619455796507207" + ], + "coefficient_status": "PASS", + "direct": { + "arithmetic_components": { + "core_lower": "73409/22300745198530623141535718272648361505980416", + "core_upper": "36705/11150372599265311570767859136324180752990208", + "tail_lower": "27122242062741305583726477296425/546503250635706321482667191373180037577629820163085027849953878212608", + "tail_upper": "54173936702371614212003089266029/1093006501271412642965334382746360075155259640326170055699907756425216" + }, + "arithmetic_width": "29597268303106182359858187632766013/279809664325481636599125601983068179239746467923499534259176385644855296", + "core_interval": [ + "2653140110289112999439952454898371738686765/22300745198530623141535718272648361505980416", + "2653220128204615147720521692901952991004203/22300745198530623141535718272648361505980416" + ], + "discretization_components": { + "core": "20004478875537070142309500895313061007/5575186299632655785383929568162090376495104", + "tail": "103400324570556079161977333347984189930302364664473589422682323/273251625317853160741333595686590018788814910081542513924976939106304" + }, + "discretization_width": "277468665856574878952833471270853217542935863494110754011799110705/69952416081370409149781400495767044809936616980874883564794096411213824", + "evaluations": 68610, + "gates": { + "arithmetic_width": true, + "core_discretization": true, + "core_monotonicity": true, + "core_range": true, + "core_scale": true, + "evaluation_budget": true, + "normalized_width": true, + "point_widths": true, + "root_auxiliary_lower": true, + "root_positive": true, + "root_upper": true, + "root_width": true, + "runtime_budget": true, + "tail_coefficient": true, + "tail_convexity": true, + "tail_discretization": true, + "tail_second_derivative": true + }, + "interval": [ + "69063532249939816680299284966924486110866460978144099762856510554171539/4476954629207706185586009631729090867835943486775992548146822170317684736", + "345323210623016214899075481673569182801280352657100319899775787124466793/22384773146038530927930048158645454339179717433879962740734110851588423680" + ], + "j": 2, + "n": 16, + "normalized_interval": [ + "69063532249939816680299284966924486110866460978144099762856510554171539/279809664325481636599125601983068179239746467923499534259176385644855296", + "345323210623016214899075481673569182801280352657100319899775787124466793/1399048321627408182995628009915340896198732339617497671295881928224276480" + ], + "normalized_width": "924895552855249596509473157792041158007961063303514248872392268183/233174720271234697165938001652556816033122056602916278549313654704046080", + "partial": { + "completed_octaves": 3, + "core_nodes": 65537, + "tail_nodes": 3073 + }, + "root_bracket": [ + "6273549646760639504142653215/39614081257132168796771975168", + "12547099293521279008285306431/79228162514264337593543950336" + ], + "sliver_width": "3/24758800785707605497982484480", + "status": "CERTIFIED", + "tail_coefficient_interval": [ + "4457862325611189227578072284239717737/170141183460469231731687303715884105728", + "2228931162805594613789036142119858869/85070591730234615865843651857942052864" + ], + "tail_interval": [ + "279486873800924364796059927896546996111375510185252654472276601602233/2186013002542825285930668765492720150310519280652340111399815512850432", + "279487701003520929244693223715213780093242826008913198684998161592875/2186013002542825285930668765492720150310519280652340111399815512850432" + ], + "tau": "1/64" + }, + "error_interval": [ + "54003100070129049655397748644749334483/340282366920938463463374607431768211456", + "13500775017532262413849437161187333621/85070591730234615865843651857942052864" + ], + "intersection_mass": [ + "2624695468104673502443769142824657795/170141183460469231731687303715884105728", + "328086933513084187805471142903044919/21267647932558653966460912964485513216" + ], + "intersection_normalized": [ + "2624695468104673502443769142824657795/10633823966279326983230456482242756608", + "328086933513084187805471142903044919/1329227995784915872903807060280344576" + ], + "j": 2, + "n": 16, + "outer_envelope_distance": "0", + "predicted_envelopes": { + "inner": [ + "8205280544426672232023739716845054283828194908243494648126728507094548688507/85101852874150154136242729307427632078469484335131188369036314617658203963392", + "211300517517401406310892277968477466967266317748721204547606977215750494900195/510611117244900924817456375844565792473198882579233699458461509957971601260544" + ], + "outer": [ + "12307920816640008348035609575267581425272649134874742543684936271329816936603/127652779311225231204364093961141448118299720644808424864615377489492900315136", + "8804188229891725262953844915353227790349535302404224815268834778832167858419/21275463218537538534060682326856908019617371083782797092259078654414550990848" + ] + }, + "schedule_identity": "1", + "status": "PASS", + "target_interval": [ + "350463322308452862342756000390952727903421288082416376725075231759535363689/452312848583266388373324160190187140051835877600158453279131187530910662656", + "44859305255481966379872768050041949171691312537290570488888100841330813686635/57896044618658097711785492504343953926634992332820282019728792003956564819968" + ], + "target_width_gate": true, + "tau": "1/64", + "void_interval": [ + "5643241917561816134869548562459821554130165643822549837836732314669600896701/7237005577332262213973186563042994240829374041602535252466099000494570602496", + "45145935340494529078956388501402094779134822923198713326165814027626815818731/57896044618658097711785492504343953926634992332820282019728792003956564819968" + ], + "void_width": "1723522346093497772618314623471955510270008645123/57896044618658097711785492504343953926634992332820282019728792003956564819968", + "void_width_gate": true + }, + { + "cdf_mass": [ + "167877650387528921876409474825253669/42535295865117307932921825928971026432", + "335755300775057843752818949751585171/85070591730234615865843651857942052864" + ], + "cdf_normalized": [ + "167877650387528921876409474825253669/664613997892457936451903530140172288", + "335755300775057843752818949751585171/1329227995784915872903807060280344576" + ], + "cdf_width": "101077833/1329227995784915872903807060280344576", + "cdf_width_gate": true, + "coefficient_interval": [ + "382817662786055771396296433360739237888/1500551209471094366432841716734779043249", + "63802943797675961899382738893456539648/250091868245182394405473619455796507207" + ], + "coefficient_status": "PASS", + "direct": { + "arithmetic_components": { + "core_lower": "73389/22300745198530623141535718272648361505980416", + "core_upper": "36695/11150372599265311570767859136324180752990208", + "tail_lower": "37676993262597513286571191633517/544229167477084280050744355579665149243760024050181141341122706014208", + "tail_upper": "25107204732024496327170953425261/362819444984722853367162903719776766162506682700120760894081804009472" + }, + "arithmetic_width": "10101735270797920931888137743642769/69661333437066787846495277514197139103201283078423186091663706369818624", + "core_interval": [ + "165907425506149427106241216149548666557751/1393796574908163946345982392040522594123776", + "2654599581457681804056075045099121572732759/22300745198530623141535718272648361505980416" + ], + "discretization_components": { + "core": "80773359290970356215586706342907735353/22300745198530623141535718272648361505980416", + "tail": "218602324296254513712764581189031287637329878537430736188032853/544229167477084280050744355579665149243760024050181141341122706014208" + }, + "discretization_width": "280294635210491509336137192369512632063135588730876728076362940651/69661333437066787846495277514197139103201283078423186091663706369818624", + "evaluations": 69634, + "gates": { + "arithmetic_width": true, + "core_discretization": true, + "core_monotonicity": true, + "core_range": true, + "core_scale": true, + "evaluation_budget": true, + "normalized_width": true, + "point_widths": true, + "root_auxiliary_lower": true, + "root_positive": true, + "root_upper": true, + "root_width": true, + "runtime_budget": true, + "tail_coefficient": true, + "tail_convexity": true, + "tail_discretization": true, + "tail_second_derivative": true + }, + "interval": [ + "1099744642466359519050550468585749845936785800957704611625351426120293/278645333748267151385981110056788556412805132313692744366654825479274496", + "29326990956828271327196906113879255436482306452109711088548371232239411/7430542233287124036959496268181028171008136861698473183110795346113986560" + ], + "j": 3, + "n": 64, + "normalized_interval": [ + "1099744642466359519050550468585749845936785800957704611625351426120293/4353833339816674240405954844637321193950080192401449130728981648113664", + "29326990956828271327196906113879255436482306452109711088548371232239411/116102222395111313077492129190328565172002138464038643486106177283031040" + ], + "normalized_width": "1401473176052457546680854777778634504055279712764335616999607094793/348306667185333939232476387570985695516006415392115930458318531849093120", + "partial": { + "completed_octaves": 4, + "core_nodes": 65537, + "tail_nodes": 4097 + }, + "root_bracket": [ + "6247444452363566128536127877/79228162514264337593543950336", + "3123722226181783064268063939/39614081257132168796771975168" + ], + "sliver_width": "3/6189700196426901374495621120", + "status": "CERTIFIED", + "tail_coefficient_interval": [ + "8981022515107016918918097366515328721/340282366920938463463374607431768211456", + "8981022515107016918918097366515328723/340282366920938463463374607431768211456" + ], + "tail_interval": [ + "4542936952532828857252222864768670862454941085740608384895461891243/34014322967317767503171522223729071827735001503136321333820169125888", + "48458139895233038647032852400586615245485001199843344053213338953755/362819444984722853367162903719776766162506682700120760894081804009472" + ], + "tau": "1/512" + }, + "error_interval": [ + "7461735217357722082578188718510748921/170141183460469231731687303715884105728", + "7461735217357722082578188718510748931/170141183460469231731687303715884105728" + ], + "intersection_mass": [ + "167877650387528921876409474825253669/42535295865117307932921825928971026432", + "335755300775057843752818949751585171/85070591730234615865843651857942052864" + ], + "intersection_normalized": [ + "167877650387528921876409474825253669/664613997892457936451903530140172288", + "335755300775057843752818949751585171/1329227995784915872903807060280344576" + ], + "j": 3, + "n": 64, + "outer_envelope_distance": "0", + "predicted_envelopes": { + "inner": [ + "8989389065138528474091536931299605943129619384351627905923242736864311930097/42550926437075077068121364653713816039234742167565594184518157308829101981696", + "76329766001149549006968136546976260676203248589257371163428372908745974506793/255305558622450462408728187922282896236599441289616849729230754978985800630272" + ], + "outer": [ + "53936334390831170844549221587797635643719972064877319716632991932808505905645/255305558622450462408728187922282896236599441289616849729230754978985800630272", + "12721627666858258167828022757829376781859421422907801795529790459177364949461/42550926437075077068121364653713816039234742167565594184518157308829101981696" + ] + }, + "schedule_identity": "1", + "status": "PASS", + "target_interval": [ + "350463322308452862342756000390952727903421288082416376725075231759535363689/452312848583266388373324160190187140051835877600158453279131187530910662656", + "44859305255481966379872768050041949171691312537290570488888100841330813686635/57896044618658097711785492504343953926634992332820282019728792003956564819968" + ], + "target_width_gate": true, + "tau": "1/512", + "void_interval": [ + "89900387507344373351922568143626028688968345528720265717757432180290452398049/115792089237316195423570985008687907853269984665640564039457584007913129639936", + "11237548438418046668990321018811170989468768768019799869440438185222989484797/14474011154664524427946373126085988481658748083205070504932198000989141204992" + ], + "void_width": "6863339226781804615438133237766073301493463480327/115792089237316195423570985008687907853269984665640564039457584007913129639936", + "void_width_gate": true + }, + { + "cdf_mass": [ + "338093306672378950862883161169884765/340282366920938463463374607431768211456", + "5282707916755921107232549396447141/5316911983139663491615228241121378304" + ], + "cdf_normalized": [ + "338093306672378950862883161169884765/1329227995784915872903807060280344576", + "5282707916755921107232549396447141/20769187434139310514121985316880384" + ], + "cdf_width": "202732259/1329227995784915872903807060280344576", + "cdf_width_gate": true, + "coefficient_interval": [ + "382817662786055771396296433360739237888/1500551209471094366432841716734779043249", + "63802943797675961899382738893456539648/250091868245182394405473619455796507207" + ], + "coefficient_status": "PASS", + "direct": { + "arithmetic_components": { + "core_lower": "36661/11150372599265311570767859136324180752990208", + "core_upper": "73323/22300745198530623141535718272648361505980416", + "tail_lower": "58272215254452335987980966188139/543665803760632390209254876060405246483522234735025474629558056517632", + "tail_upper": "116711193603787368861619589449739/1087331607521264780418509752120810492967044469470050949259116113035264" + }, + "arithmetic_width": "15385964005255453580978689215741083/69589222881360945946784624135731871549890846046083260752583431234256896", + "core_interval": [ + "331857767610519992945684139272828560101165/2787593149816327892691964784081045188247552", + "2654943102762639076094203893153426735159549/22300745198530623141535718272648361505980416" + ], + "discretization_components": { + "core": "40480939239566264365389485399127138453/11150372599265311570767859136324180752990208", + "tail": "444155098118403639076305711250759356203195256771445452802979039/1087331607521264780418509752120810492967044469470050949259116113035264" + }, + "discretization_width": "140533275672422086019216541541137209924828953762099329087451783291/34794611440680472973392312067865935774945423023041630376291715617128448", + "evaluations": 70658, + "gates": { + "arithmetic_width": true, + "core_discretization": true, + "core_monotonicity": true, + "core_range": true, + "core_scale": true, + "evaluation_budget": true, + "normalized_width": true, + "point_widths": true, + "root_auxiliary_lower": true, + "root_positive": true, + "root_upper": true, + "root_width": true, + "runtime_budget": true, + "tail_coefficient": true, + "tail_convexity": true, + "tail_discretization": true, + "tail_second_derivative": true + }, + "interval": [ + "2212512643052213608732078042821547353419453798149232348664297882661491/2226855132203550270297107972343419889596507073474664344082669799496220672", + "88501911054845268570143314552842024415650056226776993393194746411414143/89074205288142010811884318893736795583860282938986573763306791979848826880" + ], + "j": 4, + "n": 256, + "normalized_interval": [ + "2212512643052213608732078042821547353419453798149232348664297882661491/8698652860170118243348078016966483943736355755760407594072928904282112", + "88501911054845268570143314552842024415650056226776993393194746411414143/347946114406804729733923120678659357749454230230416303762917156171284480" + ], + "normalized_width": "1405332756724220860192839980130278871904300807699446622831104954503/347946114406804729733923120678659357749454230230416303762917156171284480", + "partial": { + "completed_octaves": 5, + "core_nodes": 65537, + "tail_nodes": 5121 + }, + "root_bracket": [ + "1560244338515336245263977015/39614081257132168796771975168", + "3120488677030672490527954031/79228162514264337593543950336" + ], + "sliver_width": "3/1547425049106725343623905280", + "status": "CERTIFIED", + "tail_coefficient_interval": [ + "4498657538947561391542210144047022647/170141183460469231731687303715884105728", + "562332192368445173942776268005877831/21267647932558653966460912964485513216" + ], + "tail_interval": [ + "73559639802431857526830572855945811392174030904828419946007003319711/543665803760632390209254876060405246483522234735025474629558056517632", + "18389965469995229182162527752200359207551932326087622524885799883525/135916450940158097552313719015101311620880558683756368657389514129408" + ], + "tau": "1/4096" + }, + "error_interval": [ + "25/2048", + "25/2048" + ], + "intersection_mass": [ + "338093306672378950862883161169884765/340282366920938463463374607431768211456", + "5282707916755921107232549396447141/5316911983139663491615228241121378304" + ], + "intersection_normalized": [ + "338093306672378950862883161169884765/1329227995784915872903807060280344576", + "5282707916755921107232549396447141/20769187434139310514121985316880384" + ], + "j": 4, + "n": 256, + "outer_envelope_distance": "0", + "predicted_envelopes": { + "inner": [ + "124416132191510810109799008767404080518929/512188146166133543742409972645471246759936", + "821524353622619578980436138441163435275849/3073128876996801262454459835872827480573952" + ], + "outer": [ + "746496793149064860658794052604424483113399/3073128876996801262454459835872827480573952", + "136920725603769929830072689740193905879279/512188146166133543742409972645471246759936" + ] + }, + "schedule_identity": "1", + "status": "PASS", + "target_interval": [ + "350463322308452862342756000390952727903421288082416376725075231759535363689/452312848583266388373324160190187140051835877600158453279131187530910662656", + "44859305255481966379872768050041949171691312537290570488888100841330813686635/57896044618658097711785492504343953926634992332820282019728792003956564819968" + ], + "target_width_gate": true, + "tau": "1/4096", + "void_interval": [ + "89775909639145453659674819537090260754570753377922610198823643297511802183263/115792089237316195423570985008687907853269984665640564039457584007913129639936", + "89775909639145453659674819550796392731873240050505781697827162074527297110889/115792089237316195423570985008687907853269984665640564039457584007913129639936" + ], + "void_width": "6853065988651243336291585749501759388507747463813/57896044618658097711785492504343953926634992332820282019728792003956564819968", + "void_width_gate": true + }, + { + "cdf_mass": [ + "84700728865203967454530889197013491/340282366920938463463374607431768211456", + "84700728865203967454530889298451707/340282366920938463463374607431768211456" + ], + "cdf_normalized": [ + "84700728865203967454530889197013491/332306998946228968225951765070086144", + "84700728865203967454530889298451707/332306998946228968225951765070086144" + ], + "cdf_width": "12679777/41538374868278621028243970633760768", + "cdf_width_gate": true, + "coefficient_interval": [ + "382817662786055771396296433360739237888/1500551209471094366432841716734779043249", + "63802943797675961899382738893456539648/250091868245182394405473619455796507207" + ], + "coefficient_status": "PASS", + "direct": { + "arithmetic_components": { + "core_lower": "36651/11150372599265311570767859136324180752990208", + "core_upper": "73303/22300745198530623141535718272648361505980416", + "tail_lower": "15453552556804073736300644245977/67940660184779147750288573782455271144603575380799446703627053301760", + "tail_upper": "61906240849717512355740681706663/271762640739116591001154295129821084578414301523197786814508213207040" + }, + "arithmetic_width": "16064898236352459173028175127299813/34785618014606923648147749776617098826037030594969316712257051290501120", + "core_interval": [ + "663736972704714187299906287729843509786147/5575186299632655785383929568162090376495104", + "2655028899805947804674295976341004238443661/22300745198530623141535718272648361505980416" + ], + "discretization_components": { + "core": "40504493545527737335412710815099612885/11150372599265311570767859136324180752990208", + "tail": "55776356853798897469283656268675636628466558293185936499795331/135881320369558295500577147564910542289207150761598893407254106603520" + }, + "discretization_width": "70319945797480502185855481952958187092235253849400598332833983693/17392809007303461824073874888308549413018515297484658356128525645250560", + "evaluations": 71682, + "gates": { + "arithmetic_width": true, + "core_discretization": true, + "core_monotonicity": true, + "core_range": true, + "core_scale": true, + "evaluation_budget": true, + "normalized_width": true, + "point_widths": true, + "root_auxiliary_lower": true, + "root_positive": true, + "root_upper": true, + "root_width": true, + "runtime_budget": true, + "tail_coefficient": true, + "tail_convexity": true, + "tail_discretization": true, + "tail_second_derivative": true + }, + "interval": [ + "443316666850063038125533262144600182749065810216265631464128298290799/1781023642347874490785164788562795459893095966462429015667561026073657344", + "8866473976892855723515037223612054742126867023037191412255153888348613/35620472846957489815703295771255909197861919329248580313351220521473146880" + ], + "j": 5, + "n": 1024, + "normalized_interval": [ + "443316666850063038125533262144600182749065810216265631464128298290799/1739280900730346182407387488830854941301851529748465835612852564525056", + "8866473976892855723515037223612054742126867023037191412255153888348613/34785618014606923648147749776617098826037030594969316712257051290501120" + ], + "normalized_width": "140639891594961004371980720051087145550818711878782972587922532633/34785618014606923648147749776617098826037030594969316712257051290501120", + "partial": { + "completed_octaves": 6, + "core_nodes": 65537, + "tail_nodes": 6145 + }, + "root_bracket": [ + "194980132417833496902764243/9903520314283042199192993792", + "1559841059342667975222113945/79228162514264337593543950336" + ], + "sliver_width": "3/386856262276681335905976320", + "status": "CERTIFIED", + "tail_coefficient_interval": [ + "9001386241226970938761581282872892733/340282366920938463463374607431768211456", + "4500693120613485469380790641436446369/170141183460469231731687303715884105728" + ], + "tail_interval": [ + "3691434848817807230939613172825287856223202327526133892459591484169/27176264073911659100115429512982108457841430152319778681450821320704", + "7382892008178355981438214059113083195082304211619087530441919227803/54352528147823318200230859025964216915682860304639557362901642641408" + ], + "tau": "1/32768" + }, + "error_interval": [ + "582104534419311015575333515954692435/170141183460469231731687303715884105728", + "1164209068838622031150667031909385087/340282366920938463463374607431768211456" + ], + "intersection_mass": [ + "84700728865203967454530889197013491/340282366920938463463374607431768211456", + "84700728865203967454530889298451707/340282366920938463463374607431768211456" + ], + "intersection_normalized": [ + "84700728865203967454530889197013491/332306998946228968225951765070086144", + "84700728865203967454530889298451707/332306998946228968225951765070086144" + ], + "j": 5, + "n": 1024, + "outer_envelope_distance": "0", + "predicted_envelopes": { + "inner": [ + "10709928755471475750258357483734413653429659074940013114891504615806910024699/42550926437075077068121364653713816039234742167565594184518157308829101981696", + "66006527859151865349967213232367414414354853030946491032149781648672493543779/255305558622450462408728187922282896236599441289616849729230754978985800630272" + ], + "outer": [ + "128519145065657709003100289804812963515528146980570809508553348189012502217265/510611117244900924817456375844565792473198882579233699458461509957971601260544", + "22002175953050621783322404410789138192386861508939764871001360193261445629497/85101852874150154136242729307427632078469484335131188369036314617658203963392" + ] + }, + "schedule_identity": "1", + "status": "PASS", + "target_interval": [ + "350463322308452862342756000390952727903421288082416376725075231759535363689/452312848583266388373324160190187140051835877600158453279131187530910662656", + "44859305255481966379872768050041949171691312537290570488888100841330813686635/57896044618658097711785492504343953926634992332820282019728792003956564819968" + ], + "target_width_gate": true, + "tau": "1/32768", + "void_interval": [ + "44868247241629931695551999806273810640294954035539441626007983740764604288621/57896044618658097711785492504343953926634992332820282019728792003956564819968", + "22434123620814965847775999909986728139866005755018234800973659023051660499567/28948022309329048855892746252171976963317496166410141009864396001978282409984" + ], + "void_width": "13699645639437057474497027975939334305338716710513/57896044618658097711785492504343953926634992332820282019728792003956564819968", + "void_width_gate": true + }, + { + "cdf_mass": [ + "21188594396515301654298523599511523/340282366920938463463374607431768211456", + "21188594396515301654298523650239643/340282366920938463463374607431768211456" + ], + "cdf_normalized": [ + "21188594396515301654298523599511523/83076749736557242056487941267521536", + "21188594396515301654298523650239643/83076749736557242056487941267521536" + ], + "cdf_width": "6341015/10384593717069655257060992658440192", + "cdf_width_gate": true, + "coefficient_interval": [ + "382817662786055771396296433360739237888/1500551209471094366432841716734779043249", + "63802943797675961899382738893456539648/250091868245182394405473619455796507207" + ], + "coefficient_status": "PASS", + "direct": { + "arithmetic_components": { + "core_lower": "73259/22300745198530623141535718272648361505980416", + "core_upper": "18315/5575186299632655785383929568162090376495104", + "tail_lower": "11770353541563378763146804905079/33968135672901807226328420744179234321871770551002013692977114775552", + "tail_upper": "94157369241469135033437621502559/271745085383214457810627365953433874574974164408016109543816918204416" + }, + "arithmetic_width": "12166758438988952856843571625381065/17391685464525725299880151421019767972798346522113031010804282765082624", + "core_interval": [ + "2654969323107844266511702761257577522429323/22300745198530623141535718272648361505980416", + "663762585967691733789827961327236340635711/5575186299632655785383929568162090376495104" + ], + "discretization_components": { + "core": "81020762922668647609084051367840040261/22300745198530623141535718272648361505980416", + "tail": "111704960335015331716814714321741572226943665431430344345387305/271745085383214457810627365953433874574974164408016109543816918204416" + }, + "discretization_width": "70334791854949800268612348475938771048187030233939212294000867099/17391685464525725299880151421019767972798346522113031010804282765082624", + "evaluations": 72706, + "gates": { + "arithmetic_width": true, + "core_discretization": true, + "core_monotonicity": true, + "core_range": true, + "core_scale": true, + "evaluation_budget": true, + "normalized_width": true, + "point_widths": true, + "root_auxiliary_lower": true, + "root_positive": true, + "root_upper": true, + "root_width": true, + "runtime_budget": true, + "tail_coefficient": true, + "tail_convexity": true, + "tail_discretization": true, + "tail_second_derivative": true + }, + "interval": [ + "4435688056440540262220611493978282333857958089339752792828368045804885/71236343662697370828309100220496969616582027354574975020254342205778427904", + "5544697989040494015026100807255246405076691392371238866068635554847973/89045429578371713535386375275621212020727534193218718775317927757223034880" + ], + "j": 6, + "n": 4096, + "normalized_interval": [ + "4435688056440540262220611493978282333857958089339752792828368045804885/17391685464525725299880151421019767972798346522113031010804282765082624", + "5544697989040494015026100807255246405076691392371238866068635554847973/21739606830657156624850189276274709965997933152641288763505353456353280" + ], + "normalized_width": "351673959274749001345759129573951016975122786191500132701990367467/86958427322628626499400757105098839863991732610565155054021413825413120", + "partial": { + "completed_octaves": 7, + "core_nodes": 65537, + "tail_nodes": 7169 + }, + "root_bracket": [ + "389935074135362266915552719/39614081257132168796771975168", + "779870148270724533831105439/79228162514264337593543950336" + ], + "sliver_width": "3/96714065569170333976494080", + "status": "CERTIFIED", + "tail_coefficient_interval": [ + "9002403908730930181953563128065814865/340282366920938463463374607431768211456", + "2250600977182732545488390782016453717/85070591730234615865843651857942052864" + ], + "tail_interval": [ + "9238893503024221100784850489543518213986010751119070856609586747723/67936271345803614452656841488358468643743541102004027385954229551104", + "9238921429264304854617779693222098672918409797402712472555078470189/67936271345803614452656841488358468643743541102004027385954229551104" + ], + "tau": "1/262144" + }, + "error_interval": [ + "328437875844256303119245977361142447/340282366920938463463374607431768211456", + "20527367240266018944952873585071403/21267647932558653966460912964485513216" + ], + "intersection_mass": [ + "21188594396515301654298523599511523/340282366920938463463374607431768211456", + "21188594396515301654298523650239643/340282366920938463463374607431768211456" + ], + "intersection_normalized": [ + "21188594396515301654298523599511523/83076749736557242056487941267521536", + "21188594396515301654298523650239643/83076749736557242056487941267521536" + ], + "j": 6, + "n": 4096, + "outer_envelope_distance": "0", + "predicted_envelopes": { + "inner": [ + "21628877090024417321188750810065938380865906426811066565737997586297922691959/85101852874150154136242729307427632078469484335131188369036314617658203963392", + "130758938243814935775902211409152162384664326001955779488473413221858533535231/510611117244900924817456375844565792473198882579233699458461509957971601260544" + ], + "outer": [ + "8110828908759156495445781553774726892730786767891524702117081817450701819461/31913194827806307801091023490285362029574930161202106216153844372373225078784", + "1362072273373072247665648035512001691522526855690582958966504377257831089389/5318865804634384633515170581714227004904342770945699273064769663603637747712" + ] + }, + "schedule_identity": "1", + "status": "PASS", + "target_interval": [ + "350463322308452862342756000390952727903421288082416376725075231759535363689/452312848583266388373324160190187140051835877600158453279131187530910662656", + "44859305255481966379872768050041949171691312537290570488888100841330813686635/57896044618658097711785492504343953926634992332820282019728792003956564819968" + ], + "target_width_gate": true, + "tau": "1/262144", + "void_interval": [ + "89724142512924242437054353086579613680797412165066894724448290279579710740733/115792089237316195423570985008687907853269984665640564039457584007913129639936", + "44862071256462121218527176570685079971939657814894357964649935852835349381643/57896044618658097711785492504343953926634992332820282019728792003956564819968" + ], + "void_width": "54790546263081903464721821204851581426090988022553/115792089237316195423570985008687907853269984665640564039457584007913129639936", + "void_width_gate": true + }, + { + "cdf_mass": [ + "5298159631183492748335016824718461/340282366920938463463374607431768211456", + "82783744237242074192734638282557/5316911983139663491615228241121378304" + ], + "cdf_normalized": [ + "5298159631183492748335016824718461/20769187434139310514121985316880384", + "82783744237242074192734638282557/324518553658426726783156020576256" + ], + "cdf_width": "25365187/20769187434139310514121985316880384", + "cdf_width_gate": true, + "coefficient_interval": [ + "382817662786055771396296433360739237888/1500551209471094366432841716734779043249", + "63802943797675961899382738893456539648/250091868245182394405473619455796507207" + ], + "coefficient_status": "PASS", + "direct": { + "arithmetic_components": { + "core_lower": "73333/22300745198530623141535718272648361505980416", + "core_upper": "36667/11150372599265311570767859136324180752990208", + "tail_lower": "8037619208867396769036450693757/8491896786387040844462594696781299038513710754646923224183883169792", + "tail_upper": "8056140825791529012920584256937/8491896786387040844462594696781299038513710754646923224183883169792" + }, + "arithmetic_width": "2067149994934794352231958940296519/1086962788657541228091212121188006276929754976594806172695537045733376", + "core_interval": [ + "1327487340427783111013742349373981152443137/11150372599265311570767859136324180752990208", + "1327527852281182125302851117179601391826731/11150372599265311570767859136324180752990208" + ], + "discretization_components": { + "core": "40511853399014289108767805620239346927/11150372599265311570767859136324180752990208", + "tail": "6984380940731532799078370303645795739941552425950727218498533/16983793572774081688925189393562598077027421509293846448367766339584" + }, + "discretization_width": "2198092373111691751996081030487917872525536169197557439425356603/543481394328770614045606060594003138464877488297403086347768522866688", + "evaluations": 73730, + "gates": { + "arithmetic_width": true, + "core_discretization": true, + "core_monotonicity": true, + "core_range": true, + "core_scale": true, + "evaluation_budget": true, + "normalized_width": true, + "point_widths": true, + "root_auxiliary_lower": true, + "root_positive": true, + "root_upper": true, + "root_width": true, + "runtime_budget": true, + "tail_coefficient": true, + "tail_convexity": true, + "tail_discretization": true, + "tail_second_derivative": true + }, + "interval": [ + "138639469657658427518066957549669311518558785013463409898157722351957/8904399164682577740523209696772147420608552768264652166721839478647816192", + "693208338750157696049095105321453503803600747579462653533407232692291/44521995823412888702616048483860737103042763841323260833609197393239080960" + ], + "j": 7, + "n": 16384, + "normalized_interval": [ + "138639469657658427518066957549669311518558785013463409898157722351957/543481394328770614045606060594003138464877488297403086347768522866688", + "693208338750157696049095105321453503803600747579462653533407232692291/2717406971643853070228030302970015692324387441487015431738842614333440" + ], + "normalized_width": "5495230932779229380158786553473105403411256072802021309310466253/1358703485821926535114015151485007846162193720743507715869421307166720", + "partial": { + "completed_octaves": 8, + "core_nodes": 65537, + "tail_nodes": 8193 + }, + "root_bracket": [ + "389928777350152502823864487/79228162514264337593543950336", + "48741097168769062852983061/9903520314283042199192993792" + ], + "sliver_width": "3/24178516392292583494123520", + "status": "CERTIFIED", + "tail_coefficient_interval": [ + "2250664579475712881388577069870843413/85070591730234615865843651857942052864", + "9002658317902851525554308279483373675/340282366920938463463374607431768211456" + ], + "tail_interval": [ + "1155254378243078672124820685996149281266065765223707701615767119525/8491896786387040844462594696781299038513710754646923224183883169792", + "2310515740867098075782440450362602224440153123582899379799921251457/16983793572774081688925189393562598077027421509293846448367766339584" + ], + "tau": "1/2097152" + }, + "error_interval": [ + "23306069226951920802974241311309827/85070591730234615865843651857942052864", + "93224276907807683211896965245241745/340282366920938463463374607431768211456" + ], + "intersection_mass": [ + "5298159631183492748335016824718461/340282366920938463463374607431768211456", + "82783744237242074192734638282557/5316911983139663491615228241121378304" + ], + "intersection_normalized": [ + "5298159631183492748335016824718461/20769187434139310514121985316880384", + "82783744237242074192734638282557/324518553658426726783156020576256" + ], + "j": 7, + "n": 16384, + "outer_envelope_distance": "0", + "predicted_envelopes": { + "inner": [ + "5421925524604776700802842236806706257038450468865124158158734550678112528683/21275463218537538534060682326856908019617371083782797092259078654414550990848", + "32601497048361699720941625646546710625233826703716660986688104520071639419155/127652779311225231204364093961141448118299720644808424864615377489492900315136" + ], + "outer": [ + "130126212590514640819268213683360946512078861201767654145191882254861455615423/510611117244900924817456375844565792473198882579233699458461509957971601260544", + "21734331365574466480627750431031141026296325287664210048300866414031061563703/85101852874150154136242729307427632078469484335131188369036314617658203963392" + ] + }, + "schedule_identity": "1", + "status": "PASS", + "target_interval": [ + "350463322308452862342756000390952727903421288082416376725075231759535363689/452312848583266388373324160190187140051835877600158453279131187530910662656", + "44859305255481966379872768050041949171691312537290570488888100841330813686635/57896044618658097711785492504343953926634992332820282019728792003956564819968" + ], + "target_width_gate": true, + "tau": "1/2097152", + "void_interval": [ + "89720309185232737786561057061217050587885772974241691886832516059474983385057/115792089237316195423570985008687907853269984665640564039457584007913129639936", + "2803759662038523055830033036587287904474832467615015459187802807274192427923/3618502788666131106986593281521497120414687020801267626233049500247285301248" + ], + "void_width": "109576162355308865989438802807177173773299174308479/115792089237316195423570985008687907853269984665640564039457584007913129639936", + "void_width_gate": true + }, + { + "cdf_mass": [ + "165576992316951126040846910950015/42535295865117307932921825928971026432", + "1324615938535609008326775300282855/340282366920938463463374607431768211456" + ], + "cdf_normalized": [ + "165576992316951126040846910950015/649037107316853453566312041152512", + "1324615938535609008326775300282855/5192296858534827628530496329220096" + ], + "cdf_width": "12682735/5192296858534827628530496329220096", + "cdf_width_gate": true, + "coefficient_interval": [ + "382817662786055771396296433360739237888/1500551209471094366432841716734779043249", + "63802943797675961899382738893456539648/250091868245182394405473619455796507207" + ], + "coefficient_status": "PASS", + "direct": { + "arithmetic_components": { + "core_lower": "36671/11150372599265311570767859136324180752990208", + "core_upper": "573/174224571863520493293247799005065324265472", + "tail_lower": "21355196821481688537505170835781/16983725009276892712051425648178585419315346487548154580912482287616", + "tail_upper": "21352857258262431796503318035309/16983725009276892712051425648178585419315346487548154580912482287616" + }, + "arithmetic_width": "2740465068819871499513997035458839/1086958400593721133571291241483429466836182175203081893178398866407424", + "core_interval": [ + "663744005068054034045647770002624731275617/5575186299632655785383929568162090376495104", + "1327528522357488923220413138441498574940121/11150372599265311570767859136324180752990208" + ], + "discretization_components": { + "core": "40512221380855129117598436249112352215/11150372599265311570767859136324180752990208", + "tail": "13970435275620490281251131141552302938640659468431993872090979/33967450018553785424102851296357170838630692975096309161824964575232" + }, + "discretization_width": "4396258223529655653818053557418748517141828631900181752447838223/1086958400593721133571291241483429466836182175203081893178398866407424", + "evaluations": 74754, + "gates": { + "arithmetic_width": true, + "core_discretization": true, + "core_monotonicity": true, + "core_range": true, + "core_scale": true, + "evaluation_budget": true, + "normalized_width": true, + "point_widths": true, + "root_auxiliary_lower": true, + "root_positive": true, + "root_upper": true, + "root_width": true, + "runtime_budget": true, + "tail_coefficient": true, + "tail_convexity": true, + "tail_discretization": true, + "tail_second_derivative": true + }, + "interval": [ + "19806695444553867896617565311841695870669965724049474202865749429903/5088207552950722014980581628704145252755431073864941067952824864919781376", + "1386490662409888401041501359429452679860734656841473750976833430761957/356174528706550541048640714009290167692880175170545874756697740544384696320" + ], + "j": 8, + "n": 65536, + "normalized_interval": [ + "19806695444553867896617565311841695870669965724049474202865749429903/77639885756694366683663660105959247631155869657362992369885633314816", + "1386490662409888401041501359429452679860734656841473750976833430761957/5434792002968605667856456207417147334180910876015409465891994332037120" + ], + "normalized_width": "21981291117648278271787600533968913837056158010556776230970668747/5434792002968605667856456207417147334180910876015409465891994332037120", + "partial": { + "completed_octaves": 9, + "core_nodes": 65537, + "tail_nodes": 9217 + }, + "root_bracket": [ + "194963601604728416821066705/79228162514264337593543950336", + "97481800802364208410533353/39614081257132168796771975168" + ], + "sliver_width": "3/6044629098073145873530880", + "status": "CERTIFIED", + "tail_coefficient_interval": [ + "9002721919714389949666210451752390185/340282366920938463463374607431768211456", + "9002721919714389949666210451752390189/340282366920938463463374607431768211456" + ], + "tail_interval": [ + "330106728687810769315293380957908852492715331653672793626880499355/2426246429896698958864489378311226488473620926792593511558926041088", + "4621508172064626390904388584541865529906667800335751135776835152567/33967450018553785424102851296357170838630692975096309161824964575232" + ], + "tau": "1/16777216" + }, + "error_interval": [ + "41/524288", + "41/524288" + ], + "finite_void": { + "declared_allowance": "115/1048576", + "endpoint_distance": "518538081611300330636719918461647525585798813205589795474212705283500573/115792089237316195423570985008687907853269984665640564039457584007913129639936", + "gates": { + "allowance_identity": true, + "error_allowance": true, + "mass_gate": true + }, + "minimum_distance": "259269040805650165318250384566706769461337829853870621210392647942263685/57896044618658097711785492504343953926634992332820282019728792003956564819968", + "poissonization_error_upper": "1/1048576", + "status": "PASS" + }, + "intersection_mass": [ + "165576992316951126040846910950015/42535295865117307932921825928971026432", + "1324615938535609008326775300282855/340282366920938463463374607431768211456" + ], + "intersection_normalized": [ + "165576992316951126040846910950015/649037107316853453566312041152512", + "1324615938535609008326775300282855/5192296858534827628530496329220096" + ], + "j": 8, + "n": 65536, + "outer_envelope_distance": "0", + "predicted_envelopes": { + "inner": [ + "33440864031197882234132952990574854602175137/131120165418530187198056952997240639170543616", + "200768229386363923142845210964221379494596953/786720992511181123188341717983443835026931712" + ], + "outer": [ + "200645184187187293404797717943449127613050535/786720992511181123188341717983443835026931712", + "33461371564393987190474201827370229915766111/131120165418530187198056952997240639170543616" + ] + }, + "schedule_identity": "1", + "status": "PASS", + "target_interval": [ + "350463322308452862342756000390952727903421288082416376725075231759535363689/452312848583266388373324160190187140051835877600158453279131187530910662656", + "44859305255481966379872768050041949171691312537290570488888100841330813686635/57896044618658097711785492504343953926634992332820282019728792003956564819968" + ], + "target_width_gate": true, + "tau": "1/16777216", + "void_interval": [ + "2803722782782673251877380393776657242403798367195026522469331952123672246895/3618502788666131106986593281521497120414687020801267626233049500247285301248", + "89719129049045544060076172820002359990801435547911798031414733543146336604957/115792089237316195423570985008687907853269984665640564039457584007913129639936" + ], + "void_width": "219149328233879887797670949312396111075188824704317/115792089237316195423570985008687907853269984665640564039457584007913129639936", + "void_width_gate": true + } + ], + "schema_version": 1, + "scope_statuses": { + "analytic_cutoff_derivative_premise": "REVIEW_REQUIRED", + "blind_50_campaign": "NOT_RUN", + "complete_surgery_field": "NOT_RUN", + "exact_non_gaussian_population": "PASS", + "gaussian_universality": "NOT_RUN", + "higher_homology": "NOT_RUN", + "independent_global_h0_selector": "NOT_RUN", + "lean_kernel": "NOT_RUN", + "organizational_independence_credit": 0, + "rational_guard_consequents": "PASS_RATIONAL_GUARDS", + "same_field_spatial_poisson": "NOT_RUN", + "scientific_promotion": "NOT_RUN" + }, + "status": "PASS" +} diff --git a/experiments/universality/results/exact_population_1/RESULTS.md b/experiments/universality/results/exact_population_1/RESULTS.md new file mode 100644 index 000000000..ea148dd3e --- /dev/null +++ b/experiments/universality/results/exact_population_1/RESULTS.md @@ -0,0 +1,49 @@ +# Frozen exact cusp-population attempt + +Disposition: **PASS**. + +This deterministic interval calculation addresses the fixed whole-rectangle +non-Gaussian population, eight coefficient predictions and one row-8 finite +iid-copy void prediction. It has no random seed or numerical field draw. + +| j | tau | Direct normalized interval | CDF normalized interval | Coefficient | Row disposition | Evaluations | +|---|---|---|---|---|---|---| +| 1 | 1/8 | [14422776566555442204534881040013962495586059078251129750036675910047077/63254240556375153621719571738275042447053881806505285742501103879061504, 649035621019752921021194266565160806711685919276331324648714451385933547/2846440825036881912977380728222376910117424681292737858412549674557767680] | [9698669598254516463664625632439578707/42535295865117307932921825928971026432, 19397339196509032927329251266404394463/85070591730234615865843651857942052864] | PASS | PASS | 67586 | +| 2 | 1/64 | [69063532249939816680299284966924486110866460978144099762856510554171539/279809664325481636599125601983068179239746467923499534259176385644855296, 345323210623016214899075481673569182801280352657100319899775787124466793/1399048321627408182995628009915340896198732339617497671295881928224276480] | [2624695468104673502443769142824657795/10633823966279326983230456482242756608, 328086933513084187805471142903044919/1329227995784915872903807060280344576] | PASS | PASS | 68610 | +| 3 | 1/512 | [1099744642466359519050550468585749845936785800957704611625351426120293/4353833339816674240405954844637321193950080192401449130728981648113664, 29326990956828271327196906113879255436482306452109711088548371232239411/116102222395111313077492129190328565172002138464038643486106177283031040] | [167877650387528921876409474825253669/664613997892457936451903530140172288, 335755300775057843752818949751585171/1329227995784915872903807060280344576] | PASS | PASS | 69634 | +| 4 | 1/4096 | [2212512643052213608732078042821547353419453798149232348664297882661491/8698652860170118243348078016966483943736355755760407594072928904282112, 88501911054845268570143314552842024415650056226776993393194746411414143/347946114406804729733923120678659357749454230230416303762917156171284480] | [338093306672378950862883161169884765/1329227995784915872903807060280344576, 5282707916755921107232549396447141/20769187434139310514121985316880384] | PASS | PASS | 70658 | +| 5 | 1/32768 | [443316666850063038125533262144600182749065810216265631464128298290799/1739280900730346182407387488830854941301851529748465835612852564525056, 8866473976892855723515037223612054742126867023037191412255153888348613/34785618014606923648147749776617098826037030594969316712257051290501120] | [84700728865203967454530889197013491/332306998946228968225951765070086144, 84700728865203967454530889298451707/332306998946228968225951765070086144] | PASS | PASS | 71682 | +| 6 | 1/262144 | [4435688056440540262220611493978282333857958089339752792828368045804885/17391685464525725299880151421019767972798346522113031010804282765082624, 5544697989040494015026100807255246405076691392371238866068635554847973/21739606830657156624850189276274709965997933152641288763505353456353280] | [21188594396515301654298523599511523/83076749736557242056487941267521536, 21188594396515301654298523650239643/83076749736557242056487941267521536] | PASS | PASS | 72706 | +| 7 | 1/2097152 | [138639469657658427518066957549669311518558785013463409898157722351957/543481394328770614045606060594003138464877488297403086347768522866688, 693208338750157696049095105321453503803600747579462653533407232692291/2717406971643853070228030302970015692324387441487015431738842614333440] | [5298159631183492748335016824718461/20769187434139310514121985316880384, 82783744237242074192734638282557/324518553658426726783156020576256] | PASS | PASS | 73730 | +| 8 | 1/16777216 | [19806695444553867896617565311841695870669965724049474202865749429903/77639885756694366683663660105959247631155869657362992369885633314816, 1386490662409888401041501359429452679860734656841473750976833430761957/5434792002968605667856456207417147334180910876015409465891994332037120] | [165576992316951126040846910950015/649037107316853453566312041152512, 1324615938535609008326775300282855/5192296858534827628530496329220096] | PASS | PASS | 74754 | + +All mathematical endpoints and exact arithmetic, discretization and +root-sliver widths are retained in CERTIFICATE.json. A partial sum is +reported as partial work and never used as a probability enclosure. + +Row-8 void interval: [2803722782782673251877380393776657242403798367195026522469331952123672246895/3618502788666131106986593281521497120414687020801267626233049500247285301248, 89719129049045544060076172820002359990801435547911798031414733543146336604957/115792089237316195423570985008687907853269984665640564039457584007913129639936]. +Target exp(-B): [350463322308452862342756000390952727903421288082416376725075231759535363689/452312848583266388373324160190187140051835877600158453279131187530910662656, 44859305255481966379872768050041949171691312537290570488888100841330813686635/57896044618658097711785492504343953926634992332820282019728792003956564819968]. +Maximum cross-endpoint distance: 518538081611300330636719918461647525585798813205589795474212705283500573/115792089237316195423570985008687907853269984665640564039457584007913129639936; strict threshold 1/8192; disposition PASS. + +Scope statuses: + +- exact_non_gaussian_population: PASS +- rational_guard_consequents: PASS_RATIONAL_GUARDS +- analytic_cutoff_derivative_premise: REVIEW_REQUIRED +- complete_surgery_field: NOT_RUN +- independent_global_h0_selector: NOT_RUN +- gaussian_universality: NOT_RUN +- blind_50_campaign: NOT_RUN +- higher_homology: NOT_RUN +- same_field_spatial_poisson: NOT_RUN +- lean_kernel: NOT_RUN +- scientific_promotion: NOT_RUN +- organizational_independence_credit: 0 + +The rational guards check consequences of analytic cutoff derivative +premises. Construction/evaluation of the complete surgery field and an +independent global H0 selector remain NOT_RUN. Shared outward elementary +primitives and source-exposed same-provider reviews provide zero +organizational independence credit. PASS does not admit a theorem or +promote scientific status. Source drift, failure or budget exhaustion +remains attached to this original attempt. diff --git a/experiments/universality/results/exact_population_1/RUN.json b/experiments/universality/results/exact_population_1/RUN.json new file mode 100644 index 000000000..ea8b5d94b --- /dev/null +++ b/experiments/universality/results/exact_population_1/RUN.json @@ -0,0 +1,127 @@ +{ + "actual_route_evaluations": 569360, + "command": "python3 -B -S experiments/universality/two_parameter_cusp_population/run_population_certificate.py", + "end_utc": "2026-10-09T18:20:30.645833+00:00", + "exit_code": 0, + "exposure": "Source-exposed same provider/team", + "final_runtime_budget_gate": "PASS", + "full_declared_campaign": true, + "invocation_scope": "declared full attempt", + "organizational_independence_credit": 0, + "outputs": { + "CERTIFICATE.json": { + "bytes": 71881, + "sha256": "8df03e0bfc338f27796c25816e319ee2304222d325540fe3372c2308a2d1a015" + }, + "RESULTS.md": { + "bytes": 6290, + "sha256": "8fe63fb42cd05fc7438e54e235b46e7fc74bb42b2ca8d5007d0011e62808c4c9" + } + }, + "parameters": { + "A": "1/65536", + "L": "1", + "d": 2, + "evaluation_budget_per_row": 80000, + "rectangle_density": "151115727451828646838272/3", + "rng": "NONE", + "rows": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ], + "u0": "3/4294967296", + "v0": "1/140737488355328", + "wall_clock_budget_seconds": 900, + "whole_rectangle_bar_mass": "1/5" + }, + "performer": "OpenAI/Codex population certificate runner", + "python": "3.9.6 (default, Dec 2 2025, 07:27:58) \n[Clang 17.0.0 (clang-1700.6.3.2)]", + "runtime_seconds": "29.981752", + "schema_version": 1, + "source_drift": [], + "sources_after": { + "experiments/periodic_h0/finite_certificate.py": { + "bytes": 14843, + "sha256": "0674a2621dff6c040cbb24cc0b6e6df7847541ebc171ebdb28070afa05e04e6b" + }, + "experiments/periodic_h0/finite_count_loss.py": { + "bytes": 2698, + "sha256": "85fca300f2dcb1af6102a3d82205e80cf5cb7f345b945186f2deb14d6b7f4317" + }, + "experiments/periodic_h0/gaussian_tail.py": { + "bytes": 4688, + "sha256": "07e55a62ed0bb6da6a9395762e2e0c033126f83b46abd48db4c24df710779db8" + }, + "experiments/periodic_h0/mean_adaptive_confidence.py": { + "bytes": 6161, + "sha256": "d83b4d530d00aafab1ebf5aa262869911db94d3b088309df3d878089285922a5" + }, + "experiments/universality/two_parameter_cusp_population/CONTROLLED_FALSIFICATION.md": { + "bytes": 15296, + "sha256": "a23f88801e678dd1af484cac8f5564801d9d410d835b560a280c0ea6dfc8996e" + }, + "experiments/universality/two_parameter_cusp_population/PROOF.md": { + "bytes": 38350, + "sha256": "9e8caa52b6448e23e465e646ca98d6e42e0cd71442ad4118b59145ee849e1326" + }, + "experiments/universality/two_parameter_cusp_population/population_certificate.py": { + "bytes": 20165, + "sha256": "314cd46ebe3b60055d01f47fe0d34db450b885f8757fe071fd715d4ccfd2a38e" + }, + "experiments/universality/two_parameter_cusp_population/run_population_certificate.py": { + "bytes": 23196, + "sha256": "3799f53e2066ae3f47a6b65ca93a130f2531ee78df1e0f4a094077cd8eabfb4e" + }, + "experiments/universality/two_parameter_cusp_population/test_population_certificate.py": { + "bytes": 15086, + "sha256": "3e1da0372f4cb3e6778a28f681096c2bc47bd64ef8317bbb286fee51184679e1" + } + }, + "sources_before": { + "experiments/periodic_h0/finite_certificate.py": { + "bytes": 14843, + "sha256": "0674a2621dff6c040cbb24cc0b6e6df7847541ebc171ebdb28070afa05e04e6b" + }, + "experiments/periodic_h0/finite_count_loss.py": { + "bytes": 2698, + "sha256": "85fca300f2dcb1af6102a3d82205e80cf5cb7f345b945186f2deb14d6b7f4317" + }, + "experiments/periodic_h0/gaussian_tail.py": { + "bytes": 4688, + "sha256": "07e55a62ed0bb6da6a9395762e2e0c033126f83b46abd48db4c24df710779db8" + }, + "experiments/periodic_h0/mean_adaptive_confidence.py": { + "bytes": 6161, + "sha256": "d83b4d530d00aafab1ebf5aa262869911db94d3b088309df3d878089285922a5" + }, + "experiments/universality/two_parameter_cusp_population/CONTROLLED_FALSIFICATION.md": { + "bytes": 15296, + "sha256": "a23f88801e678dd1af484cac8f5564801d9d410d835b560a280c0ea6dfc8996e" + }, + "experiments/universality/two_parameter_cusp_population/PROOF.md": { + "bytes": 38350, + "sha256": "9e8caa52b6448e23e465e646ca98d6e42e0cd71442ad4118b59145ee849e1326" + }, + "experiments/universality/two_parameter_cusp_population/population_certificate.py": { + "bytes": 20165, + "sha256": "314cd46ebe3b60055d01f47fe0d34db450b885f8757fe071fd715d4ccfd2a38e" + }, + "experiments/universality/two_parameter_cusp_population/run_population_certificate.py": { + "bytes": 23196, + "sha256": "3799f53e2066ae3f47a6b65ca93a130f2531ee78df1e0f4a094077cd8eabfb4e" + }, + "experiments/universality/two_parameter_cusp_population/test_population_certificate.py": { + "bytes": 15086, + "sha256": "3e1da0372f4cb3e6778a28f681096c2bc47bd64ef8317bbb286fee51184679e1" + } + }, + "start_utc": "2026-10-09T18:20:00.664198+00:00", + "status": "PASS", + "timer_scope": "Acceptance deadline covers source freezing, import, campaign, post-source hashing and serialization preparation of all three artifacts. runtime_seconds is sampled before final RUN encoding; exclusive artifact writes and flush are excluded. Final deadline is checked after RUN encoding." +} diff --git a/experiments/universality/two_parameter_cusp_population/CONTROLLED_FALSIFICATION.md b/experiments/universality/two_parameter_cusp_population/CONTROLLED_FALSIFICATION.md new file mode 100644 index 000000000..e6cf2677e --- /dev/null +++ b/experiments/universality/two_parameter_cusp_population/CONTROLLED_FALSIFICATION.md @@ -0,0 +1,270 @@ +# Predeclared exact cusp-population falsification contract + +Draft prepared outside the repository by OpenAI/Codex +`population_contract_design`, under integration owner `root`. The mathematical +author of the consumed two-control source is `universality_review`; this agent +contributes the finite test contract and has read the source and supplied route. +All are source-exposed members of the same provider/team. Organizational +independence credit is zero. This is a deterministic interval experiment with +no RNG, seed, numerical field draw, blind review or new theorem admission. + +## Source and object frozen before execution + +Consume the actual 782-line +`experiments/universality/two_parameter_cusp_population/PROOF.md`, SHA256 +`9e8caa52b6448e23e465e646ca98d6e42e0cd71442ad4118b59145ee849e1326`. +The contract designer freshly reproduced this identity and read actual lines +1-260, 261-520 and 521-782. Historical tests and reviews earn no execution +credit in this run. Record this contract's hash and all consumed Python source +hashes in the run before evaluating the population. If these frozen inputs +change during execution, retain the attempt as `INCONCLUSIVE_SOURCE_DRIFT`. + +Freeze these existing interval-source hashes as well: + +| Repository source | SHA256 | +| --- | --- | +| `experiments/periodic_h0/finite_certificate.py` | `0674a2621dff6c040cbb24cc0b6e6df7847541ebc171ebdb28070afa05e04e6b` | +| `experiments/periodic_h0/gaussian_tail.py` | `07e55a62ed0bb6da6a9395762e2e0c033126f83b46abd48db4c24df710779db8` | +| `experiments/periodic_h0/mean_adaptive_confidence.py` | `d83b4d530d00aafab1ebf5aa262869911db94d3b088309df3d878089285922a5` | +| `experiments/periodic_h0/finite_count_loss.py` (imported dependency) | `85fca300f2dcb1af6102a3d82205e80cf5cb7f345b945186f2deb14d6b7f4317` | + +Before the full run, freeze a manifest of the four new source files below, +this proof and these four interval dependencies. Record the actual hashes in +`RUN.json` and check them again at the end. The contract hash lives in the +manifest, avoiding a self-referential hash in this document. No claim is made +that the not-yet-written implementation already has a frozen identity. + +Fix spatial dimension `d=2`, period `L=1`, `w_i=3^-i`, unnormalized field +height, the superlevel H0 elder rule, and exclusion of the essential class. +Haar translation is part of the analytic field law and is integrated out; it +is not simulated. Fix `A=2^-16`, `u0=3*A^2`, `v0=2*A^3`, and full symmetric +rectangle density `c0=1/(24*A^5)`. Set counts to zero on the null discriminant +and tie controls, as the consumed proof does. Full-rectangle probabilities +must retain their mass; do not condition on the existence of a finite bar. + +For the positive-control chart put `a=A*z`, `h=a*theta`, `c=-a`. Its three +roots are `c-h`, `c+h`, `-2*c`; `u=3*a^2+h^2`, +`v=2*a*(a^2-h^2)`. Freeze `z>0`, `0 0` and selected gap +`P(-a-h)-P(-a+h)=4*a*h^3`. Reflection must exchange the younger side and +preserve the gap. This finite critical-height selector consumes the source's +global-selection proof; it is not an independent whole-field H0 algorithm. + +## Quantities and two separately derived interval routes + +Define `m(tau)=P(0=9/4`. This saturation also checks +the sign multiplicity, rectangle normalization and support convention. + +Use only `fractions.Fraction` for mathematical values and interval endpoints. +Reuse the existing `finite_certificate.sqrt_bounds`, +`gaussian_tail.exp_neg_bounds`, and `mean_adaptive_confidence.log_bounds` +with their actual source identities. Any required cube-root enclosure uses +rational bisection of a monotone cubic. Nested outward square-root enclosures +supply quarter powers; do not use float powers, fitted slopes or numerical +quadrature to certify an endpoint. `pi_bounds` is available for separately +scoped physical-coordinate work, but this contract does not evaluate physical +positions or claim that it used that function. +The two routes have separate analytic derivations but may share the root +bracket and outward elementary primitives. Their agreement earns no blindness, +organizational independence or independence of the shared interval engine. + +## Fixed schedule and numerical budgets + +Freeze eight rows, `j=1,...,8`, with `tau_j=2^(-3*j)` and `n_j=4^j`. +Then `n_j*tau_j^(2/3)=1` exactly. For each row report rational intervals for +both routes' `m(tau_j)`, both normalized masses `n_j*m(tau_j)`, their +intersection, and the exact iid void probability +`V_j=(1-m(tau_j))^n_j`. The iid-copy law is an analytic premise; no iid +samples are produced. Enclose `V_j` using outward log/exponential arithmetic, +or exact rational exponentiation if it stays within the same fixed budget. + +Bracket the split root in a dyadic interval of width at most `2^-96` by +96-step rational bisection of `g(r)=36*r^3/(3+r^2)^2`. Use outward elementary +operations with at least 128 bits and enforce total arithmetic inflation +at most `2^-22` for each normalized direct integral. For these rows the +split has `rhi<1/2`. A failed bracket, positivity or arithmetic-width gate +is inconclusive; no uncertified endpoint enters an acceptance predicate. +The `2^-22` arithmetic gate is an actual accumulated exact rational bound: +sum the positive quadrature weights times point/coefficient interval widths +for both the lower and upper quadrature contributions, including root-power +and coefficient uncertainty. Record that sum separately from discretization +and root-sliver widths and replay-check it. A precision setting alone is not +evidence for this gate. A sufficient auxiliary check is `rhi>2^-9`, giving +combined lower/upper quadrature weights at most `2/rhi<1024`; intervals of +full width at most `2^-40` at every weighted evaluation then contribute less +than `2^-30`. Actual accumulated arithmetic width remains the acceptance gate. + +Direct core: put `theta=rlo*x` on `x in [0,1]`; use exactly `2^16` +Darboux panels. The normalized integrand is increasing, with range at most +`3/10`, since `n_j*rlo^2<=1/2`. Its enclosure width is at most +`3/(10*2^16)`. Record the monotonicity and range gates. + +Direct tail: put `theta=rhi*t`. On each octave +`[2^k,min(2^(k+1),1/rhi)]`, use exactly 512 panels with midpoint lower and +trapezoid upper sums. Its normalized integrand is +`C*(9*t^(-11/4)-rhi^2*t^(-3/4))`, where +`C=n_j*tau_j^(5/4)/(15*4^(5/4))*rhi^(-7/4)<=1/30`. +It is convex; `f''<=99/32*t^(-19/4)`. The summed discretization width is +at most `297/(512*512^2)`. Enclose the intervening root sliver by +`[0,(3/5)*n_j*(rhi-rlo)]`. Total direct normalized width must be +strictly less than `2^-17`. + +Declare at most 80,000 direct integrand evaluations per row, with midpoint +and endpoint enclosure computations counted explicitly. Compute each unique +node once and reuse its enclosure in adjacent panels: a cached use is not +another evaluation, while any actual repeated computation counts again. +At row 8 the plan uses at most `65,537+9*(513+512)=74,762` evaluations. +This function-evaluation count is separate from arithmetic inflation, which +counts both weighted lower/upper uses of every enclosure. The closed-CDF +normalized enclosure must have width at most `2^-16`. The direct/CDF +intervals must overlap. The reported void enclosure and target Poisson +enclosure must each have full width at most `2^-16`. + +No adaptive extra rows, changed thresholds, increased panels, increased +root iterations or relaxed acceptance threshold belong to this run. Any +exhausted evaluation/precision budget is `INCONCLUSIVE_BUDGET`, preserving +partial intervals and counts. A successor contract may predeclare a changed +budget and link this result; it must not relabel the failed attempt as PASS. +The full eight-row runner has a 900-second wall-clock budget, enforced with +a monotonic timer. Runtime exhaustion is `INCONCLUSIVE_BUDGET`; record the +completed work and elapsed time without calling that attempt a full run. + +## Predictions and predeclared falsification predicates + +Let `B=9/(28*cuberoot(2))`, enclosed by rational bisection, and +`E(tau)=(9/8)*tau^(2/3)+tau^(7/12)`. All eight rows test the prediction +`abs(m(tau)/tau^(2/3)-B)<=E(tau)`. Record the complete predicted interval, +the observed certified interval and their distance; no regression estimates +replace this declared coefficient and error envelope. +For certified intervals `B in [Blo,Bhi]`, `E in [Elo,Ehi]` and normalized +mass `Lambda in [Llo,Lhi]`, PASS requires containment in the common inner +envelope: `Llo>=Bhi-Elo` and `Lhi<=Blo+Elo`. A certified falsifier requires +disjointness from the outer envelope `[Blo-Ehi,Bhi+Ehi]`. Neither containment +in that outer interval nor interval overlap alone proves the prediction. + +At `j=8`, `E(tau_8)<=41/524288`. Verify the mass gate +`n_8*m(tau_8)<1/3`. It gives +`abs((1-m)^n_8-exp(-n_8*m))<1/(16*n_8)=1/1048576`. +Let the target be `exp(-B)`. The declared endpoint error allowance is + +``` +41/524288 + 1/1048576 + 2*(2^-16) + = 115/1048576 < 2^-13. +``` + +The row-8 acceptance predicate is the explicit rational endpoint test +`max(abs(Vlo-target_hi),abs(Vhi-target_lo))<2^-13`. +Interval overlap alone is not enough. If certified intervals have minimum +distance greater than `2^-13`, the declared finite void prediction is +`FALSIFIED`. If intervals straddle that boundary or fail their width gate, +the result is `INCONCLUSIVE_PRECISION`. + +If a row's certified normalized-mass interval is disjoint from the outer +prediction envelope, label that coefficient prediction `FALSIFIED` +after source, soundness and negative-control gates pass. Freeze new-lemma +work on the affected assertion and retain the counterinterval. If the +observed interval is neither disjoint from the outer envelope nor contained +in the common inner envelope, report `INCONCLUSIVE_PRECISION`. The explicit +inner endpoint inequalities yield that row's PASS. + +Disjoint CDF and direct intervals are `FAIL_ROUTE_CONSISTENCY`, not a PASS +for either route. Invalid input, a failed arithmetic guarantee or an +undetected negative control is `FAIL_IMPLEMENTATION`. Such results provide +no certified scientific counterexample until their soundness issue is +resolved. A PASS means this fixed non-Gaussian population survived these +eight declared coefficient tests and the one declared void test. It does +not test general Gaussian one-third universality, all A3 populations, Hk, +same-field spatial Poisson statistics or scientific acceptance. + +## Required negative controls and independent scope statuses + +Freeze exact controls `a=A/4` with `theta=1/4,1/2,3/4` and their reflected +signs. They check root stationarity, order, Hessian signs, actual elder +selection and the displayed gap. Boundary controls `theta=0,1,3` must be +classified as discriminant or tie and excluded under the declared convention. +The adversarial control `a=A/4,theta=2` has ordered roots `(-3*a,a,2*a)` +and negative `v`. All these fixtures lie inside the frozen control rectangle. +The actual younger-right lifetime divided by `a^4` is `3/4`; the fixed-left +formula divided by `a^4` falsely gives `32`. The critical-height selector +must reject that wrong formula. These fixtures still earn no independent +whole-field H0 selector execution credit. +Also detect a missing factor two by comparing its total mass `1/10` with +the exact `1/5`, and reject bar-conditioned mass `1` as a rectangle mass. +Reject non-Fraction mathematical inputs and reversed/nonenclosing intervals. + +Check rational analytic guard witnesses separately: `R=1/8`, `r1=1/32`, +`a*=r1/4`, `delta=r1^4/64`, `B0<=r1^2/2`, `D0<=r1`, +`B1<=33*r1`, `D1<=65`, `g*>=r1^3/64`. Use the proposed C-infinity +cutoff defined by `q(t)=exp(-1/t)` for `t>0` and zero otherwise, +`psi(t)=q(1-t)/(q(t)+q(1-t))`, flat beyond 0 and 1, with +`abs(psi')<=8`; the radial cutoff gives `abs(grad chi)<=64/r1`. +The monotone surgery uses +`c(r)=r/4+(1-r/4)*(1-psi((r-r1^2)/(R^2/2-r1^2)))`. +These analytic premises require substantive review; exact arithmetic only +checks their consequent rational inequalities. In particular + +``` +B1*u0+D1*v0 <= 101441/2^47 < 2^-22 <= g*/2, +B0*u0+D0*v0 <= 1537/2^52 < 2^-28 = delta/4. +``` + +Also check `R^2= 0, 'Nonnegative Fraction required') + require(not positive or value > 0, 'Positive Fraction required') + return value + + +def interval(value, nonnegative=False, unit=False): + require(type(value) in (tuple, list) and len(value) == 2, + 'Two ordered Fraction endpoints required') + lo, hi = (rational(x) for x in value) + require(lo <= hi, 'Reversed interval') + require(not nonnegative or lo >= 0, 'Nonnegative interval required') + require(not unit or 0 <= lo <= hi <= 1, 'Probability interval required') + return lo, hi + + +def _add(a, b): + return a[0] + b[0], a[1] + b[1] + + +def _subtract(a, b): + return a[0] - b[1], a[1] - b[0] + + +def _scale(a, weight): + require(weight >= 0, 'Positive interval weight required') + return a[0] * weight, a[1] * weight + + +def _multiply(a, b): + require(a[0] >= 0 and b[0] >= 0, 'Nonnegative multiplication required') + return a[0] * b[0], a[1] * b[1] + + +def _reciprocal(a): + require(a[0] > 0, 'Strictly positive reciprocal required') + return 1 / a[1], 1 / a[0] + + +def _sqrt(a): + require(a[0] >= 0, 'Nonnegative square root required') + return sqrt_bounds(a[0], BITS)[0], sqrt_bounds(a[1], BITS)[1] + + +def _outward(a): + lo, hi = a + lower, upper = lo * SCALE, hi * SCALE + return (Q(lower.numerator // lower.denominator, SCALE), + Q(-((-upper.numerator) // upper.denominator), SCALE)) + + +def quarter_power_bounds(value): + rational(value, nonnegative=True) + return _sqrt(_sqrt((value, value))) + + +def cube_root_bounds(value): + rational(value, nonnegative=True) + if value == 0: + return Q(0), Q(0) + # Fixed 128 bisections on a enclosing dyadic initial bracket. + lo, hi = Q(0), Q(1) + while hi ** 3 < value: + hi *= 2 + if hi ** 3 == value: + return hi, hi + for _ in range(BITS): + mid = (lo + hi) / 2 + if mid ** 3 == value: + return mid, mid + if mid ** 3 < value: + lo = mid + else: + hi = mid + return lo, hi + + +def _polynomial(s, u, v): + return -s ** 4 / 4 + u * s ** 2 / 2 + v * s + + +def critical_fixture(a, h, sign=1): + rational(a, positive=True) + rational(h, nonnegative=True) + require(type(sign) is int and sign in (-1, 1), 'Reflection sign must be +/-1') + u, v = 3 * a ** 2 + h ** 2, sign * 2 * a * (a ** 2 - h ** 2) + roots = tuple(sorted(sign * s for s in (-a - h, -a + h, 2 * a))) + heights = tuple(_polynomial(s, u, v) for s in roots) + curvatures = tuple(u - 3 * s ** 2 for s in roots) + discriminant = 4 * u ** 3 - 27 * v ** 2 + stationary = all(-s ** 3 + u * s + v == 0 for s in roots) + require(stationary, 'Root-control witness is not stationary') + status, count, lifetime, side = 'FINITE_BAR', 1, Q(0), None + if discriminant == 0: + status, count = 'EXCLUDED_DISCRIMINANT', 0 + elif heights[0] == heights[2]: + status, count = 'EXCLUDED_TIE', 0 + else: + require(discriminant > 0 and curvatures[0] < 0 < curvatures[1] + and curvatures[2] < 0, 'Invalid three-critical-point witness') + index = 0 if heights[0] < heights[2] else 2 + side = 'left' if index == 0 else 'right' + lifetime = heights[index] - heights[1] + require(lifetime > 0, 'Younger maximum must exceed saddle height') + return {'a': a, 'h': h, 'sign': sign, 'u': u, 'v': v, + 'roots': roots, 'critical_heights': heights, 'curvatures': curvatures, + 'hessian_signs': tuple((x > 0) - (x < 0) for x in curvatures), + 'discriminant': discriminant, 'stationary': stationary, + 'rectangle': -U0 < u < U0 and -V0 < v < V0, + 'status': status, 'count': count, 'younger_side': side, + 'lifetime': lifetime} + + +def guard_witnesses(): + r, r1 = Q(1, 8), Q(1, 32) + a_star, delta, g_star = r1 / 4, r1 ** 4 / 64, r1 ** 3 / 64 + b0, d0, b1, d1 = r1 ** 2 / 2, r1, 33 * r1, Q(65) + gradient, height = b1 * U0 + d1 * V0, b0 * U0 + d0 * V0 + gates = {'chart': r ** 2 < Q(1, 9), + 'root_u': U0 < a_star ** 2 / 4, + 'root_v': V0 < a_star ** 3 / 4, + 'wedge_coverage': 27 * V0 ** 2 >= 4 * U0 ** 3, + 'gradient': gradient == Q(101441, 1 << 47) + and gradient < Q(1, 1 << 22) <= g_star / 2, + 'height': height == Q(1537, 1 << 52) + and height < Q(1, 1 << 28) == delta / 4} + return {'status': 'PASS_RATIONAL_GUARDS' if all(gates.values()) else 'FAIL_IMPLEMENTATION', + 'R': r, 'r1': r1, 'a_star': a_star, 'delta': delta, + 'g_star_lower': g_star, 'B0_upper': b0, 'D0_upper': d0, + 'B1_upper': b1, 'D1_upper': d1, 'u0': U0, 'v0': V0, + 'gradient_perturbation': gradient, 'height_perturbation': height, + 'gates': gates, 'analytic_cutoff_derivative_premise': 'REVIEW_REQUIRED', + 'complete_surgery_field': 'NOT_RUN', 'independent_global_selector': 'NOT_RUN'} + + +def coefficient_envelopes(b, e): + b, e = interval(b), interval(e, nonnegative=True) + return {'inner': (b[1] - e[0], b[0] + e[0]), + 'outer': (b[0] - e[1], b[1] + e[1])} + + +def interval_distance(a, b): + a, b = interval(a), interval(b) + return max(Q(0), a[0] - b[1], b[0] - a[1]) + + +def classify_coefficient(observed, b, e): + observed = interval(observed) + envelopes = coefficient_envelopes(b, e) + inner, outer = envelopes['inner'], envelopes['outer'] + if observed[1] < outer[0] or observed[0] > outer[1]: + return 'FALSIFIED' + if observed[0] >= inner[0] and observed[1] <= inner[1]: + return 'PASS' + return 'INCONCLUSIVE_PRECISION' + + +def classify_void(observed, target): + observed, target = interval(observed, unit=True), interval(target, unit=True) + if observed[1] - observed[0] > WIDTH_LIMIT or target[1] - target[0] > WIDTH_LIMIT: + return 'INCONCLUSIVE_PRECISION' + if max(abs(observed[0] - target[1]), abs(observed[1] - target[0])) < Q(1, 8192): + return 'PASS' + if interval_distance(observed, target) > Q(1, 8192): + return 'FALSIFIED' + return 'INCONCLUSIVE_PRECISION' + + +def rectangle_mass_control(observed): + observed = interval(observed, unit=True) + return observed[0] <= Q(1, 5) <= observed[1] + + +def root_bracket(tau): + rational(tau, positive=True) + require(tau < Q(9, 4), 'Split root requires tau below support endpoint') + lo, hi = Q(0), Q(1) + for _ in range(96): + mid = (lo + hi) / 2 + # Cross multiplication retains exact sign, including an exact dyadic root. + if 36 * mid ** 3 <= tau * (3 + mid ** 2) ** 2: + lo = mid + else: + hi = mid + require(hi - lo <= Q(1, 1 << 96), 'Split bracket width failed') + require(36 * lo ** 3 <= tau * (3 + lo ** 2) ** 2 + and 36 * hi ** 3 >= tau * (3 + hi ** 2) ** 2, + 'Split root is not enclosed') + return lo, hi + + +def cdf_mass(tau): + rational(tau, nonnegative=True) + if tau == 0: + return Q(0), Q(0) + # At the support endpoint the declared split identity has exact root s=1. + # Evaluate the same CDF primitive and normalization as the interior route; + # a literal mass here would hide a missing-sign/normalization fault. + tau = min(tau, Q(9, 4)) + s = root_bracket(tau) if tau < Q(9, 4) else (Q(1), Q(1)) + require(s[0] > 0, 'Split root positivity failed') + square = s[0] ** 2, s[1] ** 2 + base = _add((Q(1), Q(1)), _scale(square, Q(1, 3))) + denominator = _multiply(base, _sqrt(base)) + first = _subtract((Q(3), Q(3)), _scale( + _multiply(_subtract((Q(1), Q(1)), square), _reciprocal(denominator)), Q(3))) + quarter = _sqrt(_sqrt(s)) + inverse_seventh = _reciprocal((quarter[0] ** 7, quarter[1] ** 7)) + second = _subtract(_scale(_subtract(inverse_seventh, (Q(1), Q(1))), Q(36, 7)), + _scale(_subtract((Q(1), Q(1)), quarter), Q(4))) + coefficient = _scale(quarter_power_bounds(tau / 4), tau / 4) + result = _scale(_add(first, _multiply(coefficient, second)), Q(1, 15)) + # At s=1 both uncertain terms vanish exactly. Keep that exact Fraction + # result; outward dyadic rounding is needed only for the interior route. + if tau < Q(9, 4): + result = _outward(result) + require(0 <= result[0] <= result[1] <= Q(1, 5), 'CDF probability enclosure failed') + return result + + +def coefficient_interval(): + return _scale(_reciprocal(cube_root_bounds(Q(2))), Q(9, 28)) + + +def _schedule(j): + require(type(j) is int and 1 <= j <= 8, 'Declared schedule requires integer j in [1,8]') + return Q(1, 1 << (3 * j)), 4 ** j + + +def error_interval(j): + _, n = _schedule(j) + return _add((Q(9, 8 * n), Q(9, 8 * n)), + quarter_power_bounds(Q(1, 1 << (7 * j)))) + + +def void_interval(mass, n): + mass = interval(mass, unit=True) + require(type(n) is int and n > 0, 'Positive strict integer copy count required') + # Monotone log/exp avoids multi-million-bit exact rational powers. + def endpoint(m): + if m == 0: + return Q(1), Q(1) + if m == 1: + return Q(0), Q(0) + lo, hi = log_bounds(1 - m, bits=BITS) + # Round the exponent outward before feeding the shared series evaluator; + # this bounds denominator size and includes the rounding in final width. + xlo, xhi = _outward((-n * hi, -n * lo)) + require(0 <= xlo <= xhi <= 4096, 'Void exponential domain exhausted') + return exp_neg_bounds(xhi)[0], exp_neg_bounds(xlo)[1] + return endpoint(mass[1])[0], endpoint(mass[0])[1] + + +def poisson_target(b=None): + b = interval(coefficient_interval() if b is None else b, nonnegative=True) + require(b[1] <= 4096, 'Poisson exponential domain exhausted') + return exp_neg_bounds(b[1])[0], exp_neg_bounds(b[0])[1] + + +class _BudgetExhausted(Exception): + pass + + +def direct_mass(j, max_evaluations=MAX_EVALUATIONS, deadline=None): + """Independent control-measure quadrature with fixed panels and exact widths. + + Cached unique nodes count once. Positive lower and upper uses both count + toward arithmetic inflation. No partial quadrature is a mass enclosure. + """ + tau, n = _schedule(j) + require(type(max_evaluations) is int and 0 <= max_evaluations <= MAX_EVALUATIONS, + 'Evaluation control may only reduce the frozen 80000 budget') + require(deadline is None or type(deadline) in (int, float), 'Monotonic deadline required') + root = root_bracket(tau) + rlo, rhi = root + gates = {'root_width': rhi - rlo <= Q(1, 1 << 96), + 'root_positive': rlo > 0, 'root_upper': rhi < Q(1, 2), + 'root_auxiliary_lower': rhi > Q(1, 1 << 9), + 'core_scale': n * rlo ** 2 <= Q(1, 2), + # Derivative numerator on theta^2 in [0,rlo^2]. + 'core_monotonicity': 27 - 45 * rlo ** 2 + 2 * rlo ** 4 > 0, + 'core_range': Q(3, 5) * n * rlo ** 2 <= Q(3, 10)} + result = {'j': j, 'tau': tau, 'n': n, 'root_bracket': root, + 'status': 'INCONCLUSIVE_BUDGET', 'evaluations': 0, + 'interval': None, 'normalized_interval': None, + 'arithmetic_width': Q(0), 'discretization_width': None, + 'sliver_width': Q(3, 5) * n * (rhi - rlo), 'gates': gates, + 'partial': {'core_nodes': 0, 'tail_nodes': 0, 'completed_octaves': 0}} + if not all(gates.values()): + result['status'] = 'INCONCLUSIVE_PRECISION' + return result + if max_evaluations == 0 or (deadline is not None and time.monotonic() >= deadline): + return result + tau_power = _scale(quarter_power_bounds(tau), tau) + four_power = _scale(quarter_power_bounds(Q(4)), Q(4)) + rquarter = quarter_power_bounds(rhi) + rinverse = _reciprocal((rquarter[0] ** 7, rquarter[1] ** 7)) + coefficient = _outward(_scale(_multiply(_multiply(tau_power, _reciprocal(four_power)), + rinverse), Q(n, 15))) + gates['tail_coefficient'] = coefficient[1] <= Q(1, 30) + # f'' = C*(1485/16*t^-19/4 - 21/16*rhi^2*t^-11/4). + gates['tail_convexity'] = 1485 - 21 > 0 + gates['tail_second_derivative'] = coefficient[1] * Q(1485, 16) <= Q(99, 32) + if not all(gates.values()): + result['status'] = 'INCONCLUSIVE_PRECISION' + return result + caches = {'core': {}, 'tail': {}} + + def evaluate(route, node): + cache = caches[route] + if node in cache: + return cache[node] + if result['evaluations'] >= max_evaluations or ( + deadline is not None and time.monotonic() >= deadline): + raise _BudgetExhausted + if route == 'core': + theta2 = (rlo * node) ** 2 + base = Q(3) / (3 + theta2) + value = _scale(sqrt_bounds(base, BITS), + Q(n, 15) * rlo ** 2 * node * (9 - theta2) * base ** 2) + else: + quarter = quarter_power_bounds(node) + inverse = _reciprocal((quarter[0] ** 11, quarter[1] ** 11)) + value = _scale(_multiply(coefficient, inverse), 9 - (rhi * node) ** 2) + value = _outward(value) + require(0 <= value[0] <= value[1], 'Direct point enclosure positivity failed') + cache[node] = tuple(int(x * SCALE) for x in value) + result['evaluations'] += 1 + result['partial'][route + '_nodes'] += 1 + return cache[node] + + core_low = core_upper_floor = core_upper_ceiling = 0 + core_lower_width = core_upper_width = 0 + tail_low = tail_upper_floor = tail_upper_ceiling = Q(0) + tail_lower_width = tail_upper_width = Q(0) + try: + # Darboux lower and upper use all 65537 nodes, cached once each. + for index in range(CORE_PANELS + 1): + lo, hi = evaluate('core', Q(index, CORE_PANELS)) + if index < CORE_PANELS: + core_low += lo + core_lower_width += hi - lo + if index > 0: + core_upper_floor += lo + core_upper_ceiling += hi + core_upper_width += hi - lo + left, finish = Q(1), 1 / rhi + while left < finish: + right = min(2 * left, finish) + step = (right - left) / TAIL_PANELS + midpoint_lower = midpoint_width = 0 + endpoint_floor = endpoint_ceiling = endpoint_width = 0 + for index in range(TAIL_PANELS + 1): + lo, hi = evaluate('tail', left + step * index) + weight = 1 if index in (0, TAIL_PANELS) else 2 + endpoint_floor += weight * lo + endpoint_ceiling += weight * hi + endpoint_width += weight * (hi - lo) + if index < TAIL_PANELS: + lo, hi = evaluate('tail', left + step * Q(2 * index + 1, 2)) + midpoint_lower += lo + midpoint_width += hi - lo + tail_low += step * Q(midpoint_lower, SCALE) + tail_upper_floor += step * Q(endpoint_floor, 2 * SCALE) + tail_upper_ceiling += step * Q(endpoint_ceiling, 2 * SCALE) + tail_lower_width += step * Q(midpoint_width, SCALE) + tail_upper_width += step * Q(endpoint_width, 2 * SCALE) + result['partial']['completed_octaves'] += 1 + left = right + except _BudgetExhausted: + result['partial']['core_lower_sum'] = Q(core_low, CORE_PANELS * SCALE) + result['partial']['tail_lower_sum_completed_octaves'] = tail_low + result['arithmetic_width'] = (Q(core_lower_width + core_upper_width, + CORE_PANELS * SCALE) + + tail_lower_width + tail_upper_width) + return result + core_lower = Q(core_low, CORE_PANELS * SCALE) + core_upper = Q(core_upper_ceiling, CORE_PANELS * SCALE) + core_floor_upper = Q(core_upper_floor, CORE_PANELS * SCALE) + arithmetic = Q(core_lower_width + core_upper_width, CORE_PANELS * SCALE) + arithmetic += tail_lower_width + tail_upper_width + core_discretization = core_floor_upper - core_lower + tail_discretization = tail_upper_floor - tail_low + sliver = result['sliver_width'] + normalized = core_lower + tail_low, core_upper + tail_upper_ceiling + sliver + gates.update({'point_widths': all(Q(hi - lo, SCALE) <= Q(1, 1 << 40) + for cache in caches.values() for lo, hi in cache.values()), + 'core_discretization': Q(0) <= core_discretization <= Q(3, 10 * CORE_PANELS), + 'tail_discretization': Q(0) <= tail_discretization <= Q(297, 512 * 512 ** 2), + 'arithmetic_width': arithmetic <= Q(1, 1 << 22), + 'normalized_width': normalized[1] - normalized[0] < Q(1, 1 << 17), + 'evaluation_budget': result['evaluations'] <= max_evaluations, + 'runtime_budget': deadline is None or time.monotonic() < deadline}) + result.update({'status': 'CERTIFIED' if all(gates.values()) else 'INCONCLUSIVE_PRECISION', + 'interval': _scale(normalized, Q(1, n)), 'normalized_interval': normalized, + 'arithmetic_width': arithmetic, + 'discretization_width': core_discretization + tail_discretization, + 'arithmetic_components': { + 'core_lower': Q(core_lower_width, CORE_PANELS * SCALE), + 'core_upper': Q(core_upper_width, CORE_PANELS * SCALE), + 'tail_lower': tail_lower_width, 'tail_upper': tail_upper_width}, + 'discretization_components': {'core': core_discretization, + 'tail': tail_discretization}, + 'core_interval': (core_lower, core_upper), + 'tail_interval': (tail_low, tail_upper_ceiling), + 'tail_coefficient_interval': coefficient, + 'normalized_width': normalized[1] - normalized[0]}) + require(sum(result['arithmetic_components'].values(), Q(0)) == arithmetic, + 'Arithmetic inflation replay failed') + return result + + +def negative_controls(): + a = A / 4 + controls = [critical_fixture(a, a * theta, sign) + for theta in (Q(1, 4), Q(1, 2), Q(3, 4), Q(0), Q(1), Q(3), Q(2)) + for sign in (1, -1)] + positive = [c for c in controls if c['h'] / a in (Q(1, 4), Q(1, 2), Q(3, 4))] + gaps = all(c['lifetime'] == 4 * a * c['h'] ** 3 for c in positive) + elder_heights = all(c['critical_heights'][2] - c['critical_heights'][0] + == c['sign'] * a ** 4 * (1 - c['h'] / a) * (3 + c['h'] / a) ** 3 / 4 + for c in positive) + adversarial = [c for c in controls if c['h'] == 2 * a] + saturation = cdf_mass(Q(9, 4)) + missing_sign = _scale(saturation, Q(1, 2)) + # The contract's finite-bar mass is 1/5. Conditioning divides the computed + # route mass by that analytic normalizer; the expected mass 1 is an oracle, + # not the value supplied to the control. + conditioned = _scale(saturation, Q(5)) + gates = {'all_stationary_and_inside_rectangle': all(c['stationary'] and c['rectangle'] for c in controls), + 'chart_gaps': gaps, 'outer_height_identity': elder_heights, + 'actual_theta2_gap': all(c['lifetime'] == 3 * a ** 4 / 4 for c in adversarial), + 'reject_fixed_left': all(c['lifetime'] != 32 * a ** 4 for c in adversarial), + 'boundary_exclusion': all(c['count'] == 0 for c in controls if c['h'] / a in (0, 1, 3)), + 'whole_rectangle_mass': rectangle_mass_control(saturation), + 'missing_sign_detected': missing_sign[0] <= Q(1, 10) <= missing_sign[1] + and not rectangle_mass_control(missing_sign), + 'conditioning_detected': conditioned[0] <= Q(1) <= conditioned[1] + and not rectangle_mass_control(conditioned)} + return {'status': 'PASS' if all(gates.values()) else 'FAIL_IMPLEMENTATION', + 'controls': controls, 'gates': gates, 'whole_rectangle_mass': saturation, + 'missing_sign_mass': missing_sign, 'conditioned_mass': conditioned} diff --git a/experiments/universality/two_parameter_cusp_population/run_population_certificate.py b/experiments/universality/two_parameter_cusp_population/run_population_certificate.py new file mode 100644 index 000000000..9c24a56f8 --- /dev/null +++ b/experiments/universality/two_parameter_cusp_population/run_population_certificate.py @@ -0,0 +1,521 @@ +"""Run one frozen exact-population attempt and retain its three artifacts. + +Standard invocation (from repository root): +python3 -B -S experiments/universality/two_parameter_cusp_population/run_population_certificate.py + +Use --performer and --exposure to disclose the actual invocation's executor +and source/reviewer exposure. Omitted disclosures are recorded as UNSPECIFIED. +These are caller reports, not authenticated identity or independence evidence. +""" +import argparse +import builtins +from datetime import datetime, timezone +from fractions import Fraction as Q +import hashlib +import json +from pathlib import Path +import sys +import time +import types + +REPOSITORY = Path(__file__).resolve().parents[3] +POPULATION = Path(__file__).resolve().parent +DEFAULT_OUTPUT = REPOSITORY / 'experiments/universality/results/exact_population_1' +COMMAND = 'python3 -B -S experiments/universality/two_parameter_cusp_population/run_population_certificate.py' +FIXED_HASHES = { + 'experiments/universality/two_parameter_cusp_population/CONTROLLED_FALSIFICATION.md': + 'a23f88801e678dd1af484cac8f5564801d9d410d835b560a280c0ea6dfc8996e', + 'experiments/universality/two_parameter_cusp_population/PROOF.md': + '9e8caa52b6448e23e465e646ca98d6e42e0cd71442ad4118b59145ee849e1326', + 'experiments/periodic_h0/finite_certificate.py': + '0674a2621dff6c040cbb24cc0b6e6df7847541ebc171ebdb28070afa05e04e6b', + 'experiments/periodic_h0/gaussian_tail.py': + '07e55a62ed0bb6da6a9395762e2e0c033126f83b46abd48db4c24df710779db8', + 'experiments/periodic_h0/mean_adaptive_confidence.py': + 'd83b4d530d00aafab1ebf5aa262869911db94d3b088309df3d878089285922a5', + 'experiments/periodic_h0/finite_count_loss.py': + '85fca300f2dcb1af6102a3d82205e80cf5cb7f345b945186f2deb14d6b7f4317'} +SOURCE_PATHS = [REPOSITORY / p for p in FIXED_HASHES] + [ + POPULATION / name for name in ('population_certificate.py', + 'test_population_certificate.py', + 'run_population_certificate.py')] +PROJECT_MODULE_PATHS = { + 'population_certificate': 'experiments/universality/two_parameter_cusp_population/population_certificate.py', + **{name: 'experiments/periodic_h0/' + name + '.py' for name in + ('finite_certificate', 'gaussian_tail', 'mean_adaptive_confidence', 'finite_count_loss')}} +# Direct imports of the inspected five-module closure. Imported standard-library +# internals remain ordinary trusted interpreter behavior, not source attestation. +PROJECT_STDLIB_IMPORTS = frozenset(( + 'argparse', 'datetime', 'fractions', 'functools', 'hashlib', 'json', 'math', + 'pathlib', 're', 'sys', 'time')) + + +def _require(condition, message): + if not condition: + raise ValueError(message) + + +def _capture_sources(paths=SOURCE_PATHS, base=REPOSITORY): + """Return metadata and the exact same raw observations, once per source.""" + base = Path(base) + result, image = {}, {} + for path in paths: + path = Path(path) + raw = path.read_bytes() + key = str(path.relative_to(base)) + _require(key not in result, 'Duplicate frozen source') + result[key] = {'sha256': hashlib.sha256(raw).hexdigest(), 'bytes': len(raw)} + image[key] = raw + return result, image + + +def freeze_sources(paths=SOURCE_PATHS, base=REPOSITORY): + return _capture_sources(paths, base)[0] + + +def _load_population(image, loading): + """Execute the captured project image without installing ambient modules. + + This controls the inspected ordinary import routes, not arbitrary Python + introspection or malicious code. The already loaded coordinator, interpreter + and standard library remain trusted. Only the population's path insertion is + isolated: other process state is not a security sandbox. + """ + modules = {} + private_sys = types.ModuleType('sys') + private_sys.__dict__.update(vars(sys)) + private_sys.path = list(sys.path) + private_sys.modules = {name: module for name, module in sys.modules.items() + if name not in PROJECT_MODULE_PATHS} + ordinary_import = builtins.__import__ + + def captured_import(name, globals=None, locals=None, fromlist=(), level=0): + if level == 0 and name in PROJECT_MODULE_PATHS: + return load(name) + if level == 0 and name == 'sys': + return private_sys + if level == 0 and name in PROJECT_STDLIB_IMPORTS: + return ordinary_import(name, globals, locals, fromlist, level) + raise ImportError('Import outside captured project closure and declared stdlib: ' + name) + + def load(name): + if name in modules: + return modules[name] + path = PROJECT_MODULE_PATHS[name] + module = types.ModuleType(name) + module.__file__ = str(REPOSITORY / path) + module.__package__ = '' + module.__builtins__ = dict(vars(builtins), __import__=captured_import) + modules[name] = module + private_sys.modules[name] = module + # compile(bytes) consumes the retained image directly and never selects a + # .pyc or reopens this project's mutable files to obtain executable code. + exec(compile(image[path], module.__file__, 'exec', dont_inherit=True), module.__dict__) + loading['loaded_modules'].append(name) + return module + + loading['status'] = 'LOADING' + try: + population = load('population_certificate') + except Exception: + loading['status'] = 'FAILED' + raise + loading['status'] = 'COMPLETE' + return population + + +def _retained_source_drift(before, after): + # Error observations cannot qualify acceptance, including a source for which + # the before capture failed. No filesystem read supplies this decision. + return sorted({name for name, metadata in before.items() + if metadata != after.get(name)} + | {name for name, metadata in after.items() if 'error' in metadata}) + + +def source_drift(manifest, base=REPOSITORY): + changed = [] + for name, metadata in manifest.items(): + path = Path(base) / name + try: + raw = path.read_bytes() + same = len(raw) == metadata['bytes'] and hashlib.sha256(raw).hexdigest() == metadata['sha256'] + except OSError: + same = False + if not same: + changed.append(name) + return changed + + +def _json_value(value): + if type(value) is Q: + return str(value) + if type(value) in (str, int, bool) or value is None: + return value + if type(value) in (tuple, list): + return [_json_value(item) for item in value] + if type(value) is dict: + _require(all(type(key) is str for key in value), 'String JSON keys required') + return {key: _json_value(item) for key, item in value.items()} + raise ValueError('Noncanonical certificate value: ' + type(value).__name__) + + +def canonical_bytes(value): + return (json.dumps(_json_value(value), sort_keys=True, indent=2, allow_nan=False) + '\n').encode() + + +def load_json(path): + def pairs(items): + value = {} + for key, item in items: + _require(key not in value, 'Duplicate JSON key') + value[key] = item + return value + def reject(value): + raise ValueError('Float or nonfinite certificate value: ' + value) + return json.loads(Path(path).read_text(), object_pairs_hook=pairs, + parse_float=reject, parse_constant=reject) + + +def _utc(): + return datetime.now(timezone.utc).isoformat(timespec='microseconds') + + +def _overall(statuses): + for status in ('FAIL_IMPLEMENTATION', 'FAIL_ROUTE_CONSISTENCY', + 'INCONCLUSIVE_SOURCE_DRIFT', 'INCONCLUSIVE_BUDGET', + 'INCONCLUSIVE_PRECISION', 'FALSIFIED'): + if status in statuses: + return status + return 'PASS' if statuses and all(x == 'PASS' for x in statuses) else 'INCONCLUSIVE_PRECISION' + + +def _empty_certificate(status, error): + return {'schema_version': 1, 'status': status, 'rows': [], 'error': error, + 'scope_statuses': {'exact_non_gaussian_population': status, + 'rational_guard_consequents': 'NOT_RUN', + 'analytic_cutoff_derivative_premise': 'REVIEW_REQUIRED', + 'complete_surgery_field': 'NOT_RUN', + 'independent_global_h0_selector': 'NOT_RUN', + 'gaussian_universality': 'NOT_RUN', 'blind_50_campaign': 'NOT_RUN', + 'higher_homology': 'NOT_RUN', 'same_field_spatial_poisson': 'NOT_RUN', + 'lean_kernel': 'NOT_RUN', 'scientific_promotion': 'NOT_RUN', + 'organizational_independence_credit': 0}} + + +def apply_final_runtime_budget(certificate, start, time_budget): + """Withdraw acceptance if posthash/serialization preparation exhausts time. + + The payload may retain useful completed calculations, but no earlier accepted + prediction remains accepted once the whole-attempt deadline is exhausted. + """ + if time.monotonic() < start + time_budget: + return False + certificate['computed_status_before_runtime_budget'] = certificate['status'] + certificate['status'] = 'INCONCLUSIVE_BUDGET' + certificate['runtime_budget_exhausted_phase'] = 'final_posthash_and_serialization_preparation' + certificate['scope_statuses']['exact_non_gaussian_population'] = 'INCONCLUSIVE_BUDGET' + for row in certificate['rows']: + row['computed_status_before_runtime_budget'] = row['status'] + row['computed_coefficient_status_before_runtime_budget'] = row['coefficient_status'] + row['status'] = 'INCONCLUSIVE_BUDGET' + row['coefficient_status'] = 'INCONCLUSIVE_BUDGET' + if row.get('finite_void'): + row['finite_void']['computed_status_before_runtime_budget'] = row['finite_void']['status'] + row['finite_void']['status'] = 'INCONCLUSIVE_BUDGET' + return True + + +def apply_source_drift(certificate, drift): + if drift: + certificate['pre_source_drift_disposition'] = certificate['status'] + certificate['status'] = 'INCONCLUSIVE_SOURCE_DRIFT' + certificate['source_drift'] = drift + certificate['scope_statuses']['exact_non_gaussian_population'] = 'INCONCLUSIVE_SOURCE_DRIFT' + for row in certificate['rows']: + row['computed_status_before_source_drift'] = row['status'] + row['computed_coefficient_status_before_source_drift'] = row['coefficient_status'] + row['status'] = 'INCONCLUSIVE_SOURCE_DRIFT' + row['coefficient_status'] = 'NOT_ACCEPTED_SOURCE_DRIFT' + if row.get('finite_void'): + row['finite_void']['computed_status_before_source_drift'] = row['finite_void']['status'] + row['finite_void']['status'] = 'NOT_ACCEPTED_SOURCE_DRIFT' + + +def full_declared_campaign(certificate, max_evaluations, time_budget, drift): + return (not drift and max_evaluations == 80000 and time_budget == 900 and len(certificate['rows']) == 8 + and all(row.get('direct') is not None and row['direct']['status'] == 'CERTIFIED' + for row in certificate['rows'])) + + +def _campaign(pc, max_evaluations, deadline): + controls, guards = pc.negative_controls(), pc.guard_witnesses() + b, target = pc.coefficient_interval(), pc.poisson_target() + sound = controls['status'] == 'PASS' and guards['status'] == 'PASS_RATIONAL_GUARDS' + rows, statuses = [], [] + if not sound: + statuses.append('FAIL_IMPLEMENTATION') + for j in range(1, 9): + tau, n = Q(1, 1 << (3 * j)), 4 ** j + row = {'j': j, 'tau': tau, 'n': n, 'schedule_identity': Q(n, 4 ** j), + 'status': 'INCONCLUSIVE_BUDGET', 'coefficient_status': 'NOT_RUN', + 'direct': None, 'cdf_mass': None, 'cdf_normalized': None, + 'intersection_normalized': None, 'void_interval': None} + if time.monotonic() >= deadline: + row['reason'] = 'Whole-run monotonic deadline exhausted before row' + rows.append(row) + statuses.append(row['status']) + continue + try: + direct = pc.direct_mass(j, max_evaluations=max_evaluations, deadline=deadline) + row['direct'] = direct + if direct['status'] != 'CERTIFIED': + row['status'] = direct['status'] + else: + cdf = pc.cdf_mass(tau) + normalized = tuple(n * x for x in cdf) + observed = (max(direct['normalized_interval'][0], normalized[0]), + min(direct['normalized_interval'][1], normalized[1])) + row.update({'cdf_mass': cdf, 'cdf_normalized': normalized, + 'cdf_width': normalized[1] - normalized[0], + 'cdf_width_gate': normalized[1] - normalized[0] <= pc.WIDTH_LIMIT}) + if not row['cdf_width_gate']: + row['status'] = 'INCONCLUSIVE_PRECISION' + elif observed[0] > observed[1]: + row['status'] = 'FAIL_ROUTE_CONSISTENCY' + elif not sound: + row['status'] = 'FAIL_IMPLEMENTATION' + else: + mass = tuple(x / n for x in observed) + error = pc.error_interval(j) + envelopes = pc.coefficient_envelopes(b, error) + void = pc.void_interval(mass, n) + row.update({'intersection_normalized': observed, + 'intersection_mass': mass, 'coefficient_interval': b, + 'error_interval': error, 'predicted_envelopes': envelopes, + 'outer_envelope_distance': pc.interval_distance(observed, envelopes['outer']), + 'coefficient_status': pc.classify_coefficient(observed, b, error), + 'void_interval': void, 'void_width': void[1] - void[0], + 'void_width_gate': void[1] - void[0] <= pc.WIDTH_LIMIT, + 'target_interval': target, + 'target_width_gate': target[1] - target[0] <= pc.WIDTH_LIMIT}) + row['status'] = row['coefficient_status'] + if not row['void_width_gate'] or not row['target_width_gate']: + row['status'] = 'INCONCLUSIVE_PRECISION' + if j == 8: + gates = {'error_allowance': error[1] <= Q(41, 524288), + 'mass_gate': observed[1] < Q(1, 3), + 'allowance_identity': Q(41, 524288) + Q(1, 1048576) + + 2 * pc.WIDTH_LIMIT == Q(115, 1048576) < Q(1, 8192)} + row['finite_void'] = { + 'gates': gates, 'poissonization_error_upper': Q(1, 1048576), + 'declared_allowance': Q(115, 1048576), + 'endpoint_distance': max(abs(void[0] - target[1]), abs(void[1] - target[0])), + 'minimum_distance': pc.interval_distance(void, target), + 'status': pc.classify_void(void, target) if all(gates.values()) + else 'INCONCLUSIVE_PRECISION'} + row['status'] = _overall([row['status'], row['finite_void']['status']]) + if time.monotonic() >= deadline: + row['status'] = 'INCONCLUSIVE_BUDGET' + row['reason'] = 'Whole-run monotonic deadline exhausted during row' + except ValueError as exc: + row['status'] = 'FAIL_IMPLEMENTATION' + row['error'] = str(exc) + rows.append(row) + statuses.append(row['status']) + return {'schema_version': 1, 'status': _overall(statuses), 'rows': rows, + 'negative_controls': controls, 'rational_guards': guards, + 'coefficient_interval': b, 'poisson_target_interval': target, + 'scope_statuses': { + 'exact_non_gaussian_population': _overall(statuses), + 'rational_guard_consequents': guards['status'], + 'analytic_cutoff_derivative_premise': 'REVIEW_REQUIRED', + 'complete_surgery_field': 'NOT_RUN', 'independent_global_h0_selector': 'NOT_RUN', + 'gaussian_universality': 'NOT_RUN', 'blind_50_campaign': 'NOT_RUN', + 'higher_homology': 'NOT_RUN', 'same_field_spatial_poisson': 'NOT_RUN', + 'lean_kernel': 'NOT_RUN', 'scientific_promotion': 'NOT_RUN', + 'organizational_independence_credit': 0}, + 'arithmetic': {'mathematical_values': 'Fraction', 'outward_bits': pc.BITS, + 'split_root_bisections': 96, 'core_panels': pc.CORE_PANELS, + 'tail_panels_per_octave': pc.TAIL_PANELS, + 'point_rounding': 'outward fixed 128-bit dyadic', + 'void_method': 'shared outward log_bounds and exp_neg_bounds'}, + 'analytic_premises': ['consumed global-selection proof', 'iid-copy law', + 'core monotonicity and tail convexity derivations'], + 'exposure': 'Source-exposed OpenAI/Codex provider/team; no organizational independence'} + + +def render_report(certificate): + lines = ['# Frozen exact cusp-population attempt', '', + 'Disposition: **' + certificate['status'] + '**.', '', + 'This deterministic interval calculation addresses the fixed whole-rectangle', + 'non-Gaussian population, eight coefficient predictions and one row-8 finite', + 'iid-copy void prediction. It has no random seed or numerical field draw.', '', + '| j | tau | Direct normalized interval | CDF normalized interval | Coefficient | Row disposition | Evaluations |', + '|---|---|---|---|---|---|---|'] + if certificate.get('error'): + lines[4:4] = ['Execution error: ' + certificate['error'] + '.', ''] + if certificate.get('runtime_budget_exhausted_phase'): + lines[4:4] = ['Final runtime budget exhausted after source hashing and artifact', + 'serialization preparation. Previously computed disposition: ' + + certificate['computed_status_before_runtime_budget'] + '.', ''] + def display(value): + return 'NOT_RUN' if value is None else '[' + ', '.join(str(x) for x in value) + ']' + for row in certificate['rows']: + direct = row.get('direct') + lines.append('| ' + ' | '.join((str(row['j']), str(row['tau']), + display(direct['normalized_interval'] if direct else None), + display(row.get('cdf_normalized')), row['coefficient_status'], + row['status'], str(direct['evaluations'] if direct else 0))) + ' |') + lines += ['', 'All mathematical endpoints and exact arithmetic, discretization and', + 'root-sliver widths are retained in CERTIFICATE.json. A partial sum is', + 'reported as partial work and never used as a probability enclosure.', ''] + for row in certificate['rows']: + if row.get('reason') or row.get('error'): + lines.append('Row ' + str(row['j']) + ': ' + row.get('reason', row.get('error', '')) + '.') + if row.get('finite_void'): + void = row['finite_void'] + lines += ['Row-8 void interval: ' + display(row['void_interval']) + '.', + 'Target exp(-B): ' + display(row['target_interval']) + '.', + 'Maximum cross-endpoint distance: ' + str(void['endpoint_distance']) + + '; strict threshold 1/8192; disposition ' + void['status'] + '.'] + lines += ['', 'Scope statuses:', ''] + lines += ['- ' + name + ': ' + str(status) for name, status in certificate['scope_statuses'].items()] + lines += ['', 'The rational guards check consequences of analytic cutoff derivative', + 'premises. Construction/evaluation of the complete surgery field and an', + 'independent global H0 selector remain NOT_RUN. Shared outward elementary', + 'primitives and source-exposed same-provider reviews provide zero', + 'organizational independence credit. PASS does not admit a theorem or', + 'promote scientific status. Source drift, failure or budget exhaustion', + 'remains attached to this original attempt.', ''] + return '\n'.join(lines).encode() + + +def _disclosure(value): + _require(type(value) is str and bool(value.strip()), + 'Attribution disclosure must be a nonblank string') + return value + + +def run(output_dir=DEFAULT_OUTPUT, max_evaluations=80000, time_budget=900, *, + performer='UNSPECIFIED', exposure='UNSPECIFIED'): + performer, exposure = _disclosure(performer), _disclosure(exposure) + _require(type(max_evaluations) is int and 0 <= max_evaluations <= 80000, + 'Evaluation budget may only be reduced') + _require(type(time_budget) is int and 0 <= time_budget <= 900, + 'Whole-run budget may only be reduced') + output_dir = Path(output_dir) + # Refuse any existing attempt, including a partial or empty attempt directory. + output_dir.mkdir(parents=True, exist_ok=False) + start_utc, start = _utc(), time.monotonic() + before, pre_drift = {}, [] + loading = { + 'status': 'NOT_LOADED', + 'mode': 'retained_raw_bytes_private_project_import_context', + 'captured_module_sources': {}, 'loaded_modules': [], + 'loaded_coordinator_attested': False, 'interpreter_stdlib_attested': False, + 'trusted_boundary': 'The already loaded runner is the coordinating TCB; ' + 'runner/test/docs disk hashes are custody metadata, not loaded-code self-attestation. ' + 'The interpreter and standard library are trusted; this is not a security sandbox ' + 'or an atomic multi-file filesystem snapshot.'} + try: + before, image = _capture_sources() + loading['captured_module_sources'] = { + name: dict(before[path], path=path) for name, path in PROJECT_MODULE_PATHS.items()} + pre_drift = [name for name, expected in FIXED_HASHES.items() + if before[name]['sha256'] != expected] + if pre_drift: + certificate = _empty_certificate('INCONCLUSIVE_SOURCE_DRIFT', + 'Frozen contract/proof/dependency identity mismatch before evaluation') + else: + pc = _load_population(image, loading) + certificate = _campaign(pc, max_evaluations, start + time_budget) + except (ImportError, OSError) as exc: + certificate = _empty_certificate('SETUP_BLOCKED', type(exc).__name__ + ': ' + str(exc)) + except Exception as exc: + certificate = _empty_certificate('FAIL_IMPLEMENTATION', type(exc).__name__ + ': ' + str(exc)) + after = {} + for path in SOURCE_PATHS: + name = str(path.relative_to(REPOSITORY)) + try: + after.update(freeze_sources([path])) + except OSError as exc: + after[name] = {'error': type(exc).__name__ + ': ' + str(exc)} + drift = sorted(set(pre_drift + _retained_source_drift(before, after))) + apply_source_drift(certificate, drift) + end_utc, elapsed = _utc(), time.monotonic() - start + exit_code = 0 if certificate['status'] == 'PASS' else (1 if certificate['status'].startswith('FAIL') + or certificate['status'] == 'FALSIFIED' else 2) + certificate_bytes = canonical_bytes(certificate) + report_bytes = render_report(certificate) + run_record = {'schema_version': 1, 'start_utc': start_utc, 'end_utc': end_utc, + 'runtime_seconds': format(elapsed, '.6f'), 'command': COMMAND, + 'timer_scope': 'Acceptance deadline covers source freezing, import, campaign, ' + 'post-source hashing and serialization preparation of all three artifacts. ' + 'runtime_seconds is sampled before final RUN encoding; exclusive artifact ' + 'writes and flush are excluded. Final deadline is checked after RUN encoding.', + 'final_runtime_budget_gate': 'PASS', + 'exit_code': exit_code, 'status': certificate['status'], + 'sources_before': before, 'sources_after': after, 'source_drift': drift, + 'project_source_loading': loading, + 'performer': performer, + 'exposure': exposure, + 'organizational_independence_credit': 0, + 'python': sys.version, 'full_declared_campaign': + full_declared_campaign(certificate, max_evaluations, time_budget, drift), + 'invocation_scope': 'declared full attempt' if max_evaluations == 80000 + and time_budget == 900 else 'reduced-budget focused control', + 'parameters': {'d': 2, 'L': Q(1), 'A': Q(1, 1 << 16), + 'u0': Q(3, 1 << 32), 'v0': Q(2, 1 << 48), + 'rectangle_density': Q(1 << 80, 24), + 'whole_rectangle_bar_mass': Q(1, 5), + 'evaluation_budget_per_row': max_evaluations, + 'wall_clock_budget_seconds': time_budget, + 'rows': list(range(1, 9)), 'rng': 'NONE'}, + 'actual_route_evaluations': sum(row['direct']['evaluations'] + for row in certificate['rows'] if row.get('direct')), + 'outputs': {name: {'sha256': hashlib.sha256(raw).hexdigest(), 'bytes': len(raw)} + for name, raw in (('CERTIFICATE.json', certificate_bytes), + ('RESULTS.md', report_bytes))}} + # All three byte payloads must exist before the final acceptance check. This + # catches time spent in final source hashing, reporting and JSON preparation. + run_bytes = canonical_bytes(run_record) + if apply_final_runtime_budget(certificate, start, time_budget): + # An exhausted attempt remains exhausted; do not recheck/loop while + # preparing its retained inconclusive receipt. + certificate_bytes = canonical_bytes(certificate) + report_bytes = render_report(certificate) + run_record.update({'status': certificate['status'], 'exit_code': 2, + 'full_declared_campaign': False, + 'final_runtime_budget_gate': 'INCONCLUSIVE_BUDGET', + 'end_utc': _utc(), + 'runtime_seconds': format(time.monotonic() - start, '.6f'), + 'outputs': {name: {'sha256': hashlib.sha256(raw).hexdigest(), 'bytes': len(raw)} + for name, raw in (('CERTIFICATE.json', certificate_bytes), + ('RESULTS.md', report_bytes))}}) + run_bytes = canonical_bytes(run_record) + for name, raw in (('CERTIFICATE.json', certificate_bytes), ('RESULTS.md', report_bytes), + ('RUN.json', run_bytes)): + with (output_dir / name).open('xb') as output: + output.write(raw) + return run_record + + +def main(argv=None): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--performer', type=_disclosure, default='UNSPECIFIED', + help='Self-reported actual executor/provider/session') + parser.add_argument('--exposure', type=_disclosure, default='UNSPECIFIED', + help='Self-reported source/reviewer exposure; no credit inferred') + arguments = parser.parse_args(argv) + try: + result = run(performer=arguments.performer, exposure=arguments.exposure) + print(result['status'] + '; direct evaluations=' + str(result['actual_route_evaluations']) + + '; runtime_seconds=' + result['runtime_seconds']) + return result['exit_code'] + except FileExistsError as exc: + print('REFUSED_EXISTING_ATTEMPT: ' + str(exc), file=sys.stderr) + return 3 + + +if __name__ == '__main__': + raise SystemExit(main()) diff --git a/experiments/universality/two_parameter_cusp_population/test_population_certificate.py b/experiments/universality/two_parameter_cusp_population/test_population_certificate.py new file mode 100644 index 000000000..a261681a2 --- /dev/null +++ b/experiments/universality/two_parameter_cusp_population/test_population_certificate.py @@ -0,0 +1,1002 @@ +"""Literal fixtures for the controlled exact-population certificate. + +These tests exercise actual selectors, interval routes and filesystem custody. +No full eight-row integration campaign is performed by this test file. +""" +from fractions import Fraction as Q +from pathlib import Path +from contextlib import contextmanager +import hashlib +import importlib.util +import os +import py_compile +import subprocess +import sys +import tempfile +import time +import types +import unittest +from unittest import mock + +import population_certificate as pc +import run_population_certificate as runner + + +class CriticalHeightTests(unittest.TestCase): + # A fixed-left selector would fail the theta=2 fixture. + def test_actual_younger_height_and_reflection(self): + a = Q(1, 1 << 18) + for theta, lifetime in ((Q(1, 4), Q(1, 1 << 76)), + (Q(1, 2), Q(1, 1 << 73)), + (Q(3, 4), Q(27, 1 << 76)), + (Q(2), Q(3, 1 << 74))): + for sign in (1, -1): + with self.subTest(theta=theta, sign=sign): + row = pc.critical_fixture(a, a * theta, sign) + self.assertEqual(row['status'], 'FINITE_BAR') + self.assertEqual(row['count'], 1) + self.assertEqual(row['lifetime'], lifetime) + self.assertTrue(row['stationary']) + self.assertTrue(row['rectangle']) + self.assertEqual(row['hessian_signs'], (-1, 1, -1)) + self.assertEqual(row['younger_side'], + 'left' if (theta < 1) == (sign == 1) else 'right') + attack = pc.critical_fixture(a, 2 * a) + self.assertEqual(attack['roots'], (-3 * a, a, 2 * a)) + self.assertEqual(attack['v'], -6 * a ** 3) + self.assertNotEqual(attack['lifetime'], Q(1, 1 << 67)) + + def test_null_discriminants_and_tie_are_excluded(self): + a = Q(1, 1 << 18) + for theta, status in ((Q(0), 'EXCLUDED_DISCRIMINANT'), + (Q(1), 'EXCLUDED_TIE'), + (Q(3), 'EXCLUDED_DISCRIMINANT')): + for sign in (1, -1): + row = pc.critical_fixture(a, theta * a, sign) + self.assertEqual(row['status'], status) + self.assertEqual(row['count'], 0) + self.assertEqual(row['lifetime'], Q(0)) + + def test_selector_rejects_inexact_and_invalid_inputs(self): + for a, h, sign in ((0.25, Q(1), 1), (True, Q(1), 1), + (Q(1), 0.5, 1), (Q(0), Q(0), 1), + (Q(1), Q(-1), 1), (Q(1), Q(1), True), + (Q(1), Q(1), 0)): + with self.assertRaises(ValueError): + pc.critical_fixture(a, h, sign) + + def test_guard_witnesses_check_rational_consequents(self): + guards = pc.guard_witnesses() + self.assertEqual(guards['status'], 'PASS_RATIONAL_GUARDS') + self.assertEqual(guards['gradient_perturbation'], Q(101441, 1 << 47)) + self.assertEqual(guards['height_perturbation'], Q(1537, 1 << 52)) + self.assertTrue(all(guards['gates'].values())) + self.assertEqual(guards['complete_surgery_field'], 'NOT_RUN') + self.assertEqual(guards['independent_global_selector'], 'NOT_RUN') + + +class PredicateTests(unittest.TestCase): + def test_common_inner_and_outer_coefficient_polarity(self): + b, e = (Q(1, 5), Q(3, 10)), (Q(1, 10), Q(1, 10)) + for observed, want in (((Q(21, 100), Q(29, 100)), 'PASS'), + ((Q(3, 20), Q(1, 5)), 'INCONCLUSIVE_PRECISION'), + ((Q(41, 100), Q(1, 2)), 'FALSIFIED')): + self.assertEqual(pc.classify_coefficient(observed, b, e), want) + + def test_void_endpoint_distance_strict_boundary(self): + target = (Q(1, 2), Q(1, 2)) + self.assertEqual(pc.classify_void(target, target), 'PASS') + self.assertEqual(pc.classify_void((Q(1, 2) + Q(1, 8192),) * 2, target), + 'INCONCLUSIVE_PRECISION') + self.assertEqual(pc.classify_void((Q(1, 2) + Q(1, 4096),) * 2, target), + 'FALSIFIED') + self.assertEqual(pc.classify_void((Q(0), Q(1, 4)), target), + 'INCONCLUSIVE_PRECISION') + + def test_interval_predicates_reject_bad_endpoints(self): + good = (Q(1, 5), Q(1, 5)) + for bad in ((Q(1), Q(0)), (0.2, Q(1)), (True, Q(1)), + (Q(0), 1), (Q(0),), '0/1'): + with self.assertRaises(ValueError): + pc.classify_coefficient(bad, good, good) + with self.assertRaises(ValueError): + pc.classify_void(good, bad) + with self.assertRaises(ValueError): + pc.classify_coefficient(good, good, (Q(-1), Q(0))) + + +class IntervalRouteTests(unittest.TestCase): + def test_cdf_boundaries_keep_whole_rectangle_probability(self): + self.assertEqual(pc.cdf_mass(Q(0)), (Q(0), Q(0))) + self.assertEqual(pc.cdf_mass(Q(9, 4)), (Q(1, 5), Q(1, 5))) + self.assertEqual(pc.cdf_mass(Q(3)), (Q(1, 5), Q(1, 5))) + self.assertFalse(pc.rectangle_mass_control((Q(1, 10), Q(1, 10)))) + self.assertFalse(pc.rectangle_mass_control((Q(1), Q(1)))) + self.assertTrue(pc.rectangle_mass_control((Q(1, 5), Q(1, 5)))) + + def test_split_root_encloses_hand_checked_half(self): + lo, hi = pc.root_bracket(Q(72, 169)) + self.assertLessEqual(lo, Q(1, 2)) + self.assertGreaterEqual(hi, Q(1, 2)) + self.assertLessEqual(hi - lo, Q(1, 1 << 96)) + + def test_power_enclosures_have_correct_polarity(self): + self.assertEqual(pc.cube_root_bounds(Q(8)), (Q(2), Q(2))) + self.assertEqual(pc.quarter_power_bounds(Q(16)), (Q(2), Q(2))) + lo, hi = pc.coefficient_interval() + self.assertGreater(lo, Q(1, 4)) + self.assertLess(hi, Q(13, 50)) + self.assertLessEqual(pc.error_interval(8)[1], Q(41, 524288)) + + def test_budget_zero_preserves_no_execution_credit(self): + row = pc.direct_mass(8, max_evaluations=0) + self.assertEqual(row['status'], 'INCONCLUSIVE_BUDGET') + self.assertEqual(row['evaluations'], 0) + self.assertIsNone(row['normalized_interval']) + + def test_partial_budget_counts_actual_evaluations(self): + row = pc.direct_mass(1, max_evaluations=3) + self.assertEqual(row['status'], 'INCONCLUSIVE_BUDGET') + self.assertEqual(row['evaluations'], 3) + self.assertIsNone(row['interval']) + self.assertEqual(row['partial']['core_nodes'], 3) + + def test_one_complete_direct_row_has_sound_widths_and_cdf_overlap(self): + # Removing either sign, arithmetic-width accounting, or tail integration + # breaks the separate-route overlap or the literal work/width controls. + row = pc.direct_mass(1) + cdf = pc.cdf_mass(Q(1, 8)) + self.assertEqual(row['status'], 'CERTIFIED') + self.assertEqual(row['evaluations'], 67586) + self.assertTrue(all(row['gates'].values())) + self.assertLess(row['normalized_width'], Q(1, 1 << 17)) + self.assertEqual(sum(row['arithmetic_components'].values(), Q(0)), + row['arithmetic_width']) + self.assertLessEqual(row['arithmetic_width'], Q(1, 1 << 22)) + self.assertGreater(row['interval'][0], Q(0)) + self.assertLess(row['interval'][1], Q(1, 5)) + self.assertLessEqual(max(row['interval'][0], cdf[0]), + min(row['interval'][1], cdf[1])) + + def test_void_encloses_literal_four_copy_probability(self): + lo, hi = pc.void_interval((Q(1, 5), Q(1, 5)), 4) + self.assertLessEqual(lo, Q(256, 625)) + self.assertGreaterEqual(hi, Q(256, 625)) + self.assertLess(hi - lo, Q(1, 1 << 16)) + self.assertEqual(pc.void_interval((Q(0), Q(0)), 4), (Q(1), Q(1))) + self.assertEqual(pc.void_interval((Q(1), Q(1)), 4), (Q(0), Q(0))) + + def test_routes_reject_invalid_math_and_schedule_inputs(self): + for bad in (0.5, True, 0, Q(-1)): + with self.assertRaises(ValueError): + pc.cdf_mass(bad) + for bad in (Q(0), Q(9, 4), False): + with self.assertRaises(ValueError): + pc.root_bracket(bad) + for bad in (0, 9, True, Q(1)): + with self.assertRaises(ValueError): + pc.direct_mass(bad, max_evaluations=0) + with self.assertRaises(ValueError): + pc.direct_mass(1, max_evaluations=80001) + with self.assertRaises(ValueError): + pc.void_interval((Q(0), Q(1)), True) + with self.assertRaises(ValueError): + pc.void_interval((Q(-1), Q(0)), 1) + + +class RunnerCustodyTests(unittest.TestCase): + def test_source_drift_withdraws_nested_void_acceptance(self): + # Literal custody payload; no scientific execution is represented here. + certificate = {'status': 'PASS', 'rows': [ + {'status': 'PASS', 'coefficient_status': 'PASS', + 'finite_void': {'status': 'PASS'}}], + 'scope_statuses': {'exact_non_gaussian_population': 'PASS'}} + runner.apply_source_drift(certificate, ['PROOF.md']) + row = certificate['rows'][0] + self.assertEqual(certificate['status'], 'INCONCLUSIVE_SOURCE_DRIFT') + self.assertEqual(row['finite_void']['status'], 'NOT_ACCEPTED_SOURCE_DRIFT') + self.assertEqual(row['finite_void'].get('computed_status_before_source_drift'), 'PASS') + + def test_source_drift_disqualifies_full_campaign_receipt(self): + certificate = {'rows': [{'direct': {'status': 'CERTIFIED'}} for _ in range(8)]} + self.assertTrue(runner.full_declared_campaign(certificate, 80000, 900, [])) + self.assertFalse(runner.full_declared_campaign(certificate, 80000, 900, ['PROOF.md'])) + + def test_final_timer_accounts_for_posthash_and_serialization_preparation(self): + with tempfile.TemporaryDirectory() as temporary: + output = Path(temporary) / 'attempt' + run = runner.run(output_dir=output, max_evaluations=0, time_budget=0) + certificate = runner.load_json(output / 'CERTIFICATE.json') + self.assertEqual(run.get('final_runtime_budget_gate'), 'INCONCLUSIVE_BUDGET') + self.assertEqual(certificate.get('computed_status_before_runtime_budget'), + 'INCONCLUSIVE_BUDGET') + self.assertEqual(certificate['status'], 'INCONCLUSIVE_BUDGET') + self.assertEqual(len(certificate['rows']), 8) + self.assertIn('serialization', run['timer_scope']) + self.assertIn('excluded', run['timer_scope']) + + def test_final_timer_withdraws_literal_accepted_statuses_on_expired_clock(self): + # This is a custody payload fixture, not an executed scientific result. + certificate = {'status': 'PASS', 'rows': [ + {'status': 'PASS', 'coefficient_status': 'PASS', + 'finite_void': {'status': 'PASS'}}], + 'scope_statuses': {'exact_non_gaussian_population': 'PASS'}} + expired = time.monotonic() - 1 + self.assertTrue(runner.apply_final_runtime_budget(certificate, expired, 0)) + self.assertEqual(certificate['computed_status_before_runtime_budget'], 'PASS') + self.assertEqual(certificate['status'], 'INCONCLUSIVE_BUDGET') + row = certificate['rows'][0] + self.assertEqual(row['computed_status_before_runtime_budget'], 'PASS') + self.assertEqual(row['computed_coefficient_status_before_runtime_budget'], 'PASS') + self.assertEqual(row['coefficient_status'], 'INCONCLUSIVE_BUDGET') + self.assertEqual(row['finite_void']['computed_status_before_runtime_budget'], 'PASS') + self.assertEqual(row['finite_void']['status'], 'INCONCLUSIVE_BUDGET') + self.assertEqual(certificate['scope_statuses']['exact_non_gaussian_population'], + 'INCONCLUSIVE_BUDGET') + + def test_preexisting_frozen_source_drift_prevents_population_evaluation(self): + # Use an actual copied nine-file source cut, not a mocked source reader. + with tempfile.TemporaryDirectory() as temporary: + base = Path(temporary) + for source in runner.SOURCE_PATHS: + target = base / source.relative_to(runner.REPOSITORY) + target.parent.mkdir(parents=True, exist_ok=True) + target.write_bytes(source.read_bytes()) + contract = base / 'experiments/universality/two_parameter_cusp_population/CONTROLLED_FALSIFICATION.md' + contract.write_bytes(contract.read_bytes() + b'\n') + copy_path = base / runner.POPULATION.relative_to(runner.REPOSITORY) / 'run_population_certificate.py' + spec = importlib.util.spec_from_file_location('copied_runner_control', copy_path) + copied = importlib.util.module_from_spec(spec) + spec.loader.exec_module(copied) + copied.run(output_dir=base / 'attempt', max_evaluations=0) + certificate = copied.load_json(base / 'attempt/CERTIFICATE.json') + self.assertEqual(certificate['status'], 'INCONCLUSIVE_SOURCE_DRIFT') + self.assertEqual(certificate['rows'], []) + self.assertEqual(certificate['scope_statuses']['exact_non_gaussian_population'], + 'INCONCLUSIVE_SOURCE_DRIFT') + + def test_frozen_manifest_detects_real_source_drift(self): + with tempfile.TemporaryDirectory() as temporary: + path = Path(temporary) / 'source.py' + path.write_text('first\n') + before = runner.freeze_sources([path], Path(temporary)) + self.assertEqual(runner.source_drift(before, Path(temporary)), []) + path.write_text('second\n') + self.assertEqual(runner.source_drift(before, Path(temporary)), ['source.py']) + + def test_zero_budget_attempt_serializes_and_refuses_overwrite(self): + with tempfile.TemporaryDirectory() as temporary: + output = Path(temporary) / 'attempt' + result = runner.run(output_dir=output, max_evaluations=0) + self.assertEqual(result['exit_code'], 2) + certificate = runner.load_json(output / 'CERTIFICATE.json') + run = runner.load_json(output / 'RUN.json') + self.assertEqual(certificate['status'], 'INCONCLUSIVE_BUDGET') + self.assertEqual(len(certificate['rows']), 8) + self.assertEqual(run['actual_route_evaluations'], 0) + self.assertEqual(len(run['sources_before']), 9) + self.assertFalse(run['full_declared_campaign']) + original = (output / 'RUN.json').read_bytes() + with self.assertRaises(FileExistsError): + runner.run(output_dir=output, max_evaluations=0) + self.assertEqual((output / 'RUN.json').read_bytes(), original) + + def test_json_rejects_duplicate_nonfinite_and_float_math(self): + with tempfile.TemporaryDirectory() as temporary: + path = Path(temporary) / 'bad.json' + for raw in ('{"a":1,"a":2}', '{"a":NaN}', '{"a":0.5}'): + path.write_text(raw) + with self.assertRaises(ValueError): + runner.load_json(path) + + +def stub_pc(b_shift=Q(0), cdf_shift=Q(0), override=None, void=None): + """Module stand-in for the campaign wiring. The direct route replays + n * cdf_mass(tau) widened by 2^-20 per side as CERTIFIED; optional literal + overrides for a row (both routes), a coefficient shift, a CDF shift or a + fixed void interval inject the fault under test. No scientific execution is + represented by any certificate built from it.""" + override = override or {} + stub = types.SimpleNamespace(**{k: getattr(pc, k) for k in dir(pc) if not k.startswith('__')}) + + def cdf_mass(tau): + for j, (lo, hi) in override.items(): + t, n = pc._schedule(j) + if tau == t: + return lo / n, hi / n + return tuple(x + cdf_shift for x in pc.cdf_mass(tau)) + + def direct_mass(j, max_evaluations=80000, deadline=None): + tau, n = pc._schedule(j) + if j in override: + lo, hi = override[j] + else: + m = pc.cdf_mass(tau) + lo, hi = n * m[0] - Q(1, 1 << 20), n * m[1] + Q(1, 1 << 20) + return {'j': j, 'tau': tau, 'n': n, 'status': 'CERTIFIED', 'evaluations': 1, + 'normalized_interval': (lo, hi), 'interval': (lo / n, hi / n)} + + base_b = pc.coefficient_interval() + stub.cdf_mass, stub.direct_mass = cdf_mass, direct_mass + stub.coefficient_interval = lambda: (base_b[0] + b_shift, base_b[1] + b_shift) + stub.poisson_target = lambda b=None: pc.poisson_target(stub.coefficient_interval() if b is None else b) + if void is not None: + stub.void_interval = lambda mass, n: void + return stub + + +def campaign(**kw): + return runner._campaign(stub_pc(**kw), 80000, time.monotonic() + 900) + + +class EnclosureTests(unittest.TestCase): + # A4: enclosure soundness (sqrt lower endpoint, root sliver, tail trapezoid + # upper bound, CERTIFIED only when every direct gate holds). + def test_power_enclosures_bracket_irrational_radicands(self): + """Kills M02 (sqrt lower endpoint rounded up). Exact radicands (8, 16) cannot see polarity.""" + for v in (Q(2), Q(3), Q(1, 3), Q(5, 7)): + lo, hi = pc._sqrt((v, v)) + self.assertTrue(lo < hi and lo * lo <= v <= hi * hi, (v, lo, hi)) + lo, hi = pc.quarter_power_bounds(v) + self.assertTrue(lo < hi and lo ** 4 <= v <= hi ** 4, (v, lo, hi)) + lo, hi = pc.cube_root_bounds(v) + self.assertTrue(lo < hi and lo ** 3 <= v <= hi ** 3, (v, lo, hi)) + + def test_direct_row_replays_its_component_composition(self): + """Kills M04 (root sliver dropped) and M06 (tail trapezoid replaced by midpoint sum).""" + row = pc.direct_mass(1) + core, tail = row['core_interval'], row['tail_interval'] + self.assertEqual(row['normalized_interval'], + (core[0] + tail[0], core[1] + tail[1] + row['sliver_width'])) + self.assertGreater(row['sliver_width'], 0) + self.assertGreater(row['discretization_components']['core'], 0) + self.assertGreater(row['discretization_components']['tail'], 0) + self.assertEqual(row['interval'], tuple(x / row['n'] for x in row['normalized_interval'])) + self.assertEqual((row['tau'], row['n']), (Q(1, 8), 4)) + + def test_failed_direct_gate_is_not_certified(self): + """Kills M16 (status CERTIFIED regardless of gates).""" + with mock.patch.object(pc, 'CORE_PANELS', 64): + row = pc.direct_mass(1) + self.assertFalse(row['gates']['normalized_width']) + self.assertEqual(row['status'], 'INCONCLUSIVE_PRECISION') + self.assertGreaterEqual(row['normalized_width'], Q(1, 1 << 17)) + + def test_saturation_is_reached_by_the_closed_form_not_only_the_literal(self): + """The literal branch cdf_mass(9/4) == 1/5 cannot fail; this checks the computed route.""" + lo, hi = pc.cdf_mass(Q(9, 4) - Q(1, 1 << 40)) + self.assertLess(Q(1, 5) - lo, Q(1, 1 << 80)) + self.assertLessEqual(hi, Q(1, 5)) + + def test_void_interval_replays_its_outward_log_exp_composition(self): + """Kills M03a (void endpoints taken inward); containment of (1-m)^n alone cannot see it.""" + def exponent(m, n): + lo, hi = pc.log_bounds(1 - m, bits=pc.BITS) + return pc._outward((-n * hi, -n * lo)) + # Normalized mass n*m in (1/7, 1/5) at n = 4 and at the row-8 count, plus a point mass. + for mass, n in (((Q(1, 7), Q(1, 5)), 4), ((Q(1, 7 * 4 ** 8), Q(1, 5 * 4 ** 8)), 4 ** 8), + ((Q(1, 3), Q(1, 3)), 4)): + lo, hi = pc.void_interval(mass, n) + self.assertEqual((lo, hi), (pc.exp_neg_bounds(exponent(mass[1], n)[1])[0], + pc.exp_neg_bounds(exponent(mass[0], n)[0])[1])) + self.assertTrue(lo < (1 - mass[1]) ** n <= (1 - mass[0]) ** n < hi, (mass, n)) + + def test_poisson_target_replays_its_outward_exp_composition(self): + """Kills M03b (Poisson target endpoints taken inward); exp(-B) is contained either way.""" + for b in (pc.coefficient_interval(), (Q(1, 3), Q(1, 2))): + lo, hi = pc.poisson_target(b) + self.assertEqual((lo, hi), (pc.exp_neg_bounds(b[1])[0], pc.exp_neg_bounds(b[0])[1])) + self.assertLess(lo, hi) + self.assertEqual(pc.poisson_target(), pc.poisson_target(pc.coefficient_interval())) + + def test_tail_upper_endpoint_dominates_a_finer_midpoint_lower_bound(self): + """Kills M06_CEILING_ONLY (C270-A4): the trapezoid ceiling at population_certificate.py + line 392 replaced by an outward-rounded midpoint sum while tail_upper_floor and the + positive tail diagnostic stay intact, which the component replay above cannot see. + + Oracle: the tail integrand C*(9*t^(-11/4) - rhi^2*t^(-3/4)) is convex on [1, 1/rhi] + (CONTROLLED_FALSIFICATION.md, direct tail: "It is convex; f'' <= 99/32*t^(-19/4)"; + gates tail_convexity and tail_second_derivative), so on every octave each trapezoid + sum bounds the integral from above, each midpoint sum from below, and midpoint sums + increase under dyadic refinement. With outward rounding the declared 512-panel tail + upper endpoint therefore dominates the 1024-panel tail lower endpoint. The damaged + ceiling is itself a 512-panel midpoint sum and falls below that finer lower bound by + about 7.5e-8 at j=1; the pristine ceiling exceeds it by about 2.2e-7. The core is cut + to 64 panels because the tail sums read only rhi, the tail coefficient and + TAIL_PANELS, never the core; the row is then INCONCLUSIVE_PRECISION but still reports + its tail interval. The finer sum is an oracle only; the campaign keeps 512 panels. + """ + def tail_row(panels): + with mock.patch.object(pc, 'CORE_PANELS', 64), mock.patch.object(pc, 'TAIL_PANELS', panels): + row = pc.direct_mass(1) + self.assertEqual(row['status'], 'INCONCLUSIVE_PRECISION') + self.assertTrue(row['gates']['tail_convexity'] and row['gates']['tail_second_derivative']) + # 65 core nodes; two tail octaves of 2*panels+1 nodes sharing the node t=2. + self.assertEqual(row['evaluations'], 65 + 2 * (2 * panels + 1) - 1) + return row + self.assertEqual(pc.TAIL_PANELS, 512) + coarse, finer = tail_row(pc.TAIL_PANELS), tail_row(2 * pc.TAIL_PANELS) + self.assertLessEqual(finer['tail_interval'][0], finer['tail_interval'][1]) + # Refinement raises the midpoint sum; the finer floor loses at most its own arithmetic width. + self.assertLessEqual(coarse['tail_interval'][0], + finer['tail_interval'][0] + finer['arithmetic_components']['tail_lower']) + self.assertGreaterEqual(coarse['tail_interval'][1], finer['tail_interval'][0]) + + +class PredicateFixtureTests(unittest.TestCase): + # A5: predicate fixtures strictly between the outer and inner envelopes, + # the void width gate at its declared limit, and the declared overall priority. + def test_coefficient_inconclusive_strictly_between_outer_and_inner(self): + """Kills M08/M08b (FALSIFIED threshold moved from the outer to the inner envelope).""" + b, e = (Q(1, 5), Q(3, 10)), (Q(1, 10), Q(1, 10)) # inner=[1/5,3/10], outer=[1/10,2/5] + self.assertEqual(pc.classify_coefficient((Q(12, 100), Q(15, 100)), b, e), 'INCONCLUSIVE_PRECISION') + self.assertEqual(pc.classify_coefficient((Q(35, 100), Q(38, 100)), b, e), 'INCONCLUSIVE_PRECISION') + self.assertEqual(pc.classify_coefficient((Q(9, 100), Q(99, 1000)), b, e), 'FALSIFIED') + + def test_void_width_gate_at_its_declared_limit(self): + """Kills M15 (WIDTH_LIMIT relaxed 256x); the existing (0,1/4) fixture is 16384x over the limit.""" + target = (Q(1, 2), Q(1, 2)) + self.assertEqual(pc.classify_void((Q(1, 2), Q(1, 2) + Q(1, 1 << 16)), target), 'PASS') + self.assertEqual(pc.classify_void((Q(1, 2), Q(1, 2) + Q(1, 1 << 16) + Q(1, 1 << 40)), target), + 'INCONCLUSIVE_PRECISION') + + def test_overall_priority_is_the_declared_one(self): + """Kills M20 (FALSIFIED dropped from the priority list).""" + self.assertEqual(runner._overall(['PASS'] * 8), 'PASS') + self.assertEqual(runner._overall(['PASS'] * 7 + ['FALSIFIED']), 'FALSIFIED') + self.assertEqual(runner._overall(['FALSIFIED', 'INCONCLUSIVE_PRECISION']), 'INCONCLUSIVE_PRECISION') + self.assertEqual(runner._overall(['FALSIFIED', 'FAIL_IMPLEMENTATION']), 'FAIL_IMPLEMENTATION') + self.assertEqual(runner._overall([]), 'INCONCLUSIVE_PRECISION') + + def test_overall_requires_every_status_to_pass(self): + """Kills M21 (PASS if any status passes): an undeclared status beside PASS is no pass.""" + self.assertEqual(runner._overall(['PASS', 'NOT_A_DECLARED_STATUS']), 'INCONCLUSIVE_PRECISION') + self.assertEqual(runner._overall(['NOT_RUN', 'PASS', 'PASS']), 'INCONCLUSIVE_PRECISION') + self.assertEqual(runner._overall(['PASS', 'PASS']), 'PASS') + self.assertEqual(runner._overall([]), 'INCONCLUSIVE_PRECISION') + + +class NegativeControlTests(unittest.TestCase): + # A1: the mass negative controls must be able to fail; an injected fixed-left + # selector has to trip the declared gates instead of comparing literals. + DECLARED = {'all_stationary_and_inside_rectangle', 'chart_gaps', 'outer_height_identity', + 'actual_theta2_gap', 'reject_fixed_left', 'boundary_exclusion', + 'whole_rectangle_mass', 'missing_sign_detected', 'conditioning_detected'} + + def test_negative_controls_evaluate_every_declared_gate(self): + """Kills M10 (a gate silently deleted).""" + result = pc.negative_controls() + self.assertEqual(set(result['gates']), self.DECLARED) + self.assertTrue(all(result['gates'].values())) + self.assertEqual(result['status'], 'PASS') + self.assertEqual(len(result['controls']), 14) + + def test_negative_controls_fail_when_the_selector_is_fixed_left(self): + """Kills M11 (status PASS regardless of gates): an injected fixed-left lifetime must fail.""" + real = pc.critical_fixture + + def fixed_left(a, h, sign=1): + row = real(a, h, sign) + if h == 2 * a: + row['lifetime'] = 32 * a ** 4 + return row + with mock.patch.object(pc, 'critical_fixture', fixed_left): + result = pc.negative_controls() + self.assertFalse(result['gates']['actual_theta2_gap']) + self.assertFalse(result['gates']['reject_fixed_left']) + self.assertEqual(result['status'], 'FAIL_IMPLEMENTATION') + + +class CampaignWiringTests(unittest.TestCase): + # A2: the acceptance wiring of runner._campaign (route intersection, coefficient + # and void verdicts, row-8 gates, exit code, full-campaign receipt) is executed + # on literal stubs. A3: the end-of-run source-drift check is exercised. + def test_consistent_routes_and_correct_coefficient_pass(self): + """Executes runner lines 193-235 on a known-good stub; kills M24 (runner schedule diverging from pc).""" + cert = campaign() + self.assertEqual(cert['status'], 'PASS') + self.assertEqual([r['status'] for r in cert['rows']], ['PASS'] * 8) + self.assertEqual(cert['rows'][7]['finite_void']['status'], 'PASS') + for r in cert['rows']: + self.assertEqual(r['intersection_normalized'], + (max(r['direct']['normalized_interval'][0], r['cdf_normalized'][0]), + min(r['direct']['normalized_interval'][1], r['cdf_normalized'][1]))) + + def test_wrong_coefficient_is_falsified_at_row_eight_only(self): + """Kills M19 (row status PASS regardless) and M20; B shifted by 1.2e-4 > E(tau_8) = 7.8e-5.""" + cert = campaign(b_shift=Q(3, 25000)) + row8 = cert['rows'][7] + self.assertEqual(row8['coefficient_status'], 'FALSIFIED') + self.assertEqual(row8['status'], 'FALSIFIED') + self.assertEqual(row8['finite_void']['status'], 'PASS') + self.assertEqual(cert['status'], 'FALSIFIED') + self.assertEqual([r['status'] for r in cert['rows'][:7]], ['PASS'] * 7) + + def test_disjoint_routes_are_route_consistency_failures(self): + """Kills M17 (overlap predicate disabled) and M18 (CDF route ignored in the intersection).""" + cert = campaign(cdf_shift=Q(1, 100)) + self.assertEqual([r['status'] for r in cert['rows']], ['FAIL_ROUTE_CONSISTENCY'] * 8) + self.assertEqual(cert['status'], 'FAIL_ROUTE_CONSISTENCY') + self.assertTrue(all(r['coefficient_status'] == 'NOT_RUN' for r in cert['rows'])) + + def test_row_eight_mass_gate_withholds_the_void_test(self): + """Kills M25 (mass gate trivially true).""" + cert = campaign(override={8: (Q(34, 100), Q(34, 100) + Q(1, 1 << 20))}) + row8 = cert['rows'][7] + self.assertFalse(row8['finite_void']['gates']['mass_gate']) + self.assertEqual(row8['finite_void']['status'], 'INCONCLUSIVE_PRECISION') + self.assertEqual(row8['status'], 'INCONCLUSIVE_PRECISION') + + def test_wide_void_interval_is_inconclusive_even_with_a_passing_coefficient(self): + """Kills M28 (void/target width gates ignored).""" + cert = campaign(void=(Q(0), Q(1, 4))) + row1 = cert['rows'][0] + self.assertEqual(row1['coefficient_status'], 'PASS') + self.assertFalse(row1['void_width_gate']) + self.assertEqual(row1['status'], 'INCONCLUSIVE_PRECISION') + self.assertEqual(cert['status'], 'INCONCLUSIVE_PRECISION') + + def test_falsified_attempt_exits_one_and_is_no_full_campaign_under_reduced_budget(self): + """Kills M26 (exit 0 on FALSIFIED) and M27 (full campaign receipt ignores budget arguments).""" + falsified = campaign(b_shift=Q(3, 25000)) + with tempfile.TemporaryDirectory() as tmp, mock.patch.object(runner, '_campaign', lambda *a: falsified): + rec = runner.run(output_dir=Path(tmp) / 'attempt', max_evaluations=80000, time_budget=900) + self.assertEqual(rec['status'], 'FALSIFIED') + self.assertEqual(rec['exit_code'], 1) + certified = {'rows': [{'direct': {'status': 'CERTIFIED'}} for _ in range(8)]} + self.assertTrue(runner.full_declared_campaign(certified, 80000, 900, [])) + self.assertFalse(runner.full_declared_campaign(certified, 79999, 900, [])) + self.assertFalse(runner.full_declared_campaign(certified, 80000, 899, [])) + + def test_source_edited_during_evaluation_is_source_drift(self): + """Kills M22 (post-run hash comparison dropped). Contract: 'check them again at the end'.""" + # Same copied nine-file source cut as the pre-run drift test above. + population = runner.POPULATION.relative_to(runner.REPOSITORY) + with tempfile.TemporaryDirectory() as temporary: + base = Path(temporary) + for source in runner.SOURCE_PATHS: + target = base / source.relative_to(runner.REPOSITORY) + target.parent.mkdir(parents=True, exist_ok=True) + target.write_bytes(source.read_bytes()) + copy_path = base / population / 'run_population_certificate.py' + spec = importlib.util.spec_from_file_location('copied_runner_drift', copy_path) + copied = importlib.util.module_from_spec(spec) + spec.loader.exec_module(copied) + proof = base / population / 'PROOF.md' + + def campaign_that_edits_a_source(pc_module, max_evaluations, deadline): + proof.write_bytes(proof.read_bytes() + b'\n') + return {'schema_version': 1, 'status': 'PASS', 'rows': [], 'scope_statuses': + {'exact_non_gaussian_population': 'PASS'}} + copied._campaign = campaign_that_edits_a_source + rec = copied.run(output_dir=base / 'attempt', max_evaluations=80000, time_budget=900) + self.assertEqual(rec['status'], 'INCONCLUSIVE_SOURCE_DRIFT') + self.assertEqual(rec['exit_code'], 2) + self.assertEqual(rec['source_drift'], [str(population / 'PROOF.md')]) + self.assertFalse(rec['full_declared_campaign']) + + +class MassControlRouteTests(unittest.TestCase): + # A1: alter the normalization inside the real CDF route, not the reported + # controls. All three controls must depend on that computed probability. + def halved_cdf_normalization(self): + scale = pc._scale + + def missing_sign(value, weight): + return scale(value, weight / 2 if weight == Q(1, 15) else weight) + + return mock.patch.object(pc, '_scale', side_effect=missing_sign) + + def test_saturation_at_and_above_support_uses_the_computed_route(self): + with self.halved_cdf_normalization(): + for tau in (Q(9, 4), Q(3)): + self.assertEqual(pc.cdf_mass(tau), (Q(1, 10), Q(1, 10))) + + def test_whole_rectangle_control_fails_for_missing_route_normalization(self): + with self.halved_cdf_normalization(): + controls = pc.negative_controls() + self.assertFalse(controls['gates']['whole_rectangle_mass']) + self.assertEqual(controls['status'], 'FAIL_IMPLEMENTATION') + + def test_missing_sign_control_is_derived_from_the_computed_route(self): + with self.halved_cdf_normalization(): + controls = pc.negative_controls() + self.assertEqual(controls['missing_sign_mass'], (Q(1, 20), Q(1, 20))) + self.assertFalse(controls['gates']['missing_sign_detected']) + + def test_conditioned_control_is_derived_from_the_computed_route(self): + with self.halved_cdf_normalization(): + controls = pc.negative_controls() + self.assertEqual(controls['conditioned_mass'], (Q(1, 2), Q(1, 2))) + self.assertFalse(controls['gates']['conditioning_detected']) + + def test_real_campaign_withholds_acceptance_after_mass_control_fault(self): + with self.halved_cdf_normalization(): + controls = pc.negative_controls() + # Reuse the explicitly synthetic, otherwise accepting route fixture. + # Only the controls come from the real route-normalization fault above; + # this tests the soundness gate rather than a zero-budget short circuit. + fixture = stub_pc() + fixture.negative_controls = lambda: controls + certificate = runner._campaign(fixture, 80000, time.monotonic() + 900) + self.assertEqual(certificate['negative_controls']['status'], 'FAIL_IMPLEMENTATION') + self.assertEqual(certificate['status'], 'FAIL_IMPLEMENTATION') + self.assertEqual(certificate['scope_statuses']['exact_non_gaussian_population'], + 'FAIL_IMPLEMENTATION') + self.assertTrue(all(row['direct']['status'] == 'CERTIFIED' + for row in certificate['rows'])) + self.assertEqual([row['status'] for row in certificate['rows']], + ['FAIL_IMPLEMENTATION'] * 8) + self.assertTrue(all(row['coefficient_status'] == 'NOT_RUN' + for row in certificate['rows'])) + + def test_unmutated_mass_controls_preserve_expected_probabilities(self): + controls = pc.negative_controls() + self.assertEqual(controls['whole_rectangle_mass'], (Q(1, 5), Q(1, 5))) + self.assertEqual(controls['missing_sign_mass'], (Q(1, 10), Q(1, 10))) + self.assertEqual(controls['conditioned_mass'], (Q(1), Q(1))) + self.assertEqual(controls['status'], 'PASS') + + def test_rectangle_control_accepts_enclosure_and_rejects_disjoint_mass(self): + self.assertTrue(pc.rectangle_mass_control((Q(199, 1000), Q(201, 1000)))) + self.assertFalse(pc.rectangle_mass_control((Q(99, 1000), Q(101, 1000)))) + self.assertFalse(pc.rectangle_mass_control((Q(999, 1000), Q(1)))) + + +class RunnerAttributionTests(unittest.TestCase): + # Disclosure strings below are test fixtures, not executor attestations. + # Actual test execution and its source-exposed performer belong in the log. + def test_omitted_disclosures_do_not_claim_a_provider(self): + with tempfile.TemporaryDirectory() as temporary: + output = Path(temporary) / 'attempt' + runner.run(output_dir=output, max_evaluations=0) + record = runner.load_json(output / 'RUN.json') + self.assertEqual(record['performer'], 'UNSPECIFIED') + self.assertEqual(record['exposure'], 'UNSPECIFIED') + self.assertEqual(record['organizational_independence_credit'], 0) + + def test_caller_disclosures_reach_the_retained_receipt(self): + with tempfile.TemporaryDirectory() as temporary: + output = Path(temporary) / 'attempt' + runner.run(output_dir=output, max_evaluations=0, + performer='Anthropic/Claude fixture; session fixture-451', + exposure='Source-exposed fixture; shared principal') + record = runner.load_json(output / 'RUN.json') + self.assertEqual(record['performer'], + 'Anthropic/Claude fixture; session fixture-451') + self.assertEqual(record['exposure'], + 'Source-exposed fixture; shared principal') + self.assertEqual(record['organizational_independence_credit'], 0) + self.assertFalse(record['full_declared_campaign']) + self.assertEqual(record['actual_route_evaluations'], 0) + + def test_invalid_disclosure_is_refused_before_creating_an_attempt(self): + for field in ('performer', 'exposure'): + for value in ('', ' \t\n', None, 42, False): + with self.subTest(field=field, value=value), tempfile.TemporaryDirectory() as temporary: + output = Path(temporary) / 'attempt' + with self.assertRaises(ValueError): + runner.run(output_dir=output, max_evaluations=0, + **{field: value}) + self.assertFalse(output.exists()) + + def test_disclosures_do_not_change_certificate_or_report_bytes(self): + with tempfile.TemporaryDirectory() as temporary: + base = Path(temporary) + runner.run(output_dir=base / 'undisclosed', max_evaluations=0) + runner.run(output_dir=base / 'disclosed', max_evaluations=0, + performer='Non-OpenAI fixture', exposure='Source-exposed fixture') + for name in ('CERTIFICATE.json', 'RESULTS.md'): + self.assertEqual((base / 'undisclosed' / name).read_bytes(), + (base / 'disclosed' / name).read_bytes()) + + def test_cli_disclosures_and_defaults_reach_a_source_refusal_receipt(self): + cases = [([], 'UNSPECIFIED', 'UNSPECIFIED'), + (['--performer', 'Anthropic/Claude CLI fixture', + '--exposure', 'Source-exposed CLI fixture'], + 'Anthropic/Claude CLI fixture', 'Source-exposed CLI fixture')] + for arguments, performer, exposure in cases: + with self.subTest(arguments=arguments), tempfile.TemporaryDirectory() as temporary: + base = Path(temporary) + for source in runner.SOURCE_PATHS: + target = base / source.relative_to(runner.REPOSITORY) + target.parent.mkdir(parents=True, exist_ok=True) + target.write_bytes(source.read_bytes()) + # Refuse this real copied source before numerical evaluation. + # The CLI still has to retain the supplied attribution correctly. + contract = base / 'experiments/universality/two_parameter_cusp_population/CONTROLLED_FALSIFICATION.md' + contract.write_bytes(contract.read_bytes() + b'\n') + script = base / runner.POPULATION.relative_to(runner.REPOSITORY) / 'run_population_certificate.py' + mode = ['-O'] if sys.flags.optimize else [] + completed = subprocess.run([sys.executable, '-B', '-E', '-S'] + mode + + [str(script)] + arguments, + capture_output=True, text=True, timeout=10) + self.assertEqual(completed.returncode, 2, completed.stderr) + record = runner.load_json(base / 'experiments/universality/results/exact_population_1/RUN.json') + self.assertEqual(record['status'], 'INCONCLUSIVE_SOURCE_DRIFT') + self.assertEqual(record['performer'], performer) + self.assertEqual(record['exposure'], exposure) + self.assertEqual(record['organizational_independence_credit'], 0) + self.assertEqual(record['actual_route_evaluations'], 0) + + +class CapturedSourceRunTests(unittest.TestCase): + """Public-run source-image controls; accepting payloads are synthetic only. + + No full numerical campaign is represented by these payloads. These tests + would fail if run() selected ambient/cached project code or decided drift + from an observation different from its retained sources_after manifest. + """ + PROJECT_MODULES = ('population_certificate', 'finite_certificate', + 'gaussian_tail', 'mean_adaptive_confidence', 'finite_count_loss') + POPULATION_PATH = 'experiments/universality/two_parameter_cusp_population' + PROOF_PATH = POPULATION_PATH + '/PROOF.md' + + @contextmanager + def source_fixture(self): + with tempfile.TemporaryDirectory() as temporary: + base = Path(temporary).resolve() + for source in runner.SOURCE_PATHS: + target = base / source.relative_to(runner.REPOSITORY) + target.parent.mkdir(parents=True, exist_ok=True) + target.write_bytes(source.read_bytes()) + script = base / self.POPULATION_PATH / 'run_population_certificate.py' + spec = importlib.util.spec_from_file_location('captured_source_runner_fixture', script) + copied = importlib.util.module_from_spec(spec) + spec.loader.exec_module(copied) + yield base, copied + + @contextmanager + def ambient_imports(self, base, extra_path=None): + # Restore every caller cache entry and the exact path object/content. + with mock.patch.dict(sys.modules), mock.patch.object(sys, 'path', list(sys.path)): + for name in self.PROJECT_MODULES: + sys.modules.pop(name, None) + sys.path[:0] = [str(base / self.POPULATION_PATH), + str(base / 'experiments/periodic_h0')] + if extra_path is not None: + sys.path.insert(0, str(extra_path)) + yield + + def synthetic_accepting(self): + certificate = runner._empty_certificate('PASS', '') + certificate['test_fixture'] = 'SYNTHETIC_ACCEPTING_NOT_NUMERICAL' + certificate['rows'] = [ + {'j': j, 'tau': Q(1, 1 << (3 * j)), 'n': 4 ** j, + 'status': 'PASS', 'coefficient_status': 'PASS', + 'direct': {'status': 'CERTIFIED', 'evaluations': 0, + 'normalized_interval': (Q(1, 5), Q(1, 5))}, + 'cdf_normalized': (Q(1, 5), Q(1, 5))} + for j in range(1, 9)] + certificate['rows'][-1].update({ + 'void_interval': (Q(4, 5), Q(4, 5)), + 'target_interval': (Q(4, 5), Q(4, 5)), + 'finite_void': {'status': 'PASS', 'endpoint_distance': Q(0)}}) + return certificate + + def invoke(self, base, copied, probe=None, name='attempt'): + def synthetic(pc_module, max_evaluations, deadline): + certificate = self.synthetic_accepting() + if probe is not None: + certificate['observed_image'] = probe(pc_module) + return certificate + with mock.patch.object(copied, '_campaign', synthetic): + record = copied.run(output_dir=base / name, max_evaluations=80000, time_budget=900, + performer='OpenAI/Codex source-custody test fixture', + exposure='Synthetic accepting payload; no numerical campaign') + return record, copied.load_json(base / name / 'CERTIFICATE.json') + + def assert_drift_closed(self, base, record, certificate, name='attempt'): + self.assertEqual(certificate['test_fixture'], 'SYNTHETIC_ACCEPTING_NOT_NUMERICAL') + self.assertEqual(record['status'], 'INCONCLUSIVE_SOURCE_DRIFT') + self.assertEqual(record['exit_code'], 2) + self.assertFalse(record['full_declared_campaign']) + self.assertIn(self.PROOF_PATH, record['source_drift']) + self.assertEqual(certificate['scope_statuses']['exact_non_gaussian_population'], + 'INCONCLUSIVE_SOURCE_DRIFT') + self.assertEqual([row['status'] for row in certificate['rows']], + ['INCONCLUSIVE_SOURCE_DRIFT'] * 8) + self.assertEqual([row['coefficient_status'] for row in certificate['rows']], + ['NOT_ACCEPTED_SOURCE_DRIFT'] * 8) + self.assertEqual(certificate['rows'][-1]['finite_void']['status'], + 'NOT_ACCEPTED_SOURCE_DRIFT') + for filename in ('CERTIFICATE.json', 'RESULTS.md'): + raw = (base / name / filename).read_bytes() + self.assertEqual(record['outputs'][filename], + {'sha256': hashlib.sha256(raw).hexdigest(), 'bytes': len(raw)}) + saved = runner.load_json(base / name / 'RUN.json') + for key in ('status', 'exit_code', 'source_drift', 'sources_before', 'sources_after', + 'full_declared_campaign', 'outputs'): + self.assertEqual(saved[key], record[key]) + + def test_cached_population_does_not_replace_captured_disk_image(self): + # Kills selecting sys.modules['population_certificate'] after hashing disk. + with self.source_fixture() as (base, copied), self.ambient_imports(base): + ambient = __import__('population_certificate') + path = base / self.POPULATION_PATH / 'population_certificate.py' + path.write_bytes(path.read_bytes() + b'\nCAPTURED_SENTINEL = "new frozen image"\n') + record, certificate = self.invoke(base, copied, + lambda module: getattr(module, 'CAPTURED_SENTINEL', 'old cached image')) + self.assertEqual(certificate['observed_image'], 'new frozen image') + self.assertEqual(record['source_drift'], []) + self.assertIs(sys.modules['population_certificate'], ambient) + + def test_cached_edited_dependencies_and_aliases_do_not_survive_pinned_restoration(self): + # Each edited helper is really imported before its pinned bytes return. + probes = { + 'finite_certificate': ('sqrt_bounds', lambda module: module._sqrt((Q(4), Q(4)))), + 'gaussian_tail': ('exp_neg_bounds', lambda module: module.exp_neg_bounds(Q(0))), + 'mean_adaptive_confidence': ('log_bounds', lambda module: module.log_bounds(Q(1))), + 'finite_count_loss': ('bar_cap', lambda module: module.log_bounds.__globals__['cl'].bar_cap(1))} + for dependency, (function, probe) in probes.items(): + with self.subTest(dependency=dependency), self.source_fixture() as (base, copied), self.ambient_imports(base): + path = base / 'experiments/periodic_h0' / (dependency + '.py') + pinned = path.read_bytes() + path.write_bytes(pinned + ('\ndef ' + function + '(*args, **kwargs):\n' + ' raise RuntimeError("cached edited helper executed")\n').encode()) + __import__('population_certificate') + path.write_bytes(pinned) + record, certificate = self.invoke(base, copied, lambda module: str(probe(module))) + self.assertEqual(record['status'], 'PASS', certificate.get('error')) + self.assertEqual(record['source_drift'], []) + self.assertIn('observed_image', certificate) + + def test_cold_freeze_load_revert_executes_the_retained_population_bytes(self): + # Kills reopening mutable source after freeze, even when endpoints agree. + with self.source_fixture() as (base, copied), self.ambient_imports(base): + path = base / self.POPULATION_PATH / 'population_certificate.py' + pinned, read_bytes = path.read_bytes(), Path.read_bytes + last_before = base / self.POPULATION_PATH / 'run_population_certificate.py' + injected = [] + def mutate_after_last_before(observed): + raw = read_bytes(observed) + if observed == last_before and not injected: + injected.append(True) + path.write_bytes(pinned + b'\nCAPTURED_SENTINEL = "transient unretained image"\n') + return raw + def probe(module): + value = getattr(module, 'CAPTURED_SENTINEL', 'retained original image') + path.write_bytes(pinned) + return value + with mock.patch.object(Path, 'read_bytes', mutate_after_last_before): + record, certificate = self.invoke(base, copied, probe) + self.assertEqual(certificate['observed_image'], 'retained original image') + self.assertEqual(record['source_drift'], []) + + def test_ambient_project_cache_and_search_path_cannot_select_code(self): + for contamination in ('cache', 'path'): + with self.subTest(contamination=contamination), self.source_fixture() as (base, copied): + shadow = base / 'shadow'; shadow.mkdir() + (shadow / 'population_certificate.py').write_text('CAPTURED_SENTINEL = "ambient shadow"\n') + with self.ambient_imports(base, shadow): + if contamination == 'cache': + module = types.ModuleType('population_certificate') + module.CAPTURED_SENTINEL = 'ambient shadow' + sys.modules['population_certificate'] = module + path_object, path_before = sys.path, list(sys.path) + modules_before = {name: sys.modules.get(name) for name in self.PROJECT_MODULES} + record, certificate = self.invoke(base, copied, + lambda module: getattr(module, 'CAPTURED_SENTINEL', 'retained original image')) + self.assertEqual(certificate['observed_image'], 'retained original image') + self.assertEqual(record['status'], 'PASS') + self.assertIs(sys.path, path_object) + self.assertEqual(sys.path, path_before) + for name, prior in modules_before.items(): + self.assertIs(sys.modules.get(name), prior) + + def test_stale_bytecode_cannot_replace_the_captured_population_bytes(self): + # Same mtime and byte count make this a usable hostile timestamp pyc. + with self.source_fixture() as (base, copied), self.ambient_imports(base): + path = base / self.POPULATION_PATH / 'population_certificate.py' + pinned = path.read_bytes() + changed = pinned.replace(b'BITS = 128\n', b'BITS = 127\n', 1) + self.assertEqual(len(changed), len(pinned)) + path.write_bytes(changed); os.utime(path, (1700000000, 1700000000)) + py_compile.compile(str(path), doraise=True, optimize=sys.flags.optimize) + path.write_bytes(pinned); os.utime(path, (1700000000, 1700000000)) + record, certificate = self.invoke(base, copied, lambda module: module.BITS) + self.assertEqual(certificate['observed_image'], 128) + self.assertEqual(record['source_drift'], []) + + def test_uncaptured_and_dotted_project_imports_are_refused(self): + # Kills a private resolver that falls back to ambient arbitrary imports. + for route in ('uncaptured', 'project_dotted'): + with self.subTest(route=route), self.source_fixture() as (base, copied), self.ambient_imports(base): + population = base / self.POPULATION_PATH / 'population_certificate.py' + if route == 'uncaptured': + (population.parent / 'sixth_project_dependency.py').write_text('SENTINEL = "uncaptured code"\n') + injected = b'\nfrom sixth_project_dependency import SENTINEL\n' + else: + extra = types.ModuleType('finite_certificate.extra') + extra.SENTINEL = 'ambient dotted code' + sys.modules['finite_certificate.extra'] = extra + injected = b'\nfrom finite_certificate.extra import SENTINEL\n' + population.write_bytes(population.read_bytes() + injected) + record, certificate = self.invoke(base, copied) + self.assertEqual(record['status'], 'SETUP_BLOCKED') + self.assertEqual(record['exit_code'], 2) + self.assertEqual(certificate['rows'], []) + self.assertIn('ImportError', certificate.get('error', '')) + + def test_receipt_identifies_consumed_image_without_attesting_loaded_coordinator(self): + with self.source_fixture() as (base, copied): + record, certificate = self.invoke(base, copied) + loading = record.get('project_source_loading', {}) + self.assertEqual(loading.get('status'), 'COMPLETE') + self.assertEqual(set(loading['captured_module_sources']), set(self.PROJECT_MODULES)) + self.assertEqual(set(loading['loaded_modules']), set(self.PROJECT_MODULES)) + for metadata in loading['captured_module_sources'].values(): + self.assertEqual({'sha256': metadata['sha256'], 'bytes': metadata['bytes']}, + record['sources_before'][metadata['path']]) + self.assertFalse(loading['loaded_coordinator_attested']) + self.assertFalse(loading['interpreter_stdlib_attested']) + self.assertIn('already loaded', loading['trusted_boundary']) + self.assertIn('custody', loading['trusted_boundary']) + self.assertEqual(certificate['test_fixture'], 'SYNTHETIC_ACCEPTING_NOT_NUMERICAL') + + def test_each_invocation_has_a_private_project_image_and_preserves_caller_path(self): + with self.source_fixture() as (base, copied), self.ambient_imports(base): + interval = str(base / 'experiments/periodic_h0') + sys.path.remove(interval) + path_before = list(sys.path) + def probe(module): + prior = getattr(module, 'INVOCATION_SENTINEL', 'fresh image') + module.INVOCATION_SENTINEL = 'previous invocation' + return prior + for name in ('first', 'second'): + record, certificate = self.invoke(base, copied, probe, name=name) + self.assertEqual(certificate['observed_image'], 'fresh image') + self.assertEqual(record['status'], 'PASS') + self.assertEqual(sys.path, path_before) + + def test_retained_after_edit_withdraws_all_nested_acceptance_and_binds_outputs(self): + with self.source_fixture() as (base, copied): + proof = base / self.PROOF_PATH + freeze = copied.freeze_sources + def edit_at_retained_after(paths=None, *args, **kwargs): + if paths == [proof]: + proof.write_bytes(proof.read_bytes() + b'\nretained-after edit\n') + return freeze(*args, **kwargs) if paths is None else freeze(paths, *args, **kwargs) + with mock.patch.object(copied, 'freeze_sources', edit_at_retained_after): + record, certificate = self.invoke(base, copied) + self.assertNotEqual(record['sources_before'][self.PROOF_PATH], record['sources_after'][self.PROOF_PATH]) + self.assert_drift_closed(base, record, certificate) + + def test_retained_after_read_error_is_drift_and_preserves_the_error(self): + with self.source_fixture() as (base, copied): + proof = base / self.PROOF_PATH + freeze = copied.freeze_sources + def fail_at_retained_after(paths=None, *args, **kwargs): + if paths == [proof]: + raise PermissionError('synthetic retained-after read denial') + return freeze(*args, **kwargs) if paths is None else freeze(paths, *args, **kwargs) + with mock.patch.object(copied, 'freeze_sources', fail_at_retained_after): + record, certificate = self.invoke(base, copied) + self.assertIn('PermissionError', record['sources_after'][self.PROOF_PATH].get('error', '')) + self.assert_drift_closed(base, record, certificate) + + def test_decision_uses_retained_after_even_when_a_later_reread_would_revert(self): + with self.source_fixture() as (base, copied): + proof = base / self.PROOF_PATH + pinned, freeze, read_bytes = proof.read_bytes(), copied.freeze_sources, Path.read_bytes + reads = [] + def count_source_reads(path): + if path == proof: + reads.append(True) + return read_bytes(path) + def retain_then_revert(paths=None, *args, **kwargs): + if paths == [proof]: + proof.write_bytes(pinned + b'\nretained observation only\n') + retained = freeze(paths, *args, **kwargs) + proof.write_bytes(pinned) + return retained + return freeze(*args, **kwargs) if paths is None else freeze(paths, *args, **kwargs) + with mock.patch.object(Path, 'read_bytes', count_source_reads), mock.patch.object(copied, 'freeze_sources', retain_then_revert): + record, certificate = self.invoke(base, copied) + self.assertNotEqual(record['sources_before'][self.PROOF_PATH], record['sources_after'][self.PROOF_PATH]) + self.assert_drift_closed(base, record, certificate) + self.assertEqual(len(reads), 2, 'one before read and one retained after read; no separate decision read') + + +if __name__ == '__main__': + unittest.main()