{"slug": "show-hn-using-gpus-for-other-bs-than-ai-important-prime-record-for-the-geeks", "title": "Show HN: Using GPUs for other bs than AI – important prime record for the geeks", "summary": "A developer released BEACON, an open-source GPU-accelerated toolkit that hunts record prime gaps by centering searches on primorial-based numbers of the form n₀ = k·zd#/d rather than scanning random ranges, and prices each record's cost in advance. The kit, published on GitHub under the handle djuk8, runs on any Linux machine with NVIDIA GPUs and the CUDA 12 toolkit; a healthy RTX 5090 reads about 12,000-14,000 windows/s, and since version 8.57 a fresh box hunts one residue class of k mod 2310 from k = 10^16 + seed·10^15. Found gaps are re-derived by tools/notary_v2.py, certified with ECPP by tools/certify_batch.py, and submitted to the Prime Gap List, which tracks over 120,000 first-known and record gaps scored by merit (gap / ln(p₁)).", "body_md": "Any Linux machine with NVIDIA GPUs, the CUDA 12 toolkit, gcc, git, python3 and pari-gp (step by step, including one-GPU machines and how to submit what you find: [SETUP.md](https://github.com/djuk8/beacon/blob/main/SETUP.md)):\n\n```\npython3 -m pip install numpy gmpy2\ngit clone https://github.com/djuk8/beacon ~/lab/beacon && cd ~/lab/beacon\nbash deploy/fresh_box.sh --seed N        # N in 1..999, your own k-range (see SETUP.md)\n```\n\n`fresh_box.sh` extracts the kit, clones NVlabs' CGBN and builds the GPU Fermat driver for your card, writes the venue and seed files, builds the residue cache (about 15 minutes), builds the C and CUDA sieve, runs the identity gate (the GPU sieve against an independent CPU sieve, byte for byte) and launches the hunt with a watchdog that relaunches anything that dies. Twenty minutes later:\n\n```\nbash ~/beacon/p3/o1_kit/daily.sh\n```\n\nprints throughput per four-hour slice, the fossil audit, the harvest and the day's best gaps. A healthy box reads about 12,000-14,000 windows/s per RTX 5090 with all GPUs at 100% (the first hour ramps). Every gap the hourly harvest walks lands in `~/beacon/raid610/campaign_ledger.log`; `tools/notary_v2.py` re-derives any gap from its tuple, `tools/certify_batch.py` proves the endpoints with ECPP, and the lines those tools print go to the Prime Gap List's submission server.\n\nThe seed picks the k-range: since v8.57 a fresh box hunts one residue class of k mod 2310 (317, and 1993 on a second sieve card) from k = 10^16 + seed·10^15, with rings 1 and 2 sieved on the GPU; machines must not share a seed. `--mixed` gives the older all-classes mode (k0 = 10^12 + 8·10^9·seed). The current tree is stamped by `STAMP_20261104.sha256`; `sha256sum -c STAMP_20261104.sha256 --quiet` verifies it. The knob files behind it (SIEVESTEP / SIEVECLASS / SIEVEKBASE / SIEVEBID, SIEVERINGS) are described in `KIT_v8.56_NOTE.md` and `KIT_v8.57_NOTE.md`.\n\nA **prime gap** is the distance between two consecutive prime numbers.\nBetween 23 and 29 there is a gap of 6. Gaps grow — on average — like\nthe natural logarithm of the numbers involved, so raw gap size mostly\ntells you *where* you looked, not how remarkable the find is. The\ncommunity therefore scores gaps by **merit**:\n\n**merit = gap / ln(p₁)** — how many times larger the gap is than an\naverage gap at that height (p₁ is the prime that starts the gap).\n\nA merit of 20 means \"twenty average gaps' worth of nothing, in one\nstretch.\" The [prime gap list](https://github.com/primegap-list-project/prime-gap-list)\ntracks every first-known and record gap — over 120,000 entries — and\nseveral leaderboards sit on top of it: the **all-time merit table**\n(highest merits ever, any size), **size tables at merit thresholds**\n(\"largest gap with merit ≥ 20 / ≥ 30\"), and per-gapsize\n**first-occurrence records** (smallest starting prime known for each\ngap size). People have hunted these tables for decades, mostly by\nsearching enormous ranges and hoping.\n\n**BEACON's thesis: hope is the expensive part.** Record gaps can be\n*designed* — placed where mathematics makes them cheap — and the cost\nof any record on any table can be *priced in advance* by a measured\nlaw. This repo is the law, the machinery, the verification chain, and\nthe receipts.\n\n**(a) Choose where the gap lives.** Instead of scanning random\nterritory, center the search at numbers of the form\n\n**n₀ = k · zd# / d**\n\nwhere `zd#` is a **primorial** (the product of all primes up to `zd`),\n`d` is a small divisor of it, and `k` is a small integer. Around such\nn₀, divisibility is not random: every prime p ≤ zd (except those\ndividing d) automatically divides n₀, so it can only \"interrupt\" the\ngap at positions j that are multiples of p. The neighborhood of n₀ is\nborn mostly empty. The offsets j where a prime *could* live — the\n**survivors** — are few and known in advance.\n\n**(b) Sieve, don't test.** A cheap sieve (all primes up to Q, typically\n10⁵–10⁹) removes every position with a small factor. What remains gets\na real primality test. At our working heights, 97–99% of positions\nnever reach a test.\n\n**(c) Test the survivors until the walls appear.** Walk outward from\nn₀ in both directions; the first surviving position that turns out to\nbe prime on each side is a **fence**. The distance between the left\nand right fences *is* the gap, and it is **born verified**: every\ninterior position is either sieved-out (provably composite) or was\ntested and failed.\n\n**(d) Price it before you run it.** The number of independent attempts\n(**windows** — distinct values of k) needed before both fences land\nfar enough out follows a measured exponential law. Knowing that law,\nplus the measured speed of the hardware, converts any target on any\nleaderboard into a number: **so many GPU-days.** Then a record hunt is\na purchase decision, not a lottery ticket.\n\nThe load-bearing results, each with its measurement provenance in\n`docs/` and its code in this repo:\n\n- **The fence-rate law (Buchstab).** The rate at which candidate\nfences turn out prime is**λ(u) = e^γ · ω(u)** per unit of merit,\nwhere ω is the Buchstab function and**u = ln(j)/ln(zd)** measures\nhow far outside the \"free\" region you are. Confirmed three\nindependent ways, including a 94,885-fence out-of-sample test with\nzero fitted parameters (χ² p = 0.19) and a preregistered forward\nprediction confirmed at 6–7σ in both directions. The classical\nMertens-style rate is the u→∞ limit and misfits by up to 21× at\nhigh merit.\n- **The unified cost law.** Put every leaderboard on one axis with**u(m, D) = 1 + ln(m/2)/ln(D·ln10)** (m = merit, D = decimal\ndigits); then the exponential cost is**E(m, D) = m·σ(u)** with σ a\ntwo-parameter curve whose leading coefficient is**a = 1.8169 ± 0.0367 — equal to e^γ within 1.0σ** (26 calibration\npoints, R² = 0.994; deriving this constant is the open theorem).\nOut-of-sample checks at three heights land within 0.3–2.6%.\n- **The d-axis.** Dividing the primorial by small d relocates which\npositions each small prime can kill. Drop-2 (d = 2, k odd) doubles\nthe free desert without surrendering the floor and halves the near\nfence rate to e^γ·ω(2) — measured 1.82× more merit per test.\nThe construction is folklore among record holders; the*pricing* and the identification of the rate as a Buchstab value are, to our\nknowledge, new.\n- **Survivor structure at extreme height.** At 26,599 digits with\nzd ≈ 61,000, every even survivor j in the working window must be\n2q or 4q for a prime q > zd — the candidates are forced\nalmost-primes, and the survivor density (0.0167/unit, vs naive\n0.0407) follows from that structure exactly.\n- **The staircase.** With the law calibrated, each +1 of merit costs\n×2.4–2.6 in compute at fixed height, and the entire all-time merit\ntable — from its entry bar to a fixed multiple past its nine-year\ncrown — is priced in fleet-days by one configuration.\n- **Dead ends, kept dead.** Candidate scoring: null at 14σ. Wing-\nweighted covering: net zero at production. Deeper sieving beyond\nthe regime boundary: cost, not benefit. Every retired multiplier\ndied against a finished control, and stays in the record.\n\nOne liturgy runs every campaign, at every height, on CPUs or GPUs:\n\n``` php\ndesign  ->  make  ->  drive  ->  fold  ->  ... (rings 2..R) ...  ->  finish\n(rings)    (sieve)   (PRP)     (verdicts)                        (walk fences)\n```\n\n- \n**Design (`theater/*/ladder*.py`, `exchange/`).** Choose zd, d, k\ndigits, and a ladder of**rings** — nested windows sized so each\ncosts about the same expected number of fence-primes (E ≈ 1.7 per\nring). A k that shows a prime in ring 1 is discarded immediately;\nsurvivors advance outward. The ladder concentrates testing on the\n~e^-E fraction of ks that could possibly be records.\n- \n**Make (`theater/raid610/scanhunt_v0.py` + `tools/fastmake.py`).** The sieve factory: for a block of ~8,300 ks, compute every ring\nsurvivor. Vectorized per-prime across the whole block;\nbyte-identical (gated) to the reference per-k path.\n- \n**Drive.** Fermat/PRP-test the candidates. On GPUs:`cuda/g1_fermat_v2.cu` — a Montgomery-arithmetic kernel with a**Gerbicz error check** on every test (zero alarms across 18.5M+\nverdicts); measured 516–523k tests/s/card at the 2048-bit class.\nOn CPUs at extreme height:`tools/pfgw_drv.py` shards candidates\nacross PFGW processes.\n- \n**Fold.** Read the verdict file, count fence-primes per k, advance\nsurvivors to the next ring. Every file carries a magic number and a\ncount; mismatches fail loudly. Fold statistics (E per ring) are the\nlive health metric — the campaign certifies itself every block.\n- \n**Finish / walk.** A k that clears the full ladder is a**finalist** :\nwalk its true fences and record the gap.`tools/shard_walk.py` does\nthe same for**salvage** — see below — and its sieve is proven\ncorrect by exact set-equivalence against an independent\nimplementation.\n- \n**Salvage (`tools/salvage_v0.py`, `tools/shard_walk.py`).** The\ncampaign's exhaust is ore: a k killed at ring r still has a*certified prime-free core* out to ring r−1's edge, and often one\nfence far beyond. Walking discarded ks recovered, among others, a\nsize-table crown and an all-time-merit entry — at seconds per k.\nDoctrine: sweeps touch only fossils (age-gated manifests), never a\nlive theater's working files.\n- \n**Verification chain.** (1) Sieved-out interior = provably\ncomposite. (2) Every tested candidate has a GEC-checked or\nPFGW-issued verdict. (3) Finds are independently re-proved\n(separate library, both endpoints) before banking. (4) The public\nrecord's notary re-proves endpoints and re-sieves the interior on\nindependent hardware at submission. Nothing depends on trusting a\nsingle program.\n- \n**September machinery (RC11/RC12).** A persistent**bucket sieve** (`tools/sieve/` , FK lattice walk, one 24-byte record per prime) and\nits GPU port (`cuda/gbs.cu` ) sieve every window to 10¹⁰ — one card\nsieves for the whole box (`theater/raid610/gbsd.py` , the*sieve\ncard* ), byte-identical to the CPU reference (gates G-BSD, G-GBS,\nG-SV incl. stop-and-resume). A**full-window sparsity predictor** (residue tables for primes to 10⁵) ranks the pool before testing:\n×1.42 crown-λ per tested window (gate G-PRED). A**ladder manager** (`ladder.py` , one process per card) replaced 700 shell loops,\nreplay-gated identical (G-LADDER). Feeders and drivers pinned to\nreserved cores.`daily.sh` is the one-screen production read;`harvest_hourly.sh` walks every fossil and keeps the campaign ledger.\n\nThree \"theaters\" ran this architecture at three heights (details,\nconfigs, and preregistrations in `docs/` and `theater/`):\n\n| theater | height | target board | outcome | \n|---|---|---|---|\n| raid610 | ~611 digits | all-time merit table | **the record: 59,724 @ merit 42.5192** (previous record 41.9388, 2017);**#2: 58,416 @ 41.5882** ; 20 certified first-occurrence records in the list, ~25,000 further claims in the ledger | \n| strike24k | ~6,152 digits | largest gap @ merit ≥ 30 | **crown** : 426,520 @ 30.1156 (+11 size records at merit 25–30) | \n| mono | ~26,599 digits | largest gap @ merit ≥ 20 | **1,383,648 @ 22.59** , 1,348,726 @ 22.02, 1,263,196 @ 20.62 | \n\nPlus the ≥2,500-digit merit crown (209,420 @ 33.638) and its guard\n(201,646 @ 32.385) from the 2,704-digit campaign. The record and its\nrunner-up came out of the **salvage walk** over near-miss windows —\nasymmetric gaps that a symmetric ring ladder discards — a channel the\ncost law had not priced; the paper does. All entries were submitted\nunder `mvojvoda` on 2026-09-22 and re-verified by the list's own\nserver; endpoints of the certified batch are ECPP-proven (`records/`).\nEvery find above was **priced before it was hunted**, and the realized\ncosts sit inside the predicted bands — the cost ledger (hardware,\nhours, dollars) is part of the release.\n\nThroughput of record (September 2026, one 4×RTX 5090 box): 44–45k windows/s sustained, ~64k crown-effective, with the CPU nearly idle.\n\n- **Preregistration.** Campaign configs, expected bands, and success\ncriteria are written down (dated) before data collection;\namendments are dated; verdicts (PASS / REFUTED) are filed strictly\n— including the refuted ones.\n- **Gates.** No component touches a real pool before passing a\nknown-answer corpus, a bit-exact comparison against an independent\nimplementation, and a fault-injection drill. Gate scripts live in`gates/` ; the rule \"a green gate on code the gate does not cover is\nworse than no gate\" is enforced culturally and in review.\n- **Lineage.**`LINEAGE.md` maps every canonical tool to its source\nmachine, SHA-256, and the gate that certified it.\n- **Corrections ledger.** Mistakes are filed by name — including the\nAI assistant's — with mechanism and date. Several appear in the\npapers because the*pattern* (underpowered data reads as structure;\ncontrols must finish) is itself a result.\n- **Find files.** Every find is reconstructible from one small text\nfile (k, zd, d, fences); anyone with this repo can re-prove any\nclaim end-to-end.\n\n```\ntools/      canonical operational tools (sieve factory, drivers,\n            walkers, salvage, submission formatter, notary client)\ngates/      known-answer + equivalence + fault-injection gates\nexchange/   the pricing instruments: pricer_v1 (cost law -> GPU-days),\n            merit_price_v0 (bridge-exact certifier), fit_sigma_v1\n            (the unified-law fit), audit + resonance tools\ntheater/    per-campaign configs and loops (raid610, mono, strike24k)\ncuda/       GPU kernel sources (g1_fermat family, gbs.cu GPU sieve) + gate harness\ntools/sieve/ the persistent bucket sieve (C): bsieve.c, bs_api.c, fk_walk.c + referees\nrecords/    what is on the Prime Gap List: submission lines, the treasury by venue,\n            record endpoints, verification chain (certificates ship with the data archive)\ndeploy/kit_v8/ the current kit as deployed (o1_kit v8.57; notes KIT_v8.5x_NOTE.md)\ndocs/       mission, preregistrations, cost calculus, novelty sweep,\n            retrodictions, session handoffs\nhistory/    frozen snapshots of earlier eras (arch2704 construction\n            campaign; full deployed-tool archive) — cited, not run\nLINEAGE.md  the tool provenance table\n```\n\nNot in this repo: the **vault** (find files, ledgers, campaign states,\nraw manifests, databases) ships as a separate data archive with a DOI.\n\n`deploy/kit_v8/` holds the current kit (o1_kit v8.57; KIT_v8.5x_NOTE.md describe each step since v8.54) - the machinery that set the records; `deploy/fresh_box.sh` stands it up (quick start below). `history/kit_v1_2026-08/` is the August kit, kept as history.\n\nThe field already had gap *construction* in the folklore, excellent\nsieves — notably **S. Troisi's combined_sieve\n([arXiv:2012.03771](https://arxiv.org/abs/2012.03771))**, which\nout-sieves ours and is cited with gratitude — numerical record-\nprobability tooling, and the /d trick at the top of the record list.\nWhat we believe is new: the measured fence-rate law and its Buchstab\nidentification, the unified cost law with its e^γ coefficient, the\none-equation design grammar (zd ≈ 1.01·ln n₀), frontier audits of\nexisting records on their own artifacts, and a fully verified,\npriced, reproducible pipeline. All novelty claims are phrased \"to our\nknowledge\"; the audit numbers stand as measurements regardless.\n\n| term | meaning | \n|---|---|\n| **primorial, zd#** | product of all primes ≤ zd | \n| **n₀** | the gap's center: k · zd#/d | \n| **k** | the small free integer scanned; one k = one **window** | \n| **d** | small divisor of zd# (the \"d-axis\" design dial) | \n| **j** | offset from n₀; candidates are n₀ + j | \n| **survivor** | a j with no factor ≤ Q (the sieve bound) | \n| **fence** | first prime found on each side; the gap's endpoints | \n| **merit** | gap / ln(p₁) | \n| **ring / ladder** | nested windows; ks advance outward only while prime-free | \n| **E** | expected fence-primes over a region; cost ≈ e^E windows | \n| **β** | probability a survivor is prime ≈ e^γ·lnQ/ln n₀ | \n| **fold** | verdict-ingestion step; produces per-ring statistics | \n| **finalist** | a k that cleared the whole ladder | \n| **salvage / crumb** | walking discarded ks' certified cores for gaps | \n| **window rate** | windows/second; the campaign's speedometer | \n| **GEC** | Gerbicz error check — per-test hardware-fault detection | \n| **born verified** | interior composite-certified at find time | \n| **claimcheck** | querying the public list + staging queue before submitting | \n| **theater** | one campaign at one height (raid610 / mono / strike24k) | \n| **bank / freeze / parade** | finds are stored, not submitted, until one coordinated release | \n\n*BEACON is M. Vojvoda's campaign (records under the handle mvojvoda).\n\nPython 3.10+, numpy (gmpy2 for verification). GPU path: CUDA 12+ (kernel source in cuda/g1_fermat_v3.cu; built by deploy/fresh_box.sh). CPU-height path: PFGW (sourceforge; expression syntax used throughout).", "url": "https://wpnews.pro/news/show-hn-using-gpus-for-other-bs-than-ai-important-prime-record-for-the-geeks", "canonical_source": "https://github.com/djuk8/beacon/", "published_at": "2026-11-04 22:43:54+00:00", "updated_at": "2026-11-04 23:20:46.840316+00:00", "lang": "en", "topics": ["ai-infrastructure", "developer-tools"], "entities": ["BEACON", "djuk8", "NVIDIA", "CUDA 12", "NVlabs", "CGBN", "Prime Gap List", "RTX 5090"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/show-hn-using-gpus-for-other-bs-than-ai-important-prime-record-for-the-geeks", "markdown": "https://wpnews.pro/news/show-hn-using-gpus-for-other-bs-than-ai-important-prime-record-for-the-geeks.md", "text": "https://wpnews.pro/news/show-hn-using-gpus-for-other-bs-than-ai-important-prime-record-for-the-geeks.txt", "jsonld": "https://wpnews.pro/news/show-hn-using-gpus-for-other-bs-than-ai-important-prime-record-for-the-geeks.jsonld"}}