Datasets:
Tasks:
Other
Formats:
json
Languages:
English
Size:
1K - 10K
Tags:
photonic-computing
recursive-self-improvement
statistical-experiments
blackwell-order
information-preservation
gaussian-readout
Download scripts/build_verification_dataset.py from PureOne/Evies-Pure-Form-RSI: direct link, hf CLI and curl.
- Browser
- Download file 3.16 kB
-
https://huggingface.co/datasets/PureOne/Evies-Pure-Form-RSI/resolve/main/scripts/build_verification_dataset.py
- Command line
-
hf download hf://datasets/PureOne/Evies-Pure-Form-RSI/scripts/build_verification_dataset.py
-
curl -L -o build_verification_dataset.py https://huggingface.co/datasets/PureOne/Evies-Pure-Form-RSI/resolve/main/scripts/build_verification_dataset.py
3.16 kB
| """Normalize the 1,247 saved channel checks; perform no new experiments.""" | |
| from pathlib import Path | |
| import json | |
| import math | |
| ROOT = Path(__file__).resolve().parents[1] | |
| EXPECTED = {"deficiency": 556, "purification": 375, "orbit_audit": 96, "catalogue": 220} | |
| TOLERANCE = 1e-9 | |
| def build(root=ROOT): | |
| rows=[] | |
| keys_to_remove={"formula", "analytic_deficiency", "unrestricted_lp", "unrestricted_lp_deficiency", | |
| "full_unrestricted_lp", "constructed_kernel_tv", "absolute_error"} | |
| for family,expected in EXPECTED.items(): | |
| report_path=f"research/data/{family}.json" | |
| report=json.loads((root/report_path).read_text(encoding="utf-8")) | |
| records=report["records"] | |
| assert len(records)==expected,(family,len(records),expected) | |
| for index,record in enumerate(records): | |
| analytic=float(record.get("formula",record.get("analytic_deficiency"))) | |
| lp=float(record.get("unrestricted_lp",record.get("unrestricted_lp_deficiency", | |
| record.get("full_unrestricted_lp")))) | |
| kernel=record.get("constructed_kernel_tv") | |
| if kernel is not None:kernel=float(kernel) | |
| error=abs(analytic-lp) | |
| assert all(math.isfinite(x) for x in (analytic,lp,error)) | |
| assert error<=TOLERANCE,(family,index,error) | |
| if kernel is not None:assert abs(analytic-kernel)<=TOLERANCE | |
| rows.append({ | |
| "case_id":f"{family}:{index:04d}","family":family, | |
| "category":str(record.get("category","arbitrary_posterior_orbit" if family=="orbit_audit" | |
| else "repeated_evidence")), | |
| "q":int(record["q"]),"analytic_deficiency":analytic, | |
| "unrestricted_lp_deficiency":lp,"absolute_error":error, | |
| "constructed_kernel_tv":kernel,"comparison_tolerance":TOLERANCE, | |
| "passed":True,"source_report":report_path,"source_record_index":index, | |
| "parameters_json":json.dumps({k:v for k,v in record.items() if k not in keys_to_remove}, | |
| sort_keys=True,separators=(",",":"),allow_nan=False) | |
| }) | |
| assert len(rows)==1247 and len({r["case_id"] for r in rows})==1247 | |
| output=root/"verification/channel_comparisons.jsonl";output.parent.mkdir(exist_ok=True) | |
| output.write_text("".join(json.dumps(row,separators=(",",":"),allow_nan=False)+"\n" for row in rows), | |
| encoding="utf-8") | |
| summary={"scientific_version":"3.0","packaging_version":"HF1","records":len(rows), | |
| "family_counts":EXPECTED,"comparison_tolerance":TOLERANCE, | |
| "maximum_formula_lp_error":max(r["absolute_error"] for r in rows), | |
| "all_exported_rows_pass":True,"new_experiments_performed":False, | |
| "scope":"Saved synthetic mathematical verification records; not training samples or hardware data."} | |
| (root/"verification/summary.json").write_text(json.dumps(summary,indent=2)+"\n",encoding="utf-8") | |
| return summary | |
| if __name__=="__main__":print(json.dumps(build(),indent=2)) | |