Files
GR-raytracing/benchmarks/hip_psf_replay_2026-09-07/prepare_inputs.py
T
wyj 11e703e33d Doc: record bounded HIP PSF replay results and provenance
Archive fixed catalog subsets and captured events, manifests, reproducible commands, raw timing and regression logs, and device resource evidence. Document distribution-dependent tile reduction gains and independent indexed producer throughput.

Update the GPU plan and renderer design while retaining the production atomic path. Preserve historical measurement metadata and exclude generated Python bytecode.
2026-09-11 16:45:48 -04:00

19 lines
1.0 KiB
Python

#!/usr/bin/env python3
"""Recreate the fixed, bounded source subsets (never the full catalog)."""
from pathlib import Path
import hashlib,json
root=Path(__file__).resolve().parent
repo=root.parents[1]
manifest={}
for region,name in [('ordinary','tile_ra252_dec048.csv'),('center','tile_ra262_dec060.csv')]:
source=repo/'assets/2mass/processed/all_sky'/name
raw=source.read_bytes();lines=raw.decode().splitlines();n=min(8192,len(lines)-1)
sample=('\n'.join([lines[0]]+[lines[1+i*(len(lines)-1)//n] for i in range(n)])+'\n').encode()
target=root/(region+'.csv')
if target.exists() and target.read_bytes()!=sample:raise RuntimeError('existing subset differs')
target.write_bytes(sample)
manifest[region]={'source':str(source.relative_to(repo)),'source_sha256':hashlib.sha256(raw).hexdigest(),
'source_stars':len(lines)-1,'sample_sha256':hashlib.sha256(sample).hexdigest(),'sample_stars':n,
'selection':'row 1+floor(i*N/n), i=0..n-1, n=min(8192,N)'}
(root/'input_manifest.json').write_text(json.dumps(manifest,indent=2)+'\n')