Source identity
| Field | Recorded value |
|---|---|
| Source type | archive member |
| Original record | verify_recomputed.py |
| Date | Not specified in source |
| Path or archive member | archives/libsrc-5feba6626817/Supplementary_Material_S1/code/verify_recomputed.py |
| Original SHA-256 | df2c7565a6964e76a20c4a34b4519400174b0409bbdd24d6c4272dd3cb956f74 |
| Reading-copy SHA-256 | df2c7565a6964e76a20c4a34b4519400174b0409bbdd24d6c4272dd3cb956f74 |
| Archive source | {"sourceId": "libsrc-5feba6626817", "member": "Supplementary_Material_S1/code/verify_recomputed.py"} |
Every recorded occurrence
These 2 records contain identical original source bytes. Their paths and revisions remain part of the archive.
| Original record | Branch or archive | Revision / identifier | Original location |
|---|---|---|---|
| verify_recomputed.py | {"sourceId": "libsrc-5feba6626817", "member": "Supplementary_Material_S1/code/verify_recomputed.py"} | libsrc-28b7dcb963ee | archives/libsrc-5feba6626817/Supplementary_Material_S1/code/verify_recomputed.py |
| verify_recomputed.py | {"sourceId": "libsrc-6c9313f7cdd5", "member": "Declaration_Study_v1/code/verify_recomputed.py"} | libsrc-a82ae8f6b739 | archives/libsrc-6c9313f7cdd5/Declaration_Study_v1/code/verify_recomputed.py |
Recovered source transcript
Download complete source text ↓27 lines · 2.0 KB
"""Validate a source-connected rerun; no model inference or training involved."""
from pathlib import Path
import hashlib,json,sys
import numpy as np
import pandas as pd
ROOT=Path(__file__).resolve().parents[1]
out=Path(sys.argv[1] if len(sys.argv)>1 else 'recomputed');raw=Path(sys.argv[2] if len(sys.argv)>2 else 'raw_sources')
v=json.loads((ROOT/'provenance/source_verification.json').read_text())
m=raw/'download_manifest.json'
assert hashlib.sha256(m.read_bytes()).hexdigest()==v['complete_pass_manifest_sha256'],'Source acquisition manifest does not match the recorded source identities.'
for name in ['gradient.npy','eval.npy']:
np.testing.assert_array_equal(np.load(out/name,allow_pickle=False),np.load(ROOT/'data'/name,allow_pickle=False))
g=np.load(out/'geometry.npy',allow_pickle=False);assert g.shape==(167,16)
s=pd.read_csv(ROOT/'data/selected_checkpoint_metrics.csv',float_precision='round_trip')
for row in s.itertuples(index=False):
z=g[g[:,0]==row[0]][0];np.testing.assert_allclose([z[3],z[8]],[row[1],row[2]],rtol=1e-10,atol=1e-12,equal_nan=True)
p=np.load(out/'pca.npy',allow_pickle=False);ref=np.load(ROOT/'data/pca.npy',allow_pickle=False)
np.testing.assert_array_equal(p[:,0],ref[:,0]);np.testing.assert_allclose(p[:,1:],ref[:,1:],rtol=1e-8,atol=1e-10)
a=json.loads((out/'analysis_summary.json').read_text());assert a['zero_effective_update_steps']==[1];assert a['effective_norm_monotone'];assert a['max_stable_vs_gram_corner_error']<1e-6
sensitivity=pd.read_csv(ROOT/'data/corner_sensitivity.csv')
for x,y in zip(a['amplitude_sensitivity'],sensitivity.itertuples(index=False)):
assert x['lag']==y.lag and x['threshold']==y.amplitude_threshold
assert x['eligible']==y.eligible_centers
assert x['B_peak_step']==x['effective_peak_step']==y.peak_step_B_and_effective
np.testing.assert_allclose([x['B_peak'],x['effective_peak']],[y.B_peak_cosine,y.effective_peak_cosine],atol=1e-6,rtol=0)
print('PASS: original file identities, exact log values, selected geometric metrics, PCA scores, 18 sensitivity settings, and stable-form validation.')