Repository navigation
Releases
Releases · HainaHuang729/ObsCU
ObsCU v2.1.0 — Strong Gravitational Lensing
What's New in ObsCU v2.1.0
Strong Gravitational Lensing (obscu.strong_lensing)
-
Cosmological Lensing Geometry:
StrongLensGeometry,compute_strong_lens_geometry($D_d, D_s, D_{ds}$ ,$\Sigma_{\rm crit}$ , time-delay distance$D_{\Delta t}$ ),einstein_radius_sis_arcsec,einstein_radius_point_mass_arcsec. -
Analytic & Composite Mass Profiles (NumPy CPU + CuPy GPU):
PointMassLens,SIELens(softened/singular isothermal ellipsoid with rotation & circular limit),ExternalShearLens,SphericalNFWLens(+from_halo_mass),PseudoJaffeLens(+from_subhalo_mass), andCompositeLens. -
CDM / WDM Subhalo Substructure:
populate_subhalo_lensesintegratingobscu.nonstandard.wdm_hmf_suppression. -
Critical Curves, Caustics & Multi-Image Solver:
find_critical_curves_and_caustics,solve_lens_equation(2D grid bracketing + damped exact-Jacobian Newton-Raphson root polishing, parity classification, Fermat potentials & relative time delays). -
Oversampled Ray-Shooting & Optical / SBI Pipeline:
SersicSource,GaussianClumpSource,render_lensed_image(2D & RGB with__dlpack__),simulate_strong_lens_observation, andgenerate_strong_lens_training_batchbridged toobscu.imaging_simandobscu.sbi. -
Validation & Benchmarks: Added Validation Gate 11 (
strong_lensing_analytic_parity) inobscu.validationand Suite 8 (strong_lensing_rayshoot) inscripts/benchmark_gpu_production.py.
Verification Summary
- Local CPU:
11/11validation gates PASS;test_v21_strong_lensing.pyPASS. - Google Colab Tesla T4 GPU (
CuPy 14.0.1):87/87executed tests PASS (0 failures, 5 optional dependency skips), CPU vs GPUfloat64ray-shooting paritymax_abs_diff <= 1.51e-14, andbenchmark_gpu_production.py --preset smoke --backend cupy8/8 suites PASS.
ObsCU v2.0.0
ObsCU v2.0.0
Cumulative release delivering the full roadmap across v1.7.2 → v1.8.0 → v1.9.0 → v2.0.0:
Highlights
-
v1.7.2CI/GPU Robustness & 10-Gate Validation:- Python 3.10 conditional
tomlicompatibility (requires-python = ">=3.10"), GPU-awarecheck_obs_dependenciestest, Gate 9 (observer_epoch_lensing_parity), and Gate 10 (imaging_fidelity_and_source_loss_gate).
- Python 3.10 conditional
-
v1.8.0Curved-Sky Spherical Weak Lensing & 6×2pt + SSC:- Unified
multi_plane_raytrace(..., geometry="healpix")dispatch and spherical HEALPix NLA/TATT IA inweak_lensing.py. - Exact Schulten–Gordon Wigner-
3jrecursion (wigner3j_row) and spin-0 / coupled spin-2E/Bcurved-sky MASTER matrices (compute_spherical_mode_coupling,deconvolve_spherical_pseudo_cl). - Joint 6×2pt Limber theory with
$\kappa_{\rm CMB}$ (compute_theory_6x2pt) and symmetric PSD Super-Sample Covariance (ssc_cl_covariance,total_cl_covariance) inforecast.py.
- Unified
-
v1.9.0GPU-Native NG Statistics, Single-Launch Heterogeneousimaging_sim& Streaming Multi-Probes:- CuPy device-native execution for
compute_lensing_peaks,compute_field_moments_and_pdf,compute_minkowski_functionals, and chunked periodiccompute_knn_cdf. - Single-launch heterogeneous
generate_rgb_training_batchwith per-sample(B, 9, 21, 21)Zernike+OU PSFs, radial vignetting, diffraction spikes, and cosmic-ray artifacts. - Single-pass memory-bounded
run_streaming_lightcone_multiprobesinpipeline.py.
- CuPy device-native execution for
-
v2.0.0Astronomy Standard I/O, Extended Benchmarks & CI/PyPI Workflows:- Pure-NumPy/Astropy IEEE-754 2D/RGB WCS FITS I/O (
export_wcs_fits,read_wcs_fits) and DESC SACC-v1 HDF5/JSON/FITS export/read (export_sacc_datavector,read_sacc_datavector) inio.py. - Extended
scripts/benchmark_gpu_production.pywithimaging_sim_hetero_rgbandnon_gaussian_summary_gpu. - Expanded GitHub Actions matrix (Python 3.10–3.13 + macOS + optional
healpyfull suite) & PyPI publish workflow.
- Pure-NumPy/Astropy IEEE-754 2D/RGB WCS FITS I/O (
Verified Results (Local CPU & NVIDIA RTX 4090 on phy-gpus)
- Local CPU:
77/77tests PASS (78discovered,1skipped optionalhealpy);obscu benchmark10/10PASS. - RTX 4090 GPU (
phy-gpus, CuPy 13.6.0):- Targeted GPU unit suites (
test_obscu,test_v15–test_v20):30/30PASS (49.1s). - Summary stats CPU vs GPU parity:
peaks hist_err=0,moments skew=1.73e-17,minkowski max_diff=0.0,knn max_diff=0.0. - Heterogeneous
512×512×3(B=32, vignetting + spikes + CR + DLPack):1,639.7 pairs/sec(19.52 ms/batch). benchmark_gpu_production.py --preset mid --backend cupy:7/7suites PASS (fullsky_born_streaming5,765.94 Mpix/s,imaging_sim_hetero_rgb1,304.27 pairs/s).
- Targeted GPU unit suites (
ObsCU v1.7.1
ObsCU v1.7.1
Highlights
obscu.imaging_sim.sky_renderer:- Added
render_deep_field_truthproducing linearfloat32 (H, W, 3)(truth_nebula_galaxy, truth_stars, truth_total)+ exactgt_catalogwith HDR dynamic range>= 1e5(1e-4–50.0), Sérsicn in [0.8, 4.0],(e1, e2), and stars deliberately placed overlapping bright galaxy bulges. - Added batched GPU/CPU generator
render_deep_field_batchbacked by shared-memory Sérsic reduction (deposit_sersic_rgb_batch_f32), star deposition (deposit_stars_rgb_batch_f32), and multi-mode nebula synthesis (eval_nebula_rgb_batch_f32).
- Added
obscu.imaging_sim.psf_degrader:- Added Ornstein–Uhlenbeck random-walk guiding jitter kernel (
generate_guiding_jitter_kernel), vectorized 3×3 anchor Zernike + Petzval/astigmatism wavefront generator, fused shared-memory tiled CUDA convolution with radial R/B lateral CA (sv_psf_convolve_rgb_batch_f32), fused Poisson/CMOS/banding noise kernel (sensor_noise_rgb_batch_f32),degrade_imaging_batch(..., return_dlpack=True), and LHSgenerate_rgb_training_batch.
- Added Ornstein–Uhlenbeck random-walk guiding jitter kernel (
obscu.imaging_sim.restoration_metrics:- Added
wavelet_scattering_distance(2D & channel-averaged RGB L1/L2),verify_photometry_and_ellipticity, andmeasure_psf_fwhm_and_eccentricity.
- Added
Verification (CPU & NVIDIA RTX 4090)
- ObsCU: 60/60 CPU unit tests PASS; CUDA GPU suites (
test_v15,test_v16,test_v17) 11/11 PASS on RTX 4090 (b4). - CU-Suite: 12/12 unit tests PASS (zero regression).
- RTX 4090
512×512×3FP32 Throughput (B=32, target>= 800 pairs/sec):degrade_imaging_batch:3,182.1 pairs/sec(10.06 ms/ batch of 32)- End-to-end
render_deep_field_batch + degrade_imaging_batch:2,907.6 pairs/sec(11.01 ms/ batch of 32) - DLPack zero-copy device pointer identity verified (
__dlpack__()&dlpack_degraded). - Measured coverage sweep: FWHM
[1.382, 8.038] px, corner eccentricity[0.000, 0.802], SNR[-3.45, 44.34] dB.
ObsCU v1.7.0
ObsCU v1.7.0 adds the optional obscu.imaging_sim subpackage (zero PyTorch/ONNX dependencies; CPU + CUDA CuPy + __dlpack__):
-
obscu.imaging_sim.sky_renderer: CUDARawKernel& CPU sub-pixel Sérsic galaxy + dense power-law starfield + filamentary nebula rasterizer consumingMockGalaxyCatalog+photometry. -
obscu.imaging_sim.psf_degrader: Spatially varying Zernike wavefront PSF ($Z_4$ –$Z_{11}$, lateral chroma, guiding jitter), bilinear partition-of-unity convolution, Poisson + CMOS readout + row banding noise, and LHSgenerate_training_batchwith zero-copy__dlpack__. -
obscu.imaging_sim.restoration_metrics: Normalized 2D Wavelet Scattering texture distance, local annulus aperture photometry linearity, adaptive galaxy ellipticity correlation, and spurious-star detector (evaluate_restoration_fidelity).
ObsCU v1.6.1
ObsCU v1.6.1 resolves live CuPy 13.6 runtime incompatibilities discovered on NVIDIA CUDA hardware and archives verified cluster production benchmarks from phy-gpus (node b1, NVIDIA GeForce RTX 4090, CUDA driver 12060, CuPy 13.6.0):
-
Full-Sky
$N_{\rm side}=4096 \times 20$ Shells (born_convergence_streaming):-
FP32:
0.5071 s(7941.02 Mpix/s, peak VRAM pool3.762 GiB) -
FP64:
0.5872 s(6857.17 Mpix/s, peak VRAM pool6.012 GiB) -
GPU vs. CPU Speedup (
mid$N_{\rm side}=2048$ ): 85.5× (0.0946 sGPU vs8.0928 sCPU)
-
FP32:
-
Flat-Sky
$4096^2 \times 20$ Lensing + Kaiser–Squires + On-Device$C_\ell$ :-
FP32:
0.1219 s(2752.28 Mpix/s,74.5×over CPU atmid) | FP64:0.1373 s(2444.26 Mpix/s)
-
FP32:
-
$10^7$ -Halo HOD + Radial RSD +$2048^2$ Projection +$C_\ell$ :-
FP32:
0.8163 s(2.08 Mgal/s,1.262 GiB) | FP64:0.8275 s(2.05 Mgal/s,1.684 GiB)
-
FP32:
-
CuPy 13.6 Compatibility Fixes: Device-native
cumsum/searchsortedreplacement forcupy.repeatinpopulate_hod,Generator.standard_normalcompatibility, and Python 3.10tomllibfallback guard.
ObsCU v1.6.0
ObsCU v1.6.0 adds
-
Memory-Bounded
$O(1)$ -Shell Streaming Lensing (weak_lensing.py):born_convergence_streaming(FP32/FP64) & streamingmulti_plane_raytrace_healpix, plus on-devicexp.searchsorted/xp.bincount$C_\ell$ binning eliminating 2D host copies. -
Full-CuPy Large-Scale Galaxy Paths (
mock_galaxies.py): GPU-nativehod_mean_occupation,populate_hod(float32/float64),apply_rsdvia devicexp.interpcosmological lookup tables,xp.bincount2D overdensity projection, and$O(N \log N)$ vectorizedSubhaloCatalog.is_central. -
Cluster Benchmark Harness & Slurm Automation (
scripts/benchmark_gpu_production.py,scripts/slurm_gpu_benchmark.sh,docs/GPU_BENCHMARK_PROTOCOL.md):smoke,mid, andproduction($N_{\rm side}=4096$ ,$10^7$ halos) presets with CuPy VRAM telemetry and Apptainer/Slurm integration.
ObsCU v1.5.0
ObsCU v1.5.0 includes milestones v1.3 through v1.5:
-
v1.3: Live
CosmoCUDual<5>/Dual<8>AD 3x2pt Fisher Jacobians, joint BCM$S_{\rm bar}(k, z)$ + X-ray$f_{\rm gas}(M_{500c})$ calibration closure, and Gate 8 cross-engine Limber parity ($< 2%$ ). -
v1.4: Curated literature & simulation benchmark datasets (
obscu.datasets), validation dashboard (obscu dashboard+ optionalmatplotlibsummary plot), and developer API guide (docs/API_GUIDE.md). -
v1.5: CuPy
RawKernelGPU acceleration paths for scatter SPH & banded Ly-alpha optical depths, vectorizedBatchForwardModel.run_batch, and Non-Gaussian SBI joint-constraint showcase (examples/ng_sbi_wdm_bpl_fom.py).