Source: https://guthlabs.ai/docs/instruments/prime-checker-generator-sieve/mechanism/

instrument mechanism / verified-with-binding-errata

# Prime Checker & Generator (Sieve) mechanism

The inspectable method record for Prime Checker & Generator (Sieve), kept separate from implementation and qualification.

Status: **VERIFIED_WITH_ERRATA**Lifecycle: **verified-with-binding-errata**

## Model scope

The named algorithms are standard, but the specification is incomplete for a deterministic, testable instrument contract. Exact Miller-Rabin bases/rounds, range endpoint semantics, nth-prime indexing, twin-prime output semantics, integer-size limits, and invalid-input behavior must be defined before approval.

- Miller-Rabin is a valid probabilistic primality algorithm, but the spec does not define the witness-base selection, number of rounds, failure probability, or behavior for small n.

- The sieve formula is named but not fully specified: the implementation must mark composites using prime factors up to floor(sqrt(maximum range endpoint)) and define whether endpoints are included.

- No formula or algorithm is specified for nth-prime generation; indexing is ambiguous because nth prime could be 0-based or 1-based.

- No formula or algorithm is specified for twin-prime finding, including whether the output is pairs, individual primes, or only a boolean and how range boundaries are handled.

- The honest label correctly states that Miller-Rabin is probabilistic for sufficiently large numbers, but it should also identify any deterministic numeric range or the selected bases and error bound.

## Units and conventions

- Inputs are mathematical integers, dimensionless; non-integers and non-finite values must be rejected.

- For these vectors, a range [a,b] is assumed to be inclusive at both endpoints; the spec does not state whether ranges are inclusive or exclusive.

- For these vectors, nth-prime indexing is assumed to be 1-based, so the 1st prime is 2; the spec does not state the indexing convention.

- For JavaScript numeric inputs, exact integer representation is assumed only through 2^53-1 unless arbitrary-precision integers are used; this constraint is not stated.

## Inspectable vector

One of 4 source-bound review vectors:

````
{
  "inputs": {
    "operation": "primality_test",
    "n": 1
  },
  "expected_outputs": {
    "prime": false,
    "classification": "composite"
  },
  "working": "1 is less than 2. By definition, primes are integers greater than 1. Therefore 1 is not prime and the result is composite/non-prime."
}
````

## Failure boundary

**BREAK_CLAIMED** · SELF_FLAGGED

The extreme integer 9007199254740993 cannot be represented exactly by ordinary JavaScript Number arithmetic and silently rounds to 9007199254740992. Accepting it without rejection or exact-integer handling can invalidate primality and range results. The range endpoint convention is also ambiguous unless explicitly defined.

## Other records

[01**Overview**](<https://guthlabs.ai/docs/instruments/prime-checker-generator-sieve/>)[03**Implementation**](<https://guthlabs.ai/docs/instruments/prime-checker-generator-sieve/implementation/>)[04**Qualification**](<https://guthlabs.ai/docs/instruments/prime-checker-generator-sieve/qualification/>)

## Sources and evidence

These pointers bind the page to evidence. They do not grant authority or collapse verification into deployment.

- `VERIFIED_LEDGER.json`

- `evidence-tranche4/tranche4-results.json`

- `BOUNDARY_HAZARD_CATALOG.json`
