Documentation · Function Wiki · Basic examples
gravityCU is a multi-GPU CUDA TreePM cosmological gravity, lightcone, and Full-GPU Friends-of-Friends (FoF / Catalog / Spherical Overdensity) solver designed to evolve from 1,073,741,824) particles 100% resident inside GPU VRAM (4× NVIDIA RTX A6000, 4 × 48 GiB) without host-device swapping.
- Lazy Tree & Async Device Pipeline:
GRAV_LAZY_TREE=1refits persistent octree nodes across active sub-steps (256^3: tree time9.96 s → 1.58 s), paired with asynchronous host lightcone writes and CUB migrant compaction. - Split-Force Kernel Decomposition (
GRAV_SPLIT_FORCE=1): Separates tree traversal, M2P tensor accumulation, grouped M2L, and warp-tiled P2P into distinct low-register, zero-spill kernels (0stack frame,0spill). - Pure-CUDA Distributed PM (
GRAV_PM_DIST=1): Multi-GPU distributed FFT long-range Poisson solver (cudaMalloc/can_peerP2P + pinned bounce staging, zero NCCL dependency). - 3D
12×12×12Top-Cell Domain Decomposition (GRAV_DOMAIN_MODE=auto): Hilbert (3d_hilbert, default whenGRAV_NUM_GPUS > 1) and ORB (3d_orb) topological partitioning with NVLink owner remapping, interior-first slot layout, full-duplex chunked ghost exchange, dynamic rebalancing, and compute/communication overlap (256^3,4× RTX A6000:17.525 stotal /15.729 scompute+PM without export I/O,2.99×vs.1× GPU52.443 s). - Full-GPU FoF / Catalog / SO & Multi-GPU FoF (
src/grav_cuda_fof.cu):- Single-GPU zero-upload
whole_fof_deviceand multi-GPU arbitrary-3D-domainwhole_fof_multigpu(called directly by the 3D engine on residentd_xbuffers). - Full-GPU
whole_fof_slabbedcross-slab GPU Union-Find merge & CUB relabeling (0ID mismatches out of16.78Mparticles acrossS=4/8andG=1/2/43D decompositions). - Full-GPU
compute_fof_catalog(12.48×vs. CPU,max_rel <= 1.16e-13) and GPU segmented-sortcompute_fof_so(M200c/R200c,M200m/R200m,15.33×uniform /5.37×non-uniform vs. 8-thread OpenMP CPU,max_rel <= 3.67e-15), exposed through an unchanged C ABI (ctypes-compatible with scripts/to-hdf5-from-source.py).
- Single-GPU zero-upload
-
Late-time (
$z = 0.063 \to 0$ ):4,388.62 s(73m 09s) on dual-NVLink4× RTX A6000—2.40×vs.1× A6000(10,540.44 s) and7.26×vs. 256-core CPU (31,878.77 s). -
Mid-redshift (
$z = 2.033 \to 1.758$ ):3,510.98 s(58m 31sidle node) —9.27×vs. 256-core CPU (9.64×incl. dump step). -
Matter Power Spectrum
$P_\delta(k)$ :0.00453%max deviation at$z=0$ and0.01019%at$z=1.758$ . -
Full-History Projection (
$z = 200 \to 0$ ):34.6–35.8 hpure evolution (8.50–8.80×speedup) and~86%whole-node energy reduction (28.3–29.2 kWhvs.213.1 kWh).
| Benchmark / Subsystem | CPU Reference | Optimized GPU (Opt1–5) | Speedup | Accuracy vs. CPU / Reference |
|---|---|---|---|---|
|
|
796.36 s (256T CPU SWIFT) |
17.53 s (4× A6000 3D Hilbert) |
45.4× (50.6× no-IO) |
0.0011% (eager) / 0.0387% (lazy), |
|
|
32,538 s (256c CHPC CPU) |
3,511 s (4× A6000 NVLink) |
9.27× |
0.01019%, 0.01112%
|
|
|
31,879 s (256c CHPC CPU) |
4,389 s (4× A6000 NVLink) |
7.26× |
0.00453%, aligned 0.0405%
|
|
|
304.48 h / 213.1 kWh
|
34.6–35.8 h / 28.3–29.2 kWh
|
8.50–8.80× |
Energy reduced by ~86%
|
| FoF Catalog / SO ( |
0.835 s Cat / 1.908 s SO (8T) |
0.0669 s Cat / 0.1245 s SO |
12.48× / 15.33×
|
Catalog <= 1.16e-13, SO <= 3.67e-15, FoF 0 mismatches |
All codes below were benchmarked on the same phy-gpus node a9 (2× AMD EPYC 9754 256 cores, 5× NVIDIA RTX A6000) from the exact same 16,777,216-particle L = 25 Mpc/h snapshot with matched opening angle (dEta = 0.2236068). GPU power is directly measured via 200 ms nvidia-smi NVML polling; because a9 lacks unprivileged RAPL powercap, host/CPU energy is reported transparently as modeled whole-node power (+120 W base host for GPU runs; utilization-scaled 120–800 W and flat 700 W reference for dual-socket EPYC CPU runs). Full telemetry is saved in reports/code-energy-comparison.json.
| Code & Configuration | Wall / Evo Time | Throughput (M/s) |
Measured GPU (Wh) | Whole-Node (Wh) |
J / M-step (GPU / Node) |
Max |
|---|---|---|---|---|---|---|
PKDGRAV3 3.5.1 (1× A6000, -np 1 -sz 16) |
2043.2 s / 1926.3 s
|
0.252 (0.252/GPU) |
38.57 (67.9 W) |
106.68 |
285.9 / 790.8
|
0.150% (91/92, 17/17) |
PKDGRAV3 3.5.1 (2× A6000 MPI, -np 2 -sz 16) |
1333.2 s / 1223.6 s
|
0.397 (0.198/GPU) |
50.45 (136.2 W) |
94.89 |
374.0 / 703.4
|
0.150% (91/92, 17/17) |
GADGET-4 (128 EPYC cores MPI TreePM) |
883.2 s / 857.7 s
|
1.206 |
— |
110.70 (700W: 171.7) |
— / 385.3 (597.8) |
0.187% (92/92, 17/17) |
CPU SWIFT (256T EPYC FMM+PM baseline) |
816.0 s / 796.4 s
|
1.184 |
— |
136.16 (700W: 158.7) |
— / 519.9 (605.9) |
Reference (92, 17) |
gravityCU 1× A6000 (3D Hilbert Lazy) |
58.09 s / 50.03 s
|
18.84 (18.84/GPU) |
3.93 (241.3 W) |
5.86 (23.2×) |
15.01 / 22.40
|
0.0387% (92/92, 17/17) |
gravityCU 2× A6000 (3D Hilbert Lazy) |
33.11 s / 28.66 s
|
32.88 (16.44/GPU) |
4.17 (448.1 W) |
5.27 (25.8×) |
15.93 / 20.15
|
0.0387% (92/92, 17/17) |
gravityCU 4× A6000 (3D Hilbert Eager) |
30.21 s / 21.07 s
|
44.74 (11.19/GPU) |
5.38 (635.2 W) |
6.39 (21.3×) |
20.54 / 24.39
|
0.00106% (92/92, 17/17) |
gravityCU 4× A6000 (3D Hilbert Lazy) |
28.26 s / 18.99 s |
49.62 (12.41/GPU) |
5.25 (662.7 W) |
6.19 (22.0–25.6×) |
20.05 / 23.64
|
0.0387% (92/92, 17/17) |
Why PKDGRAV3 spends more wall time than
gravityCUat$256^3$ : PKDGRAV3 offloads FMM+Ewald gravity tiles to GPUs while rebuilding domain decompositions (67×,425.95 son1G/278.91 son2G-MPI) and CPU trees (245×,522.19 s/145.87 s) on host threads across244adaptive substeps (3.3–5.6%mean GPU utilization). Keeping all16.78Mparticles GPU-resident with TreePM + lazy Hilbert octree refits (42.7–73.6%GPU utilization) yields29×faster wall time and18–26×lower whole-node energy. On$1024^3$ full-history ($z=200\to0$ ), live4× A6000power measures657.1–735.9 W, reducing full-run node energy from213.1 kWhto28.3–29.5 kWh(-86%).
To regenerate all CPU-vs-GPU and cross-code comparison figures from reports/:
python3 scripts/make_opt_comparison_figures.py
python3 scripts/make_code_energy_figure.py
python3 scripts/make_figures.pyFull step-by-step guides live in docs/README.md and are mirrored on the GitHub Wiki:
- 01 · Quick Start (Zero-Dep Build & Test Matrix)
- 02 · Configuration Manual, ICs, Async Delta Checkpoint & Direct HDF5 I/O
- 03 · High-Precision Gravity (
4.29e-7Ewald), Neutrinos, MC-SIDM, Nonlinear $f(R)$ & Zoom-in - 04 · Full-GPU Hydrodynamics, CHIMES/PS20, SN/AGN Feedback & Online 6D/tSZ/X-ray Analysis
- 05 · C-ABI
PhysicsStagePlugins & v3.x Engine Architecture (E1–E4) - 06 · Multi-GPU Scaling, Full-GPU FoF, Cross-Node MPI & FAQ
- CUDA Toolkit >= 12.x (tested on CUDA 12.6 & 13.0) (
nvcc+libcufft),g++(C++17 + OpenMP),make, and Python 3 withnumpy(+h5pyfor HDF5 conversion). - 100% Zero External Dependencies (v3.6 / E4): All targets (
make engine,make smoke,make pm,make pm-mpi,make fof,make hydro,make cosmo-hydro,make plugins) now build completely standalone using the MIT-licensed native FMM/softening header src/grav_fmm_native.cuh with noKERNEL_BUILD_DIRrequired (passingKERNEL_BUILD_DIR=/path/to/swiftsimremains supported as an optional override).
# 1. Build standalone FoF shared lib & C99 CIC helper + run CPU 3D-domain unit test
make standalone test-domain3d
# 2. Run synthetic 200K-particle GPU FoF + Catalog + SO ctypes verification
make test-fofExpected output: DOMAIN3D_SMOKE_PASSED and FOF_SMOKE_PASSED.
# Override CUDA_ARCH (default sm_86), CUDA_HOME (auto-detected), CXX (default g++) if needed
make engine KERNEL_BUILD_DIR=/path/to/swiftsim CUDA_ARCH=sm_86 CXX=g++
make smoke KERNEL_BUILD_DIR=/path/to/swiftsim CUDA_ARCH=sm_86 CXX=g++This generates build/smoke_64.bin (64^3 clustered periodic box), evolves a = 0.85 -> 0.92 on all visible GPUs using 3d_hilbert (or 1d_slab on 1 GPU) with inline multi-GPU FoF, and runs compute_fof_catalog + compute_fof_so via build/grav_cuda_fof.so, printing ALL_SMOKE_TESTS_PASSED.
# 1. Convert SWIFT / monofonIC / MUSIC / Gadget HDF5 (single or multi-shard) into dense binary
# Auto-converts kpc/h & Mpc/h -> Mpc, Gadget u=v/sqrt(a) -> v_pec, MassTable fallback, Zoom-in PartTypes
python3 scripts/prepare_input.py input_snap.hdf5 input.bin --cosmo-env input.cosmo.env
# 2. Run multi-GPU VRAM-resident TreePM + inline FoF to final scale factor a_end=1.0
source input.cosmo.env
GRAV_NUM_GPUS=4 GRAV_DOMAIN_MODE=auto GRAV_DYNAMIC_PM=1 GRAV_PM_DIST=1 \
GRAV_SPLIT_FORCE=1 GRAV_LAZY_TREE=1 GRAV_P2P_MODE=nvlink \
GRAV_RUN_FOF=1 GRAV_FOF_LINK_RATIO=0.2 GRAV_FOF_MIN_SIZE=32 \
./build/multi_gpu_slab input.bin evolved.bin 1.0
# 3. Export SWIFT HDF5 snapshot + Full-GPU FOFGroups (CentresOfMass, M200c/R200c, M200m/R200m)
python3 scripts/to-hdf5-from-source.py input_snap.hdf5 evolved.bin output_snap.hdf5 \
--fof-bin evolved.bin.fof.bin --fof-lib build/grav_cuda_fof.soReady-to-use monofonIC (2LPT/3LPT) and MUSIC (Zoom-in multi-mass) templates live in configs/ic/, verified via make test-ic. Note: prepare_input.py works for any 64^3–1024^3); scripts/prepare_1024_input.py is kept specifically for reproducing the original
All drivers (multi_gpu_slab, grav_mpi, grav_hydro, grav_cosmo_hydro) accept a clean INI/TOML-style parameter file via --config configs/run_example.ini (or GRAV_CONFIG=...); explicit GRAV_* environment variables always override file values for effortless Slurm sweeps.
| Variable | Default | Description & Notes |
|---|---|---|
GRAV_NUM_GPUS |
all visible GPUs | Number of GPUs (1..12, up to visible CUDA devices) |
GRAV_DOMAIN_MODE |
auto |
auto selects 3d_hilbert when G > 1 (1d_slab when G = 1); also accepts 1d_slab, 3d_hilbert, 3d_orb
|
GRAV_P2P_MODE |
nvlink |
nvlink (recommended on EPYC multi-root PCIe to avoid cross-root NODE P2P stalls), all, or off
|
GRAV_DYNAMIC_PM |
unset (0) |
Set GRAV_DYNAMIC_PM=1 for periodic cosmological PM step scaling (16 PM intervals) |
GRAV_PM_DIST |
1 (when G > 1) |
Distributed multi-GPU FFT PM solver (0 disables) |
GRAV_PM_GRID |
128 |
PM FFT grid size (power of 2 in 32..1024) |
GRAV_PM_ORDER |
2 (cic) |
PM mass-assignment / interpolation order: 2 (cic), 3 (tsc), or 4 (pcs) with matched |
GRAV_PM_INTERLACE |
0 |
Set 1 for symmetric half-cell interlaced PM (cancels odd aliases while preserving zero self-force & momentum conservation) |
GRAV_PM_GRAD |
fd4 |
PM force gradient operator: fd4 (4th-order finite difference, SWIFT default) or ik (exact |
GRAV_PM_ASMTH |
1.25 |
TreePM split scale ratio 1.25 matches SWIFT; also scales short-range cutoff GRAV_PM_RCUT * r_s) |
GRAV_PM_RCUT |
4.5 (5.5 in high) |
Short-range TreePM cutoff ratio 4.5; 5.5 under GRAV_PRECISION_MODE=high) |
GRAV_PRECISION_MODE |
standard |
Set high to enable high-precision gravity (PCS + Interlacing + -ik, rcut=5.5, exact erfc/exp, mac=1e-4, theta=0.25, no lazy tree; achieves 1.01e-5 Ewald median force error and 0.038% Zel'dovich RMS) |
GRAV_NU_MASS_EV |
0.0 |
Total neutrino mass > 0 activates |
GRAV_NU_NSPECIES |
3 |
Number of degenerate massive neutrino species when GRAV_NU_MASS_EV > 0
|
GRAV_NU_TABLE |
unset | Optional 2D (a, k [1/Mpc], R_nu) ASCII/CSV transfer table from CLASS/CAMB (resampled to 256 log-$k$ GPU bins per step) |
GRAV_TIDAL_TIMESTEP / GRAV_SYNC_STEP
|
0 (1 in high) / 0
|
P3 dynamical/tidal + softening-crossing timestepping (GRAV_TIDAL_ETA=0.05, GRAV_VEL_ETA=0.25) and synchronous global-rung symplectic mode (7.64e-7 Plummer drift) |
GRAV_SIDM_SIGMA_M / GRAV_SIDM_W0
|
0.0 / 0.0
|
B2-a GPU-native octree-leaf MC-SIDM elastic cross section GRAV_SIDM_SIGMA_INTERNAL in code units) and optional velocity scale GRAV_SIDM_HS
|
GRAV_FR0 / GRAV_FR_SCREENING
|
0.0 / 1
|
B2-b Hu–Sawicki |
GRAV_SPLIT_FORCE |
1 (periodic) |
Split traversal / M2P / M2L / P2P kernels (required for 3D domain modes) |
GRAV_LAZY_TREE |
1 (periodic) |
Lazy node refit across active sub-steps |
GRAV_REBALANCE_INTERVAL |
8 |
Rebalance cadence in steps for 3D domains (0 disables live rebalancing) |
GRAV_REBALANCE_MIN_GAIN |
0.02 |
Minimum predicted imbalance improvement to commit rebalance |
GRAV_RUN_FOF |
0 |
Set 1 to compute inline FoF (*.fof.bin) at snapshot/final outputs via whole_fof_multigpu
|
GRAV_ENERGY_LOG |
0 |
Set 1 to log per-PM-step kinetic/potential energy ( |
GRAV_FOF_LINK_RATIO / _MIN_SIZE
|
0.2 / 32
|
Linking length ratio GRAV_FOF_LINK_MPC to override linking length directly in Mpc for multi-mass Zoom-in runs |
GRAV_SOFT_IN |
unset | Path to per-particle float32 Plummer softening file (*.soft.bin, N floats) for multi-mass Zoom-in runs (scripts/zoomin_pipeline.py) |
GRAV_G |
43.0092 |
Gravitational constant in internal units (Mpc, 10^10 Msun, km/s) |
GRAV_COSMO_H0 / OMEGA_M / OMEGA_DE
|
67.36 / 0.3153 / 0.6847
|
Cosmological parameters |
Ready-to-customize Slurm scripts live in slurm/:
-
slurm/quickstart-smoke.sbatch — 1-minute
make engine && make smokesanity check -
slurm/mgpu-256-test.sbatch —
$256^3$ multi-GPU scaling & build benchmark -
slurm/mgpu-1024-0045-e2e.sbatch & slurm/mgpu-1024-0056-e2e.sbatch —
$1024^3$ mid-$z$ and$z=0$ end-to-end validation runs
All templates read KERNEL_BUILD_DIR, DATA_DIR, CUDA_HOME, CXX_BIN, and PYTHON_BIN from environment variables (with no hardcoded user home paths).
gravityCU/
├── Makefile # Turnkey build & smoke targets (fof, pm, pm-mpi, engine, mpi-engine, smoke)
├── ROADMAP.md # Precision (P1-P3), Physics Breadth (B1-B4) & Deferred Exascale schedule
├── src/
│ ├── multi_gpu_slab.cu # Multi-GPU TreePM driver (1d_slab + 3D domain + optional MPI modes)
│ ├── slab_resident.cu # Single-GPU 12-slab baseline driver
│ ├── grouped_force.cuh # Morton tile grouped M2L/P2P force evaluation helpers
│ ├── grav_domain_3d.h # 12×12×12 Hilbert / ORB partitioner & NVLink owner remapping
│ ├── grav_domain_3d_engine.cuh # Single-node 3D domain execution engine & overlap pipeline
│ ├── grav_domain_3d_mpi.cuh # Multi-node MPI 3D domain execution engine (compiled cleanly)
│ ├── grav_mpi_comm.h # MPI wrapper utilities & node topology helpers
│ ├── grav_cuda_pm.cu/h # Single-GPU cuFFT particle-mesh solver (CIC/TSC/PCS + Interlace + -ik)
│ ├── grav_cuda_pm_dist.cu/h # Pure-CUDA single-node distributed FFT PM solver
│ ├── grav_cuda_pm_mpi.cu/h # Multi-node MPI 1D-slab cuFFT + Alltoallv PM solver
│ ├── grav_pm_config.cuh # Runtime PM order, interlacing, spectral gradient & high-precision config
│ ├── grav_neutrino.cuh # B1 k-space linear-response massive neutrinos + Komatsu+2011 H(a)
│ ├── grav_timestep_p3.cuh # P3 dynamical/tidal & softening-crossing timestep + sync symplectic mode
│ ├── grav_sidm.cuh # B2-a GPU-native octree-leaf warp round-robin MC-SIDM scattering
│ ├── grav_fr_gravity.cuh # B2-b Hu-Sawicki n=1 f(R) modified gravity + chameleon screening
│ ├── grav_cuda_hydro.cu/h # B4 Full-GPU 3D Wendland C2 SPH + cooling + coupled self-gravity
│ ├── grav_hydro_driver.cu # Standalone CLI driver (build/grav_hydro) for B4 hydro benchmarks
│ ├── grav_treepm_hydro.cuh # Coupled all-species GPU TreePM short-range gravity & 3D Hilbert hydro partitioner (v4.3)
│ ├── grav_cosmo_hydro.cu # Coupled comoving TreePM + GPU SPH + CHIMES/SN/AGN + GravSimulationEngine (build/grav_cosmo_hydro)
│ ├── grav_cuda_fof.cu/h # Full-GPU FoF, slab merge, multi-GPU FoF, Catalog & SO solvers
│ ├── make-evolution.py # Instrumented GPU octree & M2P/M2L code generator
│ └── cic_deposit.c # Deterministic C99 CIC grid deposition helper
├── tree/ # Project-owned octree builder sources (used by make-evolution.py)
├── m2p/ # Project-owned M2P kernel port helpers (used by make-port.py)
├── scripts/
│ ├── prepare_input.py # General SWIFT HDF5 -> dense binary IC/snapshot converter
│ ├── prepare_1024_input.py # Legacy 1024^3 converter for archival scripts
│ ├── make_smoke_ic.py # Synthetic clustered periodic DM IC generator (numpy-only)
│ ├── make_plummer_ic.py # Equilibrium isolated Plummer sphere IC generator (energy/virial gate)
│ ├── zeldovich_benchmark.py # 1D EdS Zel'dovich plane-wave generator & analytical verifier
│ ├── smoke_fof.py # Standalone ctypes FoF + Catalog + SO parity smoke test
│ ├── verify_smoke_e2e.py # End-to-end smoke output & SO verifier
│ ├── test_domain3d_smoke.cpp # Standalone C++17 3D domain decomposition & MultiNodeCommStats unit test
│ ├── test_mpi_pm.cu # Multi-node MPI PM FFT parity & latency benchmark
│ ├── test_pm_precision.cu # Gate P1 PM self-force, Newton 3rd law & 3D wave accuracy tests
│ ├── test_ic_adapters.py # monofonIC / MUSIC / SWIFT IC adapter unit tests
│ ├── test_neutrino_b1.cpp # Gate B1 Fermi-Dirac background & k-space response unit test
│ ├── test_p3_b2.cpp # Gate P3 timestep & Gate B2 f(R) / MC-SIDM unit test
│ ├── zoomin_pipeline.py # Gate B3 multi-mass zoom-in IC generator & contamination/subhalo auditor
│ ├── hydro_benchmarks.py # Gate B4 Sod, Sedov-Taylor, K-H, cooling & Santa Barbara verification suite
│ ├── to-hdf5-from-source.py # Dense .bin + .fof.bin -> SWIFT HDF5 + FOFGroups exporter
│ ├── eval_1024_snapshot.py # P(k), P_theta(k), halo mass function & kick-alignment analyzer
│ ├── model_1024_full_history.py # Full-history z=200->0 scaling & energy model
│ ├── make_figures.py # Manuscript figure generator (fig1-fig4)
│ ├── make_opt_comparison_figures.py # CPU-vs-GPU speed & accuracy comparison plots (fig5-fig6)
│ └── make_code_energy_figure.py # Cross-code runtime, NVML energy & accuracy plot (fig7)
├── slurm/ # Parameterized Slurm job templates (incl. mpi-multinode-test.sbatch)
├── reports/ # Verified opt12..opt5, code-energy, analytical gates & mpi-multinode-bench JSONs
├── paper/ # Physical Review D (revtex4-2) manuscript, BibTeX & figures
└── index.html / en.html # Interactive bilingual benchmark & accuracy showcase pages
For the full 18-week schedule, acceptance gates, and compute/storage tiers, see ROADMAP.md.
- Lazy octree refit, async lightcone host writes, and CUB migrant compaction
- Split traversal / M2P / M2L / P2P zero-spill kernels (
GRAV_SPLIT_FORCE=1) - Pure-CUDA distributed multi-GPU FFT PM solver (
GRAV_PM_DIST=1) - 3D
12×12×12Hilbert/ORB domain decomposition, dynamic rebalancing, and compute/communication overlap - Full-GPU FoF, cross-slab GPU merge, multi-GPU 3D inline FoF, Catalog, and SO (
M200c/R200c,M200m/R200m) - Pre-MPI & analytical physics gates (reports/pre-mpi-physics-gate.json, reports/analytical-physics-gates.json): 1D EdS Zel'dovich collapse (
$64^3$ ,$a=0.02\to0.50$ :$\Delta x_{\rm RMS}/L = 4.41\times 10^{-4}$ ,$\Delta v_{\rm RMS}/v_{\rm pk} = 0.592%$ ), exact periodic Ewald$\theta$ -convergence (short median$8.48\times 10^{-3} \to 1.14\times 10^{-4}$ across$\theta \in [0.9, 0.3]$ ; total median$1.98\times 10^{-3}$ at$\theta=0.7$ ), Layzer–Irvine energy (3.07e-4) & momentum (3.72e-5) across$z=200\to0$ ($526.6\text{ s}$ ,$9{,}257$ steps,$0.123%$ $P_\delta(k)$ ,$18/18$ massive halos), 32K Plummer virial/energy (1.15e-5), and 4-GPU boundary force parity (1.03e-4median)
In Progress (Phase 2 Multi-Node MPI Close-Out — reports/mpi-multinode-bench.json)
- Milestone 2A: 3D domain MPI topology & contiguous Hilbert
MultiNodeCommStats(DOMAIN3D_SMOKE_PASSED) - Milestone 2B (
np=2): MPI 1D-slab cuFFT PM verified onphy-gpus(b4, RTX 4090,np=2, side=128, N=64^3:max_rel_field=1.012e-14,max_rel_pot=3.177e-16,pm_comm_ms=90.875,MPI_PM_PASSED) - Milestone 2C (Build):
test_mpi_pm,grav_mpi, andmulti_gpu_slabcompiled cleanly onphy-gpus(sm_89, OpenMPI 4.1.6 + CUDA 12.6) - Gates M1/M2/M3 (
2N×1Gonb[4,6]): Verified true cross-node MPI PM (3.89e-16,Slurm 492167),$64^3$ 2-node 3D Hilbert evolution parity vs. 1G (pos_rms/L = 2.59e-6, identical257-step schedule,Slurm 492195), and$256^3$ (16.78M) 2-node zero-error completion (54.27 s,Slurm 492195).
- P1 — High-Order PM & External IC Adapters (reports/p1-pm-precision-gate.json):
CIC/TSC/PCS+ symmetricInterlacing+-ikspectral gradient across all 3 PM backends +monofonIC/MUSICadapter (IC_ADAPTER_TESTS_PASSED). Ewald total-force error ($\theta=0.3$ ) reduced18.5×(1.034e-3 -> 5.58e-5); 2-node cross-machine MPI PM (b[4,6]) verified to3.89e-16. - P2 — High-Precision Gravity Mode (reports/b1-p2-gate.json):
GRAV_PRECISION_MODE=high(PCS+Interlace+ik,rcut=5.5, exacterfc/exp,mac=1e-4) pushes Ewald total-force median error to1.014e-5(102×vs. baseline) and$64^3$ Zel'dovich displacement RMS to0.0382%(14.5×vs. baseline). - P3 — Adaptive Tidal/Dynamical Timestep & Symplectic Sync (reports/p3-b2-gate.json): 32K isolated Plummer sphere energy drift reduced
15.1×(1.15e-5 -> 7.64e-7, beating< 1e-6). - B1 —
$k$ -Space Massive Neutrinos (reports/b1-p2-gate.json): Zero-VRAM-overhead$W_\nu(k,a)$ + Komatsu+2011$H(a)$ +CLASS/CAMBtable loader; 3-scale suppression ($\sum m_\nu=0.30\text{ eV}$ ) matches exact linear ODE to0.009%–0.028%. - B2 — GPU MC-SIDM &
$f(R)$ Modified Gravity (reports/p3-b2-gate.json): Race-free warp round-robin leaf MC-SIDM (107,365scatters in25 s,9.35e-12kinetic conservation, gravothermal core collapse+29.0%density) and Hu–Sawicki$n=1$ $f(R)$ F4 (0.0001%/0.179%vs. exact ODE). - B3 — Multi-Mass Zoom-in Pipeline (reports/b3-zoomin-gate.json): 9-level
4096^3-equivalent Zoom-in (1.16Mparticles,16,777,216×mass ratio,0.61 kpcsoftening) with0LR contamination inside$R_{200c}$ and$2,R_{200c}$ ,35GPU-FoF subhalos, and1.20%$R_{200c}$ convergence vs.2048^3. - B4 — Full-GPU 3D SPH Hydrodynamics & Cooling (reports/b4-hydro-gate.json, reports/cosmo-hydro-gate.json): 5/5 isolated/periodic hydro benchmarks passed on RTX 4090 — 3D Sod (
2.28%$\rho$ L1,0.089%$\Delta E$ ),$48^3$ Sedov–Taylor (0.67%shock radius), Kelvin–Helmholtz (516.1×$E_{k,y}$ growth), GPU radiative cooling (2.44e-15energy budget), and Santa Barbara cluster (13.96×monotonic entropy rise,0.98%$\Delta E$ ); plus coupled comoving cosmological PM+SPH (build/grav_cosmo_hydro) verified on exact Hubble adiabatic expansion (1.78e-15), 3D Zel'dovich pancake (4.12×10^6 Kaccretion shock), and a full$48^3$ DM +$48^3$ Gas (221Kparticles) cosmological box with cooling + star formation (23.3%WHIM,$\delta_{\max}=10{,}076$ , baryon mass conservation3.23e-11). - v3.1 — C-ABI
dlopenPhysics Plugins & GPU CHIMES/PS20 Cooling Table (reports/v31-plugins-chimes-gate.json): Added src/grav_plugin.h (GRAV_PLUGIN_ABI_VERSION=1,GRAV_PLUGINS=path/to/plugin.so, plugins/example_plugin.cpp) and src/grav_chimes_table.cuh ($64\times 64$ GPU-residentchimes_ps20metal-line cooling + Haardt–Madau UVB photoheating + Rahmati+2013 self-shielding,GRAV_COOLING_TABLE=chimes_ps20,GRAV_HYDRO_METALLICITY,GRAV_HYDRO_UVB), verified viamake test-plugins(V31_PLUGINS_CHIMES_TESTS_PASSED) and Colab Tesla T4$32^3$ DM+$32^3$ Gas cosmological runs (UVB IGM equilibrium$T_{\rm med}\approx 1.2\times 10^4,\text{K}$ ,4.58×$T_{\max}$ metal-cooling suppression at$Z=1,Z_\odot$ vs.$Z=0$ ,+2.05%stellar mass boost, exact0.0baryon mass error). - v3.2 — Stochastic Thermal Stellar Feedback & Delayed Chemical Enrichment (reports/v32-baryon-subgrid-gate.json): Added src/grav_baryon_subgrid.cuh (Dalla Vecchia & Schaye 2012 stochastic thermal SN feedback at
$\Delta T_{\rm heat}=10^{7.5},\text{K}$ , Chabrier IMF delayed SNII/SNIa/AGB metal enrichment, and live per-particle metallicity$Z_i$ coupled directly into GPUGravChimesTablecooling), verified viamake test-baryon(V32_BARYON_SUBGRID_TESTS_PASSED, MC unbiased expectation0.21%, integral conservation0.0) and Colab Tesla T4$24^3$ DM+$24^3$ Gas cosmological FB-on vs. FB-off controls (-32.2%star-formation self-regulation,3.46×p99 overdensity reduction,1.77×10^7 Khot outflows,+30.3%WHIM boost,5.82×peak metal enrichment,5.82e-10baryon mass conservation). - v3.3 — SMBH Seeding, Bondi–Hoyle Accretion & Dual-Mode AGN Feedback (reports/v33-smbh-agn-gate.json): Added src/grav_smbh_agn.cuh (race-free
atomicCAShalo-core BH seeding, Eddington-capped Bondi–Hoyle accretion, Booth & Schaye 2009$\Delta T_{\rm AGN}=10^{8.5},\text{K}$ quasar thermal bursts, and low-$f_{\rm Edd}$ bipolar radio kinetic jets), verified viamake test-agn(V33_SMBH_AGN_TESTS_PASSED, Salpeter$e$ -folding2.50e-4, quasar/radio energy conservation<= 1.24e-15) and full-stack Colab Tesla T4 cosmological run (17SMBHs grown11.07×, additional-24.3%AGN quenching on top of SN feedback /-48.7%total vs. no-FB,5.42×p99 overdensity reduction,2.51×10^7 KCGM,12.42%WHIM,6.59e-10(M_gas+M_star+M_BH)conservation). - v3.4 — Nonlinear
$f(R)$ GPU FAS Multigrid Relaxation Solver (reports/v34-fr-multigrid-gate.json): Added src/grav_fr_multigrid.cuh (4-level 3D GPU FAS Multigrid Red–Black Newton–Gauss–Seidel with Oyaizuexpm1cancellation-free transform and 3D trilinear prolongation, wired intograv_cosmo_hydroviaGRAV_FR_NONLINEAR=1), verified on Colab Tesla T4 (V34_FR_MULTIGRID_GPU_TESTS_PASSED): exact 7-digit Yukawa$G_{\rm eff}/G$ recovery (rel_res = 4.78e-15–1.88e-14), strong nonlinear Chameleon screening ($\delta_{\rm peak}=2000$ ) at FP64 machine precision (rel_res = 2.23e-16,42,845×core suppression matching analytic deep-screening to5.89e-7), and 50-step end-to-end nonlinear$f(R)$ cosmo-hydro evolution in8.76 s. - v3.5 — On-the-Fly GPU 6D Phase-Space Subhalo Finder & tSZ/X-ray Projection (reports/v35-online-analysis-gate.json): Added src/grav_online_analysis.cuh (ROCKSTAR-style 6D GPU phase-space union-find +
$256\times 256$ GPU Compton-$y$ / bolometric X-ray bremsstrahlung projection, wired intograv_cosmo_hydroviaGRAV_ONLINE_ANALYSIS=1), verified on Colab Tesla T4 (V35_ONLINE_ANALYSIS_GPU_TESTS_PASSED):32.49 msexact de-blending of spatially overlapping host+subhalo (1,981/2,000+500/500,sub_vx = 450.05 km/s),2.02 ms$256\times 256$ tSZ/X-ray projection with machine-exact flux conservation (Y_rel_err = 4.23e-15,Lx_rel_err = 1.58e-15), and end-to-end 300-step cosmological integration. - v3.6 (E4) — 100% Zero-External-Dependency Engine Build & CUDA 13.0 Support (reports/v36-e4-zero-dep-gate.json): Added MIT-licensed native FMM/softening header src/grav_fmm_native.cuh (Dehnen 2001 Wendland C2 softening + TreePM
erfcderivatives + 4th-order Cartesian M2P/M2L) and migrated CUB iterators to Thrust for CUDA 12.x/13.x compatibility; verifiedmake engine && make smokewithKERNEL_BUILD_DIR=""on Colab Tesla T4 (ALL_SMOKE_TESTS_PASSED,$64^3$ 2.237 s,16FoF halos). - v3.7 (E5) — FP64 Short-Range Force Accumulation (
4.29e-7Ewald Accuracy) (reports/v37-e5-fp64-ewald-gate.json): Addediact_grav_pp_truncated_fp64in src/grav_fmm_native.cuh and wired FP64doubleP2P accumulation intoGRAV_PRECISION_MODE=high(eval_p2p_split_kernel); verified on Colab Tesla T4 (make test-fp64-ewald->V37_E5_EWALD_FP64_PASSED) pushing exact 3D periodic Ewald total-force median error down to4.29e-7(2.60×below FP321.12e-6), plus 512-step$64^3$ GRAV_PRECISION_MODE=highevolution withbad_count=0. - v3.8 (E1) — GPU Locally Essential Tree (LET) Remote Pruning (reports/v38-e1-let-pruning-gate.json): Added src/grav_let_pruning.cuh (GPU parallel BFS LET frontier pruner + compact
152 BLetWireNodepacket + remote M2P evaluator), verified on Colab Tesla T4 (make test-let->V38_E1_LET_PRUNING_PASSED):0.40 msGPU pruning on$64^3$ achieving4.38×wire-traffic compression (1724.5 KB -> 393.8 KB) with2.31e-3median remote force parity at$\theta=0.70$ . - v3.9 (E2) — 32-Bit Fixed-Point Compact VRAM Coordinates & Branchless Periodic P2P (reports/v39-e2-compact-coords-gate.json): Added src/grav_compact_coords.cuh packing 32-bit periodic coordinates +
floatmass into a single16 Buint4(2.50×coordinate VRAM reduction vs.double3 + float4 = 40 B), verified on Colab Tesla T4 (make test-compact-coords->V39_E2_COMPACT_COORDS_PASSED):1.16e-8 Mpcmax quantization error in a100 Mpcbox,2.32e-8 Mpcwrap/drift parity, and7.60e-9P2P force median error (186×more accurate thanfloat4FP321.42e-6). - v3.10 (E3) — Unified
SimulationEngine/DomainBackendCore & Main-Engine Plugin Wiring (reports/v310-e3-sim-engine-gate.json): Added src/grav_sim_engine.h (GravSimulationEngine+ pluggableGravDomainBackendfor1d_slab/3d_hilbert/3d_mpi+PluginRegistry+ unified JSON telemetry) and wiredGRAV_PLUGINSdirectly into src/multi_gpu_slab.cu; verifiedmake test-sim-engine(V310_E3_SIM_ENGINE_PASSED, exact0.00e+003-backend energy parity,2.71e-7symplectic drift) and live$64^3$ GPUmulti_gpu_slabrun (2.34 s,bad_count=0,pre_pm=65 / post_kick=65 / snapshots=1). - v3.11 (E6) — Native Asynchronous Incremental Checkpoint & Direct HDF5 I/O (reports/v311-e6-checkpoint-io-gate.json): Added zero-dependency header src/grav_checkpoint_io.h (64-byte
GCKPheader with FNV-1a checksums, atomic temp-write +rename,GravAsyncCheckpointWriterbackground worker, bitwise incremental delta checkpoints, and optional-DGRAV_ENABLE_HDF5SWIFT/Gadget-4/Header+/PartType1/*direct I/O without intermediate.binconversion) plus[checkpoint]/output.hdf5config keys in src/grav_config_file.h; verified viamake test-checkpoint(V311_E6_CHECKPOINT_IO_PASSED,100Kparticles with10%mutation:4687.562 KB->546.938 KB=8.571×delta compression,7.473 msmain-thread submit /17.587 msasync drain,0bit mismatches, single-byte corruption rejected) and native-DGRAV_ENABLE_HDF5+ Pythonh5pycross-verification (0bit mismatches,H5PY_CROSS_VERIFY_PASSED). - v4.1 — Live Main-Engine E6 Async Checkpoint, Crash-Resume & Direct HDF5 I/O (reports/v41-ckpt-resume-hdf5-gate.json): Wired periodic adaptive checkpointing (
GRAV_CKPT_DIR,GRAV_CKPT_INTERVAL,GRAV_CKPT_INCREMENTAL,GRAV_CKPT_ASYNC,GRAV_CKPT_STOP_AFTER), crash-safe atomiclatest.txtmanifests, synchronized velocityGRAV_CKPT_RESUME, and direct-DGRAV_ENABLE_HDF5output (GRAV_IO_HDF5=1) into src/multi_gpu_slab.cu; verified on Colab Tesla T4 ($64^3$ =262,144particles) via preempted run stopping at step 56 (a=0.910944) and resuming toa=0.92: trajectory matches uninterrupted run to4.21e-9 Lmedian /2.97e-7 LRMS (1.36e-6$v_{\rm rms}$ diff,bad_count=0), and direct HDF5 matches.binwith0bit mismatches (V41_E2E_CKPT_RESUME_HDF5_PASSED). - v4.2 — Live E2 32-Bit Compact Coordinates & E1 GPU LET MPI Pruning (reports/v42-e2-e1-wiring-gate.json): Wired
GRAV_COMPACT_COORDS=1(16 Buint4branchless periodic P2P / FP64 high-prec) across src/multi_gpu_slab.cu, src/grav_domain_3d_engine.cuh, and src/grav_domain_3d_mpi.cuh, and wired GPU BFS LET remote tree pruning (GRAV_MPI_LET=1,let_prune_mpi_level_kernel) intobuild/grav_mpi; verified on Colab Tesla T4:PM=128high-prec Ewald median force error improves from2.70e-6to2.19e-6withbad_count=0, and 2-rank OpenMPIgrav_mpi($64^3$ ,3d_hilbert, 65 steps) cuts exported ghost particles2.47×(6.24M -> 2.53M), compresses MPI wire traffic1.612×, cutsghost_mpi_ms-30.2%(132.3 ms -> 92.3 ms), and matches full-ghost evolution to1.03e-10 Lmedian /6.00e-8 LRMS (V42_E2_E1_MAIN_MPI_PASSED). - v4.3 — Coupled All-Species TreePM Hydrodynamics, 3D Hilbert Multi-GPU Fusion & Unified
GravSimulationEngine(reports/v43-treepm-hydro-fusion-gate.json): Added src/grav_treepm_hydro.cuh coupling MIT 4th-order FMM M2P + Dehnen Wendland C2 softening + E2uint4compact coords + E5 FP64 P2P + 3D Hilbert multi-GPU/multi-domain partitioning (GRAV_HYDRO_TREEPM=1,GRAV_HYDRO_DOMAINS=K) with total baryon gravitating mass conservation (m_gas + m_star + m_bh), and refactored src/grav_cosmo_hydro.cu onto the unified E3GravSimulationEngine/CosmoHydroBackend. Verified on Colab Tesla T4: two-species (DM+Gas) 3D Ewald force median error drops from PM-only1.41e-1to5.26e-5(FMM-4th) and5.96e-7(FP64) with0.00e+004-domain Hilbert parity (make test-treepm-hydro->V43_TREEPM_HYDRO_UNIT_PASSED); uniform adiabatic expansion maintains1.78e-15; and full-stack$24^3\text{ DM}+24^3\text{ Gas}$ evolution (CHIMES/PS20 + UVB + SF + SN + enrichment + SMBH/AGN + online tSZ/X-ray +example_plugin.so) toa=0.50sharpens peak gas overdensity5.11×(16,296vs.3,189), DM peak2.47×(891vs.360), and peak X-ray brightness3.13×with2.92e-10baryon mass conservation and0.0(600 steps) /9.78e-13 L(805 steps) 4-domain Hilbert parity. - v3.10 — Native On-the-Fly GPU Merger Tree, ICU Device Zero-Copy & CosmoCU
dlopenDirect Bridge (reports/v310-merger-tree-gate.json): Added GPU gravitational unbinding + global-ID top-$K_{\rm core}$ extractor (src/grav_online_analysis.cuh) and weighted core-voting merger tree (src/grav_merger_tree.cuh,w(r)=(r+1)^{-1},GRAV_MTREE_SKIP_MAX=2flyby rescue,< 3 mshost DFS exporting LHaloTree/SubLink/GMT1), upgradedsrc/grav_icu_bridge.h+multi_gpu_slab.cuto true GPU zero-copy (icu_generate_to_device/_mgpu,0 Bhost RAM,0PCIe round-trips withmemfdfallback), and wiredGRAV_COSMOCU_INIdlopen(libcosmocu)queries (cosmocu_H_km_s_Mpc,cosmocu_nu_ratio_grid) intosrc/grav_neutrino.cuh/GravPhysics. Verified across Gates 1–4 on Colab Tesla T4:test_v310_merger_treepassed 2:1 merger &750 km/sskip-frame flyby;$64^3$ 16-snap box (5,323nodes /560trees) achieved0cycles,0dangling pointers, and0.0%MAH glitch rate;$256^3$ (16.78M) 30-snap run added only+2.57%wall time and0.762%(23.4 MB) peak extra VRAM (0.185%MAH glitches);icu_generate_to_devicematchedmemfdat$z=0$ to0.0pos/P(k) diff; and liveCosmoCUdlopenagreed with reference$H(a)$ /$W_\nu(k,a)$ to7.54e-5/1.09e-5. - v4.4 — CRK-SPH (Conservative Reproducing Kernel Hydrodynamics) (reports/v44-crk-sph-gate.json): Added src/grav_crk_sph.cuh (1st-order linearly complete reproducing kernel moments
m_0, m_1, M_2with Shepherd fallback, tensor$\nabla\mathbf{v}$ , and symmetric van Leer limited pairwise artificial viscosity) wired viaGRAV_HYDRO_CRK=1/hydro.scheme=crkinto both src/grav_cuda_hydro.cu and cosmological comoving src/grav_cosmo_hydro.cu (keeping traditional SPH as default). Verified across Gates 1–5 + regressions on Colab Tesla T4: 25%-jittered 3D lattice achieves8.88e-160th-order and1.02e-151st-order gradient reproduction (0.2329SPH) with1.23e-17/2.32e-17pairwise momentum/energy conservation; Hydrostatic Square (alpha_cond=0) suppresses earlyt=0.05spurious pressure blip25.5×(0.358->0.0140) and spurious$E_{\rm kin}$ by2052×(4.35×lower blip and1.000retention att=2.0); 3D Kelvin–Helmholtz instability (alpha_cond=0) boosts$E_{ky}$ growth5.72×over traditional SPH (462.03×vs.80.82×); 3D Sod (2.36%$\rho$ /2.73%$P$ L1) and$48^3$ Sedov–Taylor (0.671%$R_{\rm shock}$ error atCFL=0.15) pass; and comoving CRK-SPH achieves3.40e-15Hubble adiabatic scaling and full-stack$24^3$ TreePM+CRK-SPH+CHIMES+MTree evolution with0baryon mass error andvalid_dag=true. - v4.5 — COLIBRE Spinning Black Hole & Hybrid Thin/Thick Disk Jet/Wind AGN (reports/v45-spin-agn-gate.json): Upgraded src/grav_smbh_agn.cuh, src/grav_config_file.h, and src/grav_cosmo_hydro.cu (
GRAV_BH_SPIN=1/agn.spin=1, keepingGRAV_BH_SPIN=0100% backward compatible) with Bardeen–Press–Teukolsky Kerr$r_{\rm ISCO}$ & Novikov–Thorne$\eta_{\rm NT}(a)$ , Tchekhovskoy+2010 MAD Blandford–Znajek jet efficiency (up to1.30), Narayan+2022 MAD spin-down torque, King+2005 counter-alignment flip, Bardeen–Petterson 3D alignment against local$\mathbf{L}_{\rm gas}$ , and dual thermal-wind + spin-aligned bipolar jet reservoirs across Thick/Thin/Slim disks. Verified across Gates 1–4 on Colab Tesla T4: Kerr ISCO identity (1.24e-14), 4 parallel GPU tracks (thin spin-up to0.998,$120^\circ$ counter-align flip ->1.000000, MAD spin-down to0.035576with1.000000000000jet collinearity and1.31e-16/5.38e-16conservation), live$16^3$ TreePM+CRK-SPH+CHIMES cosmological A/B/C runs at matcheda_end=0.2(thin-disk spin-up to0.9972cutting stellar mass-6.78%vs. no-AGN; thick-disk MAD spin-down firing5thermal bursts +50jets;9.77e-9–1.84e-8baryon mass conservation;valid_dag=true), plus all prior unit regressions (V33_SMBH_AGN_TESTS_PASSED,CONFIG_V3_UNIT_TESTS_PASSED,V44_CRK_SPH_UNIT_PASSED,V43_TREEPM_HYDRO_UNIT_PASSED). - v5.0 — Unified
multi_gpu_slabHydro+DM Main Binary + Optional External C Hooks + Route Bhybrid-chimes+ Route C GPU Chemistry / Metals / M1RT (reports/v50-unified-chem-rt-gate.json): Extracted src/grav_cosmo_hydro_engine.cuh (run_cosmo_hydro_main) and unified cosmological TreePM+CRK-SPH+Baryons directly into src/multi_gpu_slab.cu (auto-detectingCosmoHydroHeaderor--hydro/GRAV_ENABLE_HYDRO=1), added src/grav_ext_hooks.h (GRAV_WITH_CHIMES/GRACKLE/VELOCIRAPTOR,dlopenC-ABI hooks, Route B OpenMP cold-ISM packing), and added src/grav_gpu_chem_rt.cuh (Route C GPU 7-species M-matrix chemistry, 6-element metals, and M1RT), sharing the corrected cosmological time-conversion constantGRAV_MPC_KMS_TO_S = 3.08567758e19s across CPU/GPU paths with per-substep RT source injection,substeps_max = 512, and CFL clamping. Post-fix Colab Tesla T4 verification (GRAV_WITH_CHIMES=1 GRAV_WITH_GRACKLE=1 GRAV_WITH_VELOCIRAPTOR=1):multi_gpu_slabmatchesgrav_cosmo_hydro(5.27e-8RMS pos) while pure-DM$64^3$ passesbad_count=0;test_v50_chem_rt_hooksverifiesa=0.1000->0.1001=817.194 kyr,4%selective cold-ISM offload,max_elem_err=0.0,[O/Fe]=+0.3342/-1.5728, and$32^3$ GPU Strömgren sphere (0.03% / 0.69% / 1.58%at30 / 80 / 180 Myr); short-expansion tests confirmchem_dt_s_totaccuracy (1.24e-10/3.81e-11rel err) and288RT substeps (up to63/step,rt_cfl_max=0.2489 <= 0.25); and Gate 5 passes both live Route C (x_HI=0.0126, x_HII=0.9874, M1 photons=1.32e61, rt_cfl_max=0.2491, valid_dag=true) and Route B (hybrid_cold_frac=2.11%, x_H2=0.01371, vr_halos=8, valid_dag=true). - v5.1 (Spec A) — FP32-Relative /
float4CRK-SPH Acceleration +$64^3$ Strong-Nonlinear Full-Stack Gate 5 + High-Precision LET Auto-Tightening + Launch/Sync Overhead Reduction (reports/v51-crk-opt-64c-gate.json, reports/v51-let-highprec-gate.json): Added FP32-relative CRK solvers in src/grav_crk_sph.cuh and AoSoAfloat4sorted packing + tighter1.45*hneighbor grid in src/grav_cosmo_hydro_engine.cuh (preservingGRAV_CRK_FP64=1fallback), automatic high-precision LET opening tightening0.70 -> 0.25vialet_effective_thetain src/grav_let_pruning.cuh, pinnedGpuCtrlPinned+ batchedscan_local_slabsin src/multi_gpu_slab.cu, and stack-allocateddist_pmexchange maps in src/grav_cuda_pm_dist.cu. Verified on Colab Tesla T4:$24^3$ A/B cutssph_ms44.47×(6,821.13 ms -> 153.39 ms) and full wall time11.43×(max_rel_rho_diff=4.20e-4,mean_rel_u_diff=1.37e-3, Hubble adiabatic1.997e-9);$64^3\text{ DM}+64^3\text{ Gas}$ (524,288particles) 180-step strong-nonlinear full stack finishes in30.01 s(max_gas_overd=1,966.67,m_star=0.1588,n_bh=38,bh_spin_max=0.9649,6SN +10AGN jets,n_subhalos_6d=35, merger tree163nodes /13treesvalid_dag=true,baryon_mass_rel_err=4.52e-12); high-precision LET pushes remote median error to0and p9552.47×lower (1.52e-2 -> 2.89e-4); and pure-DM$64^3$ regression passesbad_count=0. (4-GPU strong-scaling re-benchmark awaits a multi-GPU node.) - v5.2 (Spec B) — Streaming ZIP64 On-the-Fly DMO & Hydro Lightcone (HEALPix / Pencil-Beam + Gas / Star / Compton-$y$) + Direct
ObsCU weak_lensingExport (reports/v52-lightcone-gate.json): Added src/grav_lightcone.cuh and wired[lightcone]/GRAV_LC_SHELLS_OUTacross both DMO (src/multi_gpu_slab.cu) and--hydro(src/grav_cosmo_hydro_engine.cuh) using a streaming zero-copy ZIP64.npzexporter (0x0001/0x06064B50/0x07064B50headers with table-driven CRC-32 supporting$>4,\text{GiB}$ arrays and archives), exporting total-mattershells.npy+kappa_born.npyforObsCU/src/obscu/weak_lensing.pyplusshells_gas_mass.npy,shells_star_mass.npy,shells_compton_y.npy, andcompton_y_map.npyin--hydroruns. Verified across DMO +$>4,\text{GiB}$ ZIP64 +--hydroon Colab Tesla T4 & local read-back:62,224HEALPix round-trips (0mismatches), Born convergence exactness (2.17e-16/2.17e-15), DMOObsCUparity (3.54e-5full-sky /3.35e-5pencil); real4.5000 GiBNside=204811-shell archive (scripts/test_v52_zip64.cpp,shells.npy = 4,429,185,152 B,kappa_born.npyoffset4,429,186,421 B) passing fullzipfile.testzip()CRC32 andnumpy.load()verification across all 12 entries; and--hydrolightcone matching analytic adiabatic Compton-$y$ to0.076%(0.81%max shell) while delivering live full-sky & pencilgas_mass_lc,star_mass_lc,compton_y_map, andObsCUBorn$\kappa$ parity (6.37e-5/3.99e-5). - v5.3 — SWIFT (
kp1.0ms1.2/ COLIBRE Minihalo) Physics, Config Parity & Hydro Baryon Merger Tree Export (reports/v53-swift-parity-gate.json): Added src/grav_sph_kernel.cuh (runtime-selectable 3D Quartic Spline$M_5$ H=2.018932 h/ Wendland C2 + configurable$X_H$ and piecewise neutral/ionized$\mu(T)$ thermo), updated src/grav_cosmo_hydro_engine.cuh, src/grav_chimes_table.cuh, src/grav_gpu_chem_rt.cuh, src/grav_treepm_hydro.cuh, src/grav_merger_tree.cuh, and src/grav_config_file.h with dual star-formation gating (overdensity > 1000andn_H > 10 cm^-3),GRAV_HYDRO_UVB=0,GRAV_COSMIC_RAY_RATE,T_min = 1 Kcooling floor,T_init = 466.455 K/T_Hion = 10000 K, variable artificial viscosity$\alpha \in [0, 2]$ ,max_vol_change = 1.4smoothing-length limiter,soft_h = 3.125e-4,GRAV_SNAP_Z_LIST/GRAV_SNAP_A_LISTmulti-snapshot export,merger_tree.everyconfig mapping, GPU spatial-hash aperture baryon attachment (Mgas, Mstar, MBH, Zgas, SFR), andENABLE_HDF5=1direct/MergerTree.hdf5/GMT1v2 export, plus configs/swift_minihalo_parity.ini and streaming--hydroHDF5 conversion in scripts/prepare_input.py. Verified across Gates 1–6 + regressions on Colab Tesla T4 (all_pass=true):$M_5$ integral1.11e-15/$dW$ 1.68e-9/ CRK-SPH 0th & 1st-order1.33e-15/3.55e-15; strict dual-threshold SF gating; UVB=0 exact zero heating & cooling to< 22 K(table) /1.0 K(non-eq); variable viscosity0.1 -> 1.626(shock) /0.423(expansion),vol_ratioin[0.7143, 1.4]; end-to-end$z=200\to 0$ preset run (1,806steps,3snapshots,0.0baryon error); and Gate 6 clustered hydro merger tree direct HDF5 export (491nodes,1tree,valid_dag=true,GMT1v2 exact match,Mgas/Mstaraperture error1.49e-8/1.39e-17,test-merger-tree&build/multi_gpu_slabpassing).
- Track 3 — Exascale Readiness (
S1–S4, deferred): Dynamic$N_{\rm top} \propto G^{1/3}$ / ORB tree cuts (replacing static12^3),cuFFTMp/heFFTe2D pencil FFT +MPI_Alltoallv_c, sparse neighborhood graph + LET pruning,uint64_tparticle IDs, and parallel HDF5 / ADIOS2 async checkpointing.
| Repository | Role | Canonical Link |
|---|---|---|
CU-Suite |
Top-level orchestrator, interface contract & baryon calibration | https://github.com/HainaHuang729/CU-Suite |
CosmoCU |
C++20 Einstein–Boltzmann, nonlinear HMcode/BCM/EFTofLSS, CMB & Dual<10> AD |
https://github.com/HainaHuang729/CosmoCU |
ICU |
Memory-optimized GPU/CPU/MPI 1LPT/2LPT/3LPT cosmological initial conditions | https://github.com/HainaHuang729/ICU |
gravityCU |
Multi-GPU VRAM-resident CUDA TreePM, SPH hydro, lightcones & GPU FoF | https://github.com/HainaHuang729/gravityCU |
21cmCU |
Native C/CUDA + cuFFT 21cm reionization & Bayesian inference engine | https://github.com/HainaHuang729/21cmCU |
ObsCU |
Decoupled cosmological survey forward modeling, SBI & baryon calibration | https://github.com/HainaHuang729/ObsCU |
Author: Haina Huang (Department of Physics, The Chinese University of Hong Kong).
Please cite CITATION.cff and see paper/main.tex and reports/MULTI-GPU-AND-VALIDATION-REPORT.md for full derivations, kernel specifications, and benchmark provenance.


