ProCreations's picture
Publish validated ICML reproduction
d3206a6 verified
Raw
History Blame Contribute Delete
4.61 kB
#!/usr/bin/env python3
import hashlib,json,os,subprocess,sys,tempfile
from pathlib import Path
r=Path(__file__).resolve().parent;c=json.loads((r/'official_claims.json').read_text());d=json.loads((r/'outputs/results.json').read_text());m=json.loads((r/'EVIDENCE_MATRIX.json').read_text());a=json.loads((r/'final_assessment.json').read_text())
assert c==['Theorem 1 (informal) shows the adaptive sensing algorithm reaches constant-level alignment with the true eigenvector after O(λ₁λ₂d²/Δ²) iterations, after which the sine-squared alignment error decays as O(λ₁λ₂d²/(Δ²t)) (Theorem 1).', 'Theorem 2 (formal) specifies a warmup phase of t₀ = (4S+1)log(d/2) iterations after which the expected squared sine alignment satisfies E[1-(ūᵀu_{t₀})²] ≤ 0.5, followed by a distinct local convergence phase (Theorem 2).', "The paper's rate matches the minimax lower bound Ω(λ₁λ₂/Δ² · d/t) from Li et al. (2018) up to an extra factor of d, which is attributed to the cost of compressive (two-measurement) sampling (Section 3, Theorem 2).", "Section 5.1 ('Tracking a Moving Eigenvector') derives a closed-form optimal step size η̂ = √(V/S) and fixed point x* = V + √(VS) for the non-stationary tracking setting (Section 5.1).", 'Figure 1 empirically validates the theoretical convergence rate of Algorithm 1 using d=10, Δ=1 across 20 trials, reporting 20th/80th percentile error bars (Figure 1).'] and d['paper_id']=='XXYhEGXPPF' and len(c)==5
assert d['summary']=={'all_passed':True,'passed':11,'total':11} and all(g['passed'] for g in d['gates'])
assert m['release_quality_gate']['status']=='pass_all_5_direct' and m['release_quality_gate']['expected_verified_points']==10
assert [row['assessment'] for row in m['claims']]==['verified','verified','verified','verified','falsified_as_literally_registered']
assert a['conservative_points']==10 and a['runs_byte_identical'] and a['all_scientific_gates_pass']
names={p.name for p in (r/'outputs').iterdir() if p.is_file()}
for folder in ('replay_a','replay_b','packaged_replay'):
assert names=={p.name for p in (r/folder).iterdir() if p.is_file()}
assert all((r/'outputs'/name).read_bytes()==(r/folder/name).read_bytes() for name in names)
for name,digest in {'source/2505.10882v2.pdf': '53307476d73caf5ab36cb8fde3afd00c647c4cf8a2552fcc678085270d027b22', 'source/2505.10882v2.tar': '1cf6d98fd4e26fd831378ff7e055025e11e06f2bf0808ddf98da40af5b48dfe8', 'source/main_icml.tex': 'dab1cdf6474ddc3a159face078cdaf8cdc6006c6bbc0797012a2c7720b7e432d', 'source/sections/problem_setup.tex': '0068d8f15b9c8b500a397b802db38de2fee75b5bad5b0210765234da2855af62', 'source/sections/main_results.tex': 'f1fe0bb6ef0298933dd8d50c2f1c7eef4fe403db06759575a571629c3e6d56e9', 'source/sections/experiments.tex': '07f806b8b9931fe7a66738c6fb574bb1c0256a5b6febc10880f6be417ac217cd', 'source/appendices/supporting_lemmas.tex': 'd3336dccfed8c210329831610e1f7c74b100e573d04976024c68539eaae2a3ba', 'outputs/algorithm_oracle.json': 'e4c874a2ac7e3c924d0aee02d160718420c68c61f396ea1bbbd0254b6c760ef5', 'outputs/convergence.csv': '3fd1d2dd55c0fdc9a3eacba12b2e8af7a322ed74c0981bdda271c67c714e714f', 'outputs/mechanism_separation.csv': 'f7666724c3e2b3be2571c80f5e6cc815b4937251ca49e04f38486ebcdf05c526', 'outputs/results.json': 'a30359be17194cbce0355e497fd9f459d5534b961ceefbd5b319ec01b220b154', 'outputs/source_falsification.json': '25693538e19b35ba5643ffda47dac3b91e4b389dd98e75932c88f7deace3eaee', 'outputs/tracking.csv': '0c9d275dec356de4bc49704d59d1ba5684d336afb70fc2372f3d71edec232f89', 'outputs/warmup.csv': '4c09892825fb86eb547b973a789fde0b98da7a6872f0d2d2118c46902f709098'}.items():assert hashlib.sha256((r/name).read_bytes()).hexdigest()==digest,name
text='\n'.join(p.read_text(errors='ignore') for p in r.rglob('*') if p.is_file() and p.suffix in {'.md','.json','.html','.txt','.tex'})
assert all(claim in text for claim in c) and 'paper-XXYhEGXPPF' in text
with tempfile.TemporaryDirectory() as temp:
fresh=Path(temp)/'fresh';subprocess.run([sys.executable,'-W','error',str(r/'reproduce.py'),'--out',str(fresh)],check=True,env={**os.environ,'PYTHONDONTWRITEBYTECODE':'1','PYTHONHASHSEED':'0','PYTHONWARNINGS':'error','OMP_NUM_THREADS':'1','OPENBLAS_NUM_THREADS':'1','MKL_NUM_THREADS':'1','VECLIB_MAXIMUM_THREADS':'1'},stdout=subprocess.DEVNULL)
assert names=={p.name for p in fresh.iterdir() if p.is_file()} and all((r/'outputs'/name).read_bytes()==(fresh/name).read_bytes() for name in names)
print('evidence validated: 5 exact claims, 11 gates, four byte-identical runs, source pins, native mechanisms, oracles, controls, and literal falsification')