cunningham-chain-search

CC18: Cunningham Chain Search Engine

A visualization-driven project that grew into a high-throughput GPU/CPU pipeline for searching long Cunningham chains (first-kind). More about HPC optimization and AI-assisted iteration than the math itself.

Results

As of March 2026, this project has contributed:

The original target (first-kind CC18 or CC19) has not yet been reached. This was compute-limited.

The campaign dataset lives in a separate repo: cunningham-chain-data. Summary statistics and analysis CSVs are in data/ here; the full raw dataset (~30 MB, 929K CC10+ roots including 44 CC16 and a CC17) is available as a release download.

What Where
GPU filter engine (CUDA) src/cuda/
CPU search engine (GMP) src/cpu/
GP/PARI library + MCP server gp/
Interactive visualizations visualizations/
Analysis notes analysis/notes/
Analysis scripts analysis/scripts/
Campaign dataset cunningham-chain-data (separate repo)
Analysis CSVs data/
Failed experiments (17 approaches) experiments/failed/
Repo map docs/REPO_MAP.md
Search pipeline overview docs/SEARCH_PIPELINE.md

Search Pipeline

Two-phase GPU+CPU pipeline:

  1. GPU sieve (CUDA): modular-residue filtering at 57-65 billion candidates/sec (RTX 4090 / RTX 5090). Rejects 99.9988% of candidates.
  2. CPU prove (GMP): BPSW primality proving on the 0.0012% that survive.

See docs/SEARCH_PIPELINE.md for details.

Interactive Visualizations

Standalone HTML/JS tools that shaped the search design. Try them live on GitHub Pages:

Build

# GPU engine (requires CUDA toolkit + GMP)
# Adjust -arch=sm_XX for your GPU / CUDA toolchain
# Example: Ada may use sm_89; some setups may still require sm_86
nvcc -O3 -arch=sm_89 src/cuda/cc18_filter_cuda_CpC_v13.cu -o cc18_filter -lgmp -lpthread

# CPU engine (requires GMP)
gcc -O3 -march=native -flto src/cpu/cc_gmp_v33_03.c -o cc_search -lgmp -lpthread -lm

# Run tests
./cc_search --test

GP/PARI Library

gp -q
\r gp/cc_lib_v10.gp

Self-tests (37) run automatically on load.

See gp/HOWTO_cc_lib_v10.md for usage.

Project Stack

Author

Nenad Micic, Belgium — LinkedIn

License

See LICENSE.