From 375c139ec33f0fba3e216ac10d62ebb1c433a8c8 Mon Sep 17 00:00:00 2001 From: eumemic <94939491+eumemic@users.noreply.github.com> Date: Sun, 11 Oct 2026 07:13:37 -0700 Subject: [PATCH 1/3] Add independent exact audit receipt for R740 rank138 candidate --- .../independent/INDEPENDENT-AUDIT.json | 162 ++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 research/e8-r740-replica32/independent/INDEPENDENT-AUDIT.json diff --git a/research/e8-r740-replica32/independent/INDEPENDENT-AUDIT.json b/research/e8-r740-replica32/independent/INDEPENDENT-AUDIT.json new file mode 100644 index 0000000000..219681af3c --- /dev/null +++ b/research/e8-r740-replica32/independent/INDEPENDENT-AUDIT.json @@ -0,0 +1,162 @@ +{ + "assistance": "Prepared with substantial OpenAI Codex assistance; independent checker is a temporary stdlib Fraction port of PR443 code for this audit.", + "audit_sha256": "7b86d1e47231515dcf47a81914e331605b618bba0d7ebbac45f05e6393a85aff", + "candidate_head": "5a514e94f156edcc5fd827b87494d962f79d0f6c", + "candidate_pr": 443, + "claim_kappa": "1138823042306561/1000000000000000000", + "claim_kappa_decimal": "0.001138823042306561", + "composition": { + "binding_component": "bit", + "bit_audit_sha256": "7b86d1e47231515dcf47a81914e331605b618bba0d7ebbac45f05e6393a85aff", + "bit_gain_over_pr433_percent": 1.6039902412440579, + "bit_global_sha256": "cf06064ff620890bd323a7c6e6d6682924e53e3f19da1b42299b46dcb95eced3", + "bit_invoice": { + "charged_prefix_bits": 128, + "charged_two_level_coefficient_bits": 512, + "coefficient_bits": 123, + "live": 56739, + "physical": 56748, + "prefix_bits": 123, + "row_coefficient": 18355, + "two_level_coefficient_bits": 286 + }, + "bit_lower": "1140121438872176364117/1000000000000000000000000", + "bit_lower_decimal": "0.001140121438872176463930", + "bit_upper": "570060719436088182059/500000000000000000000000", + "bootstrap": [ + { + "cutoff_log2": "22819383179442", + "gap": "78501746178067610619094856208662838278841/62500000000000000000000000000000000000000000000" + }, + { + "cutoff_log2": "17555034065622993271", + "gap": "22375380951629203959652651362902421681655757201380612688617389/15625000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "cutoff_log2": "13505151240145377378165760", + "gap": "6377662881471143716344209507129552172336831577153721113626632542174027899268303281/3906250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "cutoff_log2": "10389561725565788443129939538507", + "gap": "1817827545266137688225524559483752241624776357888093915838087025495946802036001691966103082596743366149/976562500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "cutoff_log2": "7992727436362986022554786893424139065", + "gap": "518136039132576303206453526388426934368591268415259608642211320649696294989658962577386018904862953706811416793044433177321/244140625000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + }, + { + "cutoff_log2": "6148834143291130163804015013247240540854073", + "gap": "147684501616840793546145425002172323030658690834542964705950238279201948818317229251758618988616145556248168496043593428564571518656987822353309/61035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ], + "complex_lower": "1183986549206329/1000000000000000000", + "controls": { + "pr433_bit_c": "561061350132569610283/500000000000000000000000", + "pr433_kappa": "560432476129139/500000000000000000" + }, + "gain_over_pr433_percent": 1.6021635801977474, + "kappa": "1138823042306561/1000000000000000000", + "kappa_decimal": "0.001138823042306561", + "minimum_strict_constraint": "69587490165538108013692451508159206453854574997827676969341309165457035294049761720798051181682770748241381011383854443751831503956406571435428481343012177646691/61035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "outer_controls": [ + "next_grid", + "zero_eta", + "zero_beta", + "unit_beta" + ], + "source": "icekylinx PR #433 head 6d9244518175caf9e0089f92486959bc2c317273, research/split-centres-global/CERTIFICATE.json (git blob 7e807079): complex_lower, bit_lower, kappa; the R758 local profile is stated in PROOF.md section 3 (git blob 8366a89e) and asserted in code/bit_global.py there", + "status": "PASS_KERNEL_BIT_SIDE_COMPOSED_WITH_CITED_PR433_COMPLEX", + "strict_outer_constraints": { + "Gaussian_arithmetic_above_kappa": "7286739511970746313871560247904011551239423520464266957401600601982233178207023810161727707452340411395361796380566999281294443332818368254438071231405335473926335389256263495550051/18801459612358627110115236144977563997054298360609695158172809895129169748109343736427656609413410229940506239584005634753005867532673445441209773991824676626084872011481223275294344000000000000000000", + "K_dominates_log": "2676441929443773963989193981213264126660120704016395139813941814934323742066730162310857663008311689106203771324425601562453493583476336025488307393903898109387252457068331151183998564847090588207/2350182451544828388764404518122195499631787295076211894771601236891146218513667967053457076176676278742563279948000704344125733441584180680151221748978084578260609001435152909411793000000000000000000", + "K_geometry": "1763305949140982235505127174372195499631787295076211894771601236891146218513667967053457076176676278742563279948000704344125733441584180680151221748978084578260609001435152909411793/2350182451544828388764404518122195499631787295076211894771601236891146218513667967053457076176676278742563279948000704344125733441584180680151221748978084578260609001435152909411793000000000000000000", + "alpha_below_one": "4695012019230769228424401201544828388764404518122195499631787295076211894771601236891146218513667967053457076176676278742563279948000704344125733441584180680151221748978084578260609001435152909411793/4700364903089656777528809036244390999263574590152423789543202473782292437027335934106914152353352557485126559896001408688251466883168361360302443497956169156521218002870305818823586000000000000000000", + "alpha_below_one_fourth": "1169738341913526645277794424361535139316723575507877657474385439739492567001099286310960604248653548939612156254675222226374679785624433323898900818117053812760308246825355214142919501435152909411793/4700364903089656777528809036244390999263574590152423789543202473782292437027335934106914152353352557485126559896001408688251466883168361360302443497956169156521218002870305818823586000000000000000000", + "alpha_positive": "5352883858887549104407834699562610499170072030228289911415178706080542255734697215767933839684590431669483719325129945688186935167657016176710056371988476369996253892221240562976998564847090588207/4700364903089656777528809036244390999263574590152423789543202473782292437027335934106914152353352557485126559896001408688251466883168361360302443497956169156521218002870305818823586000000000000000000", + "artificial_boundary": "131631628821945939983675561514454997142727600439244147764277841046261993669189553602094691530848285740684421145202073914251736780105389676562055392259349955049132641338784039937136579004305458728235379/18801459612358627110115236144977563997054298360609695158172809895129169748109343736427656609413410229940506239584005634753005867532673445441209773991824676626084872011481223275294344000000000000000000", + "balanced_prefix_above_kappa": "2379706471211861032211697854814373631174794999480665803907450848304745533846920455678626636041965225638522274515071315125240388817592408956899272497036969795653672549554003505326127/2350182451544828388764404518122195499631787295076211894771601236891146218513667967053457076176676278742563279948000704344125733441584180680151221748978084578260609001435152909411793000000000000000000", + "beta_below_one": "999999999999999999/1000000000000000000", + "beta_positive": "1/1000000000000000000", + "bit_positive": "69587490165538108013692451508159206453854574997827676969341309165457035294049761720798051181682770748241381011383854443751831503956406571435428481343012177646691/61035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "bulk_exposure_above_kappa": "79247837256796978536201508159206453854574997827676969341309165457035294049761720798051181682770748241381011383854443751831503956406571435428481343012177646691/61035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "c_below_one": "30482784379917230938433346733161458504786765164009245367969183920415099159322316428305058009703208376346677360675990843526365465259405651158034117263284900482612082981343012177646691/30517578125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "c_positive": "34793745082769061566653266838541495213234835990754632030816079584900840677683571694941990296791623653322639324009156473634534740594348841965882736715099517387917018656987822353309/30517578125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "cell_above_band": "4695012019230769223724036298455171611235595481877804500368212704923788105228398763108853781486332032946542923823323721257436720051999295655874266558415819319848778251021915421739390998564847090588207/9400729806179313555057618072488781998527149180304847579086404947564584874054671868213828304706705114970253119792002817376502933766336722720604886995912338313042436005740611637647172000000000000000000", + "compact_leaf": "1338656931584248028561987397105202784812039009245367969183920415099159322316428305058009703208376346677360675990843526365465259405651158034117263284900482612082981343012177646691/30517578125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "compact_phase_layer_above_kappa": "14762009833516321723646668346089065771503852202226954567924805706799657666626244312584779932644473447979497283535305390557327688004114138374025374029442608696531774059425297957167/1175091225772414194382202259061097749815893647538105947385800618445573109256833983526728538088338139371281639974000352172062866720792090340075610874489042289130304500717576454705896500000000000000000", + "compact_reservations": "1/4000000000000000000", + "complex_above_bit": "2677313863168495990213798491840793546145425002172323030658690834542964705950238279201948818317229251758618988616145556248168496043593428564571518656987822353309/61035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "complex_below_one_over32": "30066013450793671/1000000000000000000", + "coordinate_movement_above_kappa": "79247837256796978536201508159206453854574997827676969341309165457035294049761720798051181682770748241381011383854443751831503956406571435428481343012177646691/61035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "delta_below_one_eighth": "999999999999999999/8000000000000000000", + "delta_positive": "1/8000000000000000000", + "dimension_above_kappa": "2344829567685940839689520703089665532579910559738161736403193762589519585393782881251288457670244176936063356093964521294396541073487134445089167068614324378638663495601816886241879549554003505326127/2350182451544828388764404518122195499631787295076211894771601236891146218513667967053457076176676278742563279948000704344125733441584180680151221748978084578260609001435152909411793000000000000000000", + "epsilon_below_one": "2676441929443775727295143122195499631787295076211894771601236891146218513667967053457076176676278742563279948000704344125733441584180680151221748978084578260609001435152909411793/2350182451544828388764404518122195499631787295076211894771601236891146218513667967053457076176676278742563279948000704344125733441584180680151221748978084578260609001435152909411793", + "epsilon_positive": "2347506009615384613037109375000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000/2350182451544828388764404518122195499631787295076211894771601236891146218513667967053457076176676278742563279948000704344125733441584180680151221748978084578260609001435152909411793", + "gamma_sublinear": "1/2000000000000000000", + "guard_width": "2676441929443775727295143122195499631787295076211894771601236891146218513667967053457076176676278742563279948000704344125733441584180680151221748978084578260609001435152909411793/2350182451544828388764404518122195499631787295076211894771601236891146218513667967053457076176676278742563279948000704344125733441584180680151221748978084578260609001435152909411793", + "lambda_above_internal": "69587490165538108013692451508159206453854574997827676969341309165457035294049761720798051181682770748241381011383854443751831503956406571435428481343012177646691/61035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_above_sigma": "2677313863168496059801288657378901559837876510331529484513265832370641675291547444658984112366990972556670170298916304489549507427447872316403022613394393788737481343012177646691/61035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_above_tau": "69587490165538108013692451508159206453854574997827676969341309165457035294049761720798051181682770748241381011383854443751831503956406571435428481343012177646691/61035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_prime_above_lambda": "69587490165538108013692451508159206453854574997827676969341309165457035294049761720798051181682770748241381011383854443751831503956406571435428481343012177646691/61035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "lambda_prime_below_one": "34793745082769053937258735588541495213234835990754632030816079584900840677683571694941990296791623653322639324009156473634534740594348841965882736715099517387917018656987822353309/30517578125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "leaf_saving_above_bit": "2677313863168495917948994463134189542239175002172323030658690834542964705950238279201948818317229251758618988616145556248168496043593428564571518656987822353309/61035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "literal_scalar_guard": "1", + "phase_boundary": "4282307087110038813489777450684410646455153999743532002774683949622054850267510394385103369014078934644171740124848208037893558533984744116221356780754645065752653318160076798259798564847090588207/3760291922471725422023047228995512799410859672121939031634561979025833949621868747285531321882682045988101247916801126950601173506534689088241954798364935325216974402296244655058868800000000000000000", + "phase_local": "21411535435550203468178693432735608289893842487499658541022600052957853337742499536510390899742262887049163407329356010442587584672741097084040550240495945933650262503138697033734998564847090588207/18801459612358627110115236144977563997054298360609695158172809895129169748109343736427656609413410229940506239584005634753005867532673445441209773991824676626084872011481223275294344000000000000000000", + "prime_interval_packing": "2676441929443775727295143122195499631787295076211894771601236891146218513667967053457076176676278742563279948000704344125733441584180680151221748978084578260609001435152909411793/2350182451544828388764404518122195499631787295076211894771601236891146218513667967053457076176676278742563279948000704344125733441584180680151221748978084578260609001435152909411793", + "q_below_internal": "69587490165538108013692451508159206453854574997827676969341309165457035294049761720798051181682770748241381011383854443751831503956406571435428481343012177646691/30517578125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_below_leaf": "1338656931584248028561987397105202784812039009245367969183920415099159322316428305058009703208376346677360675990843526365465259405651158034117263284900482612082981343012177646691/30517578125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "q_below_reservations": "1/4000000000000000000", + "q_positive": "34793745082769053937258735588541495213234835990754632030816079584900840677683571694941990296791623653322639324009156473634534740594348841965882736715099517387917018656987822353309/30517578125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "record_suffix": "2676441929443775727295143122195499631787295076211894771601236891146218513667967053457076176676278742563279948000704344125733441584180680151221748978084578260609001435152909411793/2350182451544828388764404518122195499631787295076211894771601236891146218513667967053457076176676278742563279948000704344125733441584180680151221748978084578260609001435152909411793", + "row_product_gap": "23971789/25", + "scalar_work_above_kappa": "16687469318150059868929178320392793549766572700769114536488005549546818052261695678375556012159045526365614916172569816657797377099155090975042958227317673786968771394996875133197223/18801459612358627110115236144977563997054298360609695158172809895129169748109343736427656609413410229940506239584005634753005867532673445441209773991824676626084872011481223275294344000000000000000000", + "short_record_fallback": "143116852796454906273995186311790208383599367957544019568801567217852566040033799284503977899441135470309973641456700198353884559385131800205694303454723505559015060008734545653756027990849180386475801226363885773075321108704904561604614484415666758486851569071820299038419056909418901587405436052245544489756394117632289950991243623456217173037/143443753146046654587671174201794158913072955021741448655493239556344373688578367129727604747111589278720903317138714864753767910252940715341261093077275670059851623622751032068590881347656250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "small_field_exposure": "1/1000000000000000000" + } + }, + "fraction_audit": { + "entrance_rank_total": 138, + "exact_bank_families": 26019, + "mutations_rejected": 14, + "nested_pairs": 3364, + "profile": { + "1": 728640, + "14": 15360, + "2": 290304, + "28": 15360, + "3": 80640, + "4": 99936, + "42": 15360, + "5": 33984, + "7": 27072, + "8": 2592 + }, + "projector_arithmetic": "Python stdlib fractions.Fraction; exact Gauss-Jordan inversion; no floating point", + "receipt_sha256": "7832d6e4c8a1649483e02cac909bd15684ebc6aa03cfc938187c977ff7a4da1b", + "reflected_pairs": 3364, + "residual_isometries": 16, + "source_frames": 944 + }, + "global_replay": { + "bank_assignments": 213120, + "banks_per_stage": 2891, + "deficit": 9984, + "emitted_events": 5681952, + "emitted_program_sha256": "4f83de501c4175bd9c4f3b107d7c24ff5980abfa551b8674a0c0149fdef74e46", + "global_prefix_bits": 123, + "local_invocations": 288, + "status": "PASS_SOURCE_BOUND_NINE_STAGE_BIT_TEMPLATE", + "unbanked_scalar_columns": 7620 + }, + "global_sha256": "cf06064ff620890bd323a7c6e6d6682924e53e3f19da1b42299b46dcb95eced3", + "limitations": [ + "PR #433 complex supplier and all-size analytic interfaces remain cited conditional dependencies; this receipt does not claim an unconditional theorem.", + "PR #444 idle-data hosting is not included; its operator/dirty-restoration lemma remains unverified." + ], + "status": "PASS_INDEPENDENT_PR443_FRACTION_AUDIT_AND_COMPOSITION", + "template_sha256": "2448a938786ecc1dbed9e31258eee3269b8174af8e6f9eea8ab6c8165773456a", + "verified_utc": "2026-10-11T14:08:56.401283+00:00", + "word_sha256": "64d7d1e0c6ea7a3a8e91254c0dfd51b71637b49703ef4c1fce184fded5040bc9" +} From ee1eb7bcffc271a8b6b7c5dc5c65e55bfe1159ab Mon Sep 17 00:00:00 2001 From: eumemic <94939491+eumemic@users.noreply.github.com> Date: Sun, 11 Oct 2026 07:13:54 -0700 Subject: [PATCH 2/3] Add independent exact audit receipt for R740 rank138 candidate --- .../independent/INDEPENDENT-AUDIT.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 research/e8-r740-replica32/independent/INDEPENDENT-AUDIT.md diff --git a/research/e8-r740-replica32/independent/INDEPENDENT-AUDIT.md b/research/e8-r740-replica32/independent/INDEPENDENT-AUDIT.md new file mode 100644 index 0000000000..c8605e9874 --- /dev/null +++ b/research/e8-r740-replica32/independent/INDEPENDENT-AUDIT.md @@ -0,0 +1,11 @@ +# Independent verification receipt for the R740/rank138 replica32 candidate + +κ = 0.001138823042306561 = 1138823042306561/10^18. + +This receipt is a fresh verification of PR #443 (`5a514e94f156edcc5fd827b87494d962f79d0f6c`) on top of its frozen candidate package. The local projector and residual-route audit was rerun with Python's standard-library `fractions.Fraction`: every 8x8 frame projector was formed by exact rational Gauss-Jordan inversion, with no floating-point arithmetic and no SymPy dependency. It checked 944 source frames, 3,364 nested forward pairs, the 3,364 reflected pairs, all 16 residual isometries, entrance rank 138, 26,019 exact bank families, the complete profile, and all fourteen mutation controls. + +A clean source-bound rerun of `global_kernel.py` reproduced the template and emitted-program digest, all 288 local calls, 213,120 helper assignments, 2,891 banks per stage, 7,620 restored unbanked scalar columns, 123 prefix bits, and deficit 9,984. The unchanged `compose_kernel.py` then passed the two exact rational moment engines, finite invoice, six bootstrap levels, all 47 strict outer inequalities, and rejection of the adjacent 10^-18 grid point plus zero/unit parameter controls. The composed result is bit-bound with the cited PR #433 complex endpoint and has the exact κ above. + +This is a finite conditional construction. The PR #433 complex supplier and its analytic/all-size interfaces remain cited dependencies. PR #444's later idle-data hosting extension is deliberately excluded here because its hosted operator and dirty-restoration lemma still require an explicit scalar replay. + +Prepared with substantial OpenAI Codex assistance. Earlier source licenses, notices, provenance, and disclosures remain in the unchanged candidate package. From 9a0c3ceaacf8409f29e62cb013914a9b85863344 Mon Sep 17 00:00:00 2001 From: eumemic <94939491+eumemic@users.noreply.github.com> Date: Sun, 11 Oct 2026 07:14:14 -0700 Subject: [PATCH 3/3] Add independent exact audit receipt for R740 rank138 candidate --- .../independent/audit_fraction.py | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 research/e8-r740-replica32/independent/audit_fraction.py diff --git a/research/e8-r740-replica32/independent/audit_fraction.py b/research/e8-r740-replica32/independent/audit_fraction.py new file mode 100644 index 0000000000..11b1e46f10 --- /dev/null +++ b/research/e8-r740-replica32/independent/audit_fraction.py @@ -0,0 +1,105 @@ +import argparse, copy, gzip, hashlib, json, struct, time, sys +from collections import Counter, defaultdict +from pathlib import Path +from fractions import Fraction +import sys +# Resolve the candidate package's code directory from --code. + +from bank_routes import validate_isometries +from config import REPLICAS + +def sha(p): return hashlib.sha256(p.read_bytes()).hexdigest() +def mat(rows): return [[Fraction(x) for x in row] for row in rows] +def eye(n): return [[Fraction(int(i==j)) for j in range(n)] for i in range(n)] +def zeros(r,c): return [[Fraction(0) for j in range(c)] for i in range(r)] +def transpose(A): return [list(x) for x in zip(*A)] if A else [] +def mm(A,B): + if not A or not B: return [] + return [[sum((A[i][k]*B[k][j] for k in range(len(B))),Fraction(0)) for j in range(len(B[0]))] for i in range(len(A))] +def inv(A): + n=len(A); X=[row[:] + eye(n)[i] for i,row in enumerate(A)] + for c in range(n): + piv=next((r for r in range(c,n) if X[r][c]),None) + assert piv is not None + X[c],X[piv]=X[piv],X[c] + q=X[c][c]; X[c]=[v/q for v in X[c]] + for r in range(n): + if r!=c and X[r][c]: + q=X[r][c]; X[r]=[a-q*b for a,b in zip(X[r],X[c])] + return [row[n:] for row in X] +def eq(A,B): return len(A)==len(B) and all(len(a)==len(b) and all(x==y for x,y in zip(a,b)) for a,b in zip(A,B)) +def tr(A): return sum((A[i][i] for i in range(min(len(A),len(A[0]) if A else 0))),Fraction(0)) + +def main(): + ap=argparse.ArgumentParser(); ap.add_argument('--code',type=Path,required=True); ap.add_argument('--local-check',type=Path,required=True); ap.add_argument('--out',type=Path,required=True); ap.add_argument('--word',type=Path,required=True) + a=ap.parse_args(); sys.path.insert(0,str(a.code.resolve())); start=time.monotonic(); out=a.out + blob=gzip.decompress((out/'GLOBAL-TEMPLATE.json.gz').read_bytes()); t=json.loads(blob) + g=json.loads((out/'GLOBAL.json').read_text()); geo=json.loads((out/'GEOMETRY.json').read_text()) + assert hashlib.sha256(blob).hexdigest()==g['template_sha256']; assert t['geometry_sha256']==sha(out/'GEOMETRY.json') and t['source_record_sha256']==sha(a.local_check/'records/249-records.bin') + fs=json.loads((a.local_check/'records/frames.json').read_text())['frames']; records=list(struct.iter_unpack('<6i',(a.local_check/'records/249-records.bin').read_bytes())); T=REPLICAS; assert T==32 and T%8==0 and g['replicas']==T + V,R=g['v'],g['R']; LOCAL=2*V+R; DATA=2*4*V*T; LIVE=g['live']; assert V==120 and DATA==30720 and g['live']==LIVE + I=eye(8); proj={}; dimensions={} + for key,f in fs.items(): + k=int(key); B=mat(f['B']) if f['B'] else zeros(0,8) + P=mm(mm(transpose(B),inv(mm(B,transpose(B)))) , B) if B else zeros(8,8) + assert eq(transpose(P),P) and eq(mm(P,P),P) and tr(P)==f['dim']; proj[k]=P; dimensions[k]=f['dim'] + pairs={} + for op,x,y,c,r,z in records: + if op==0: + key=(y,c) + if key not in pairs: + D=[[proj[c][i][j]-proj[y][i][j] for j in range(8)] for i in range(8)] + assert eq(mm(proj[c],proj[y]),proj[y]) and eq(mm(proj[y],proj[c]),proj[y]); assert eq(mm(D,D),D) and tr(D)==r; assert eq([[I[i][j]-proj[y][i][j] - (I[i][j]-proj[c][i][j]) for j in range(8)] for i in range(8)],D); pairs[key]=r + assert len(proj)==len(fs) + expected={} + for rev in (False,True): + es=[] + for op,x,y,c,f,z in (reversed(records) if rev else records): + if op==0: es.append([0,x,c if rev else y,y if rev else c,f,int(rev)]) + elif op==1: es.append([1,x,y,-c if rev else c,f,int(rev)]) + elif op==(3 if rev else 2): es.append([2,x,y,c,f,abs(dimensions[c]-dimensions[f]),int(rev)]) + else: es.append([3,x,y,c,f,z,int(rev)]) + expected['reverse' if rev else 'forward']=es + assert t['local_programs']==expected + word=json.loads(gzip.decompress(a.word.read_bytes())); assert sha(a.word)==g['word_sha256']; state=json.loads((a.local_check/'records/249-states.json').read_text()); initial=[state['initial'][str(i)] for i in range(LOCAL)]; assert initial==word['start']; widths=[8-dimensions[f] for f in initial[2*V:]]; ENT=sum(8-x for x in widths); assert T*(8*R-ENT)%64==0; NB=T*(8*R-ENT)//64; assert LIVE==DATA+9*NB and g['banks_per_stage']==NB + def validate(q,check_profile=True): + assert validate_isometries(q['residual_isometries'],word['frames'],word['lines'],dimensions)==set(initial[2*V:]); assert (q['m'],q['live'],q['replicas'],q['stages'])==(64,LIVE,T,9); assert q['bank_padding'] is None and q['local_programs']==expected + hist=Counter(); occupation=defaultdict(set); calls=set() + for c in q['calls']: + st,rep,p=c['stage'],c['replica'],c['pair']; rev=c['orientation']=='reverse'; assert 0<=st<9 and 0<=rep