Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZeroCandidatePrime

ZeroCandidatePrime is a Windows x64 research implementation of a consecutive-prime successor generator. The central question is narrow: given a current prime p_n, can the next gap g_n be produced without constructing a natural-number candidate interval and without asking a conventional next-prime routine to participate in the generation step?

The executable separates generation from bootstrap and verification. Traditional routines may establish an input or check a frozen output, but they do not feed candidates, factors, prime tables, or next-prime answers into the successor generator.

Core recurrence

Let q_0 = 2. Define the base survivor distance by

M_0(x) = min { d >= 1 : q_0 does not divide x + d }.

The implementation evaluates this rule directly. It does not use a dedicated odd-only shortcut for q_0.

Higher dimensions are generated by the same survivor mechanism:

q_(k+1) = q_k + M_k(q_k).

For a fixed level k+1, start from the next state that already survived levels 0..k:

d = M_k(x)
y = x + d

If q_(k+1) does not divide y, then M_(k+1)(x) = d. If it does divide y, the recurrence advances again through the lower-level survivor map and accumulates the travelled distance until the first non-hit state is reached.

The requested prime gap is obtained from this nested survivor recurrence. The generator does not materialize p+1, p+2, ... as a candidate array, does not build a candidate-prime pool, and does not assemble a dense or global interaction matrix. The exact 64-bit path closes only after the generated prime dimensions are sufficient for the usual q^2 > candidate exactness condition.

A longer derivation is in docs/ALGORITHM.md.

Execution paths

Direct p validates the supplied prime through an isolated Prime Gate, runs one successor transaction, freezes the result, and only then allows the independent Exact Pass to compare it with a traditional result.

Self Bootstrap starts from (n, p_n) = (1, 2) and repeatedly applies the same successor generator. The live prime-dimension state is rebuilt for each prime-to-prime transaction rather than retained as hidden historical input.

Fast Bootstrap is deliberately outside the generator. It may use primecount --nth-prime when available or the built-in traditional fallback to resolve a starting p_n. Its internal optimizations are not required to imitate the project recurrence.

Record-seeded experiment starts from the exact (n, p_n) anchor embedded in the program and uses 128-bit state with a fixed live-recursion depth cap. Values generated beyond the seed are explicitly PROVISIONAL / UNVERIFIED; this path is an experiment, not an asymptotic-complexity proof.

NVIDIA path

The host side loads the NVIDIA Driver API dynamically from nvcuda.dll. The GPU kernels are written directly in NVIDIA PTX and are embedded into the executable at build time.

  • 256 CUDA lanes participate in the prime-dimension projection used by the NVIDIA path.
  • Integer arithmetic is authoritative; the kernel does not use floating point for the recurrence.
  • Tensor Cores are not used.
  • If NVIDIA hardware is present but the CUDA authority path fails initialization, JIT, self-test, or execution, the program reports the failure instead of silently substituting a CPU numerical answer.
  • If no NVIDIA CUDA device exists, the CPU implementation executes the same recurrence as the fallback path.

source/gpu_kernel.ptx contains the device program. source/gpu_solver.c contains the Driver API host code and launch contract.

Source layout

source/main.c            Win32 UI, task routing, gates and result presentation
source/own_solver.c      CPU implementation of the survivor recurrence
source/gpu_solver.c      NVIDIA Driver API host implementation
source/gpu_kernel.ptx    CUDA/PTX device implementation
source/traditional.c     isolated bootstrap / validation routines
source/winmini.h         minimal Win32 declarations
source/build.sh          freestanding Windows x64 build

The build has no Python dependency. A small host-side C utility converts the checked-in PTX text into the C header embedded by gpu_solver.c.

Scope of the claim

This repository contains an implementation and an experimental representation of the recurrence. It does not claim that constant sequential depth has been proved. Matrix-Free storage, GPU parallelism, and a bounded experimental recursion depth are implementation properties; an asymptotic statement about scale-independent causal depth requires a separate proof.

Platform

  • Windows x64
  • native Win32 executable
  • NVIDIA CUDA Driver path when available
  • CPU fallback when no NVIDIA CUDA device is present
  • no installation required for the application binary

License

MatrixFreeSama Permissive License 2.0 (MFSPL 2.0). See LICENSE.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages