ELYRION-III / tools /export_data.py
PureOne's picture
Release ELYRION III research package
d980d12 verified
Raw History Blame Contribute Delete
10 kB
#!/usr/bin/env python3
"""Deterministically export synthetic tables and editorial claims; --check never writes."""
from __future__ import annotations
import argparse
import csv
import io
import json
from pathlib import Path
import sys
CLAIM_FIELDS = ("claim_id", "title", "statement", "status", "assumptions", "evidence", "limitation")
CLAIMS = [
("C01", "Four-state serial multiplication",
"Serial first-order marks and selective filters yield S(x)=product_j[1-exp(-u_j*g_j(x))].",
"Conditional analytic result",
"Immobile tracked units; exact state-selective ideal filters; protected committed state; prescribed first-order response.",
"Manuscript Section 3; code/model.py; exact rational and finite main checks.",
"No molecule implementing the complete transition interface is identified."),
("C02", "Positive repeated commitment",
"A pass updates c to c+(1-c)*b*S; repeated passes give c_final=1-product_s(1-b_s*S_s).",
"Conditional analytic result",
"Uniform partial commitment; uncommitted material reinitialized between passes; irreversible protected C.",
"Manuscript serial multiplication theorem; main and separate rational transition-matrix checks.",
"Conservation is of tracked occupancy, not a complete reagent stoichiometry or energy balance."),
("C03", "Exact periodic nodes and Fourier symmetry",
"Balanced root-phase gates produce exact dark nodes and period 2*pi/m, with Fourier support restricted to multiples of m.",
"Ideal-model analytic result",
"Equal action at m equally spaced full-contrast phases; immobile material; ideal selective filters.",
"Manuscript exact nodes, symmetry and weak-response theorem; finite symmetry and Fourier checks.",
"Finite saturation allows higher multiples 2m,3m,...; molecular retention pitch is not demonstrated solid-feature resolution."),
("C04", "Filter-free negative control",
"Without intermediate filters the same balanced first-order marking exposures accumulate to uniform response 1-exp(-m*u).",
"Analytic negative control",
"Ordinary accumulating first-order marking; equal actions; root-phase fringes of a common fundamental.",
"Manuscript no-filter comparison; main implementation negative-control checks.",
"This comparison does not rule out other nonlinear chemistry or other control architectures."),
("C05", "Global exact-node marking frontier",
"Among all finite admissible exact-node serial programs, maximum minimum-midpoint commitment at cost U is G_m(U/m), attained by one balanced pass.",
"Conditional analytic optimization theorem",
"Same fundamental frequency; nonnegative first-harmonic gates; ideal filters; exact prescribed nodes; uniform positive commits; no diffusion.",
"Manuscript Section 5 mandatory-root, pass-merging and strict-concavity proof; finite allocation and merge checks.",
"Not a universal lithography bound; excludes spatially patterned commits, relaxed dark nodes, feedback and destructive correction."),
("C06", "Sharp cubic asymptotic",
"At fixed midpoint fraction q, U_m(q)/m^3 tends to c_q defined by product_r[1-exp(-pi^2*c_q*(2r+1)^2/2)]^2=q.",
"Conditional analytic asymptotic with numerical examples",
"Same exact-node serial class as C05; q strictly between zero and one; m tends to infinity.",
"Manuscript Section 6; original dose_table and cubic_constants; separate 70-digit dose and limit calculations.",
"Marking action is dimensionless and omits reset/commit resources; high precision is not an interval certificate."),
("C07", "Three-dimensional conversion-field approximation",
"Every continuous f:T^3->[0,1] has a finite four-state program approximating its conversion fraction uniformly to arbitrary positive tolerance.",
"Conditional existence theorem",
"Immobile selective-control contract; independent coordinate fringes; finite positive repeated passes; finite-rate approximation within remaining error margin.",
"Manuscript Section 7 positive-kernel, weak-gate and hazard construction; synthetic three-term hazard example.",
"No generic efficiency guarantee, arbitrary material synthesis, atom placement, solidification proof or actual volume optical-access guarantee."),
("C08", "Finite-rate selective-filter boundary",
"Ideal filters are singular; finite bounded-action first-order maps are invertible. Approximate selective filters obey error <=exp(-h1)+exp(-h2), accumulated by summation.",
"Conditional analytic obstruction and approximation bound",
"Bounded-action first-order transition maps; exact state selectivity for the approximation; stated stochastic-map norm.",
"Manuscript finite-action selective-control section; main finite-filter and stochastic-map checks.",
"Cross-talk or reverse-reaction floors may prevent the required accuracy; exact ideal nodes are not produced by finite bounded actions."),
("C09", "Extinction and phase budgets",
"The protecting-factor bound gives sufficient fixed-darkness scales eta=O(m^-2) and phase error=O(m^-1) at fixed q.",
"Conditional sufficient bounds",
"Balanced comb; declared fringe-floor and phase perturbation model; other error sources budgeted separately.",
"Manuscript phase/extinction section; original m8_dark01_budget and main checks.",
"Separate maximal floor and phase allowances cannot both be spent in full; not necessary optimal tolerances."),
("C10", "Retention ceiling scope",
"Independent per-gate retention r gives single-pass midpoint r^m*G_m(u); finite-action target q is feasible in that pass iff r^m>q.",
"Conditional single-pass result with multipass counterexample",
"Independent uniform retention; no false rescue; otherwise ideal full-commit m-gate pass.",
"Manuscript retention proposition and explicit two-pass counterexample; main checks.",
"The single-pass ceiling does not apply to arbitrary reinitialized repeated passes and is not a generic imperfect-filter model."),
("C11", "Diffusion-aware sufficient design parameter",
"Finite-duration reaction-diffusion gates admit dark-node and brightness bounds; D*k^2*m^5/(sigma*P) is a sufficient design parameter for this implementation.",
"Conditional analytic sufficient bounds and synthetic simulations",
"Common diffusivity for mobile states; finite first-order marking; ideal filters; fixed marking irradiance and stated Brownian-path model.",
"Manuscript diffusion section; 16 original refined finite-difference cases in diffusion_examples.",
"Not a universal necessary resolution ceiling; diffusion can fill dark nodes and change order dependence; grid refinement is not a continuum error certificate."),
("C12", "Evidence and priority boundary",
"The supplied release records 1305 main checks and 108 separate code-path audit checks; physical experiments, external review and formal proof-assistant replay are absent.",
"Release provenance and validation statement",
"Counts refer to logged finite checks in supplied ledgers; both implementations were produced within the same research session.",
"Original results/verification.json, results/independent_audit.json and source/provenance.json; packaging rerun report.",
"Check counts do not certify historical novelty, scientific importance, physical feasibility or external mathematical acceptance.")
]
def csv_bytes(rows, fields):
buffer = io.StringIO(newline="")
writer = csv.DictWriter(buffer, fieldnames=fields, lineterminator="\n")
writer.writeheader()
writer.writerows(rows)
return buffer.getvalue().encode("utf-8")
def exports(root: Path):
ledger = json.loads((root / "results/verification.json").read_text(encoding="utf-8"))
output = {
"dose_frontier.csv": csv_bytes(ledger["dose_table"], ["m", "q", "action", "total_action", "ratio"]),
"cubic_constants.csv": csv_bytes(
[{"q": float(q), "c_q": value} for q, value in sorted(ledger["cubic_constants"].items(), key=lambda item: float(item[0]))],
["q", "c_q"]),
"diffusion.csv": csv_bytes(ledger["diffusion_examples"], ["m", "diffusion", "action", "time", "max_dark", "min_bright", "max_dark_bound", "grid_error", "n"]),
"hazard_compiler.csv": csv_bytes(ledger["hazard_examples"], ["error", "hazard_error", "bound", "grid_bound", "passes", "factor_gates", "primitive_ideal_maps", "mark_action", "action"]),
}
claims = [dict(zip(CLAIM_FIELDS, row, strict=True)) for row in CLAIMS]
output["claims.jsonl"] = ("\n".join(json.dumps(row, ensure_ascii=False, separators=(",", ":")) for row in claims) + "\n").encode("utf-8")
return output
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--check", action="store_true", help="Compare exact generated bytes without writing any files")
parser.add_argument("--root", type=Path, default=Path(__file__).resolve().parents[1])
args = parser.parse_args()
try:
generated = exports(args.root)
errors = []
for name, content in generated.items():
path = args.root / "data" / name
if args.check:
if not path.is_file() or path.read_bytes() != content:
errors.append(name)
else:
path.parent.mkdir(parents=True, exist_ok=True)
path.write_bytes(content)
if errors:
print("Export check failed: " + ", ".join(errors), file=sys.stderr)
return 1
print(("Export check passed" if args.check else "Exported data") + f": {len(generated)} files; 36 dose, 4 constants, 16 diffusion, 4 hazard and 12 claim records.")
except (OSError, ValueError, KeyError, TypeError) as exc:
print("Data export failed: " + str(exc), file=sys.stderr)
return 1
return 0
if __name__ == "__main__":
raise SystemExit(main())