Native least-prime collision searches #
The search scans the prime bitmap in increasing order. A candidate runs the complete native
three-set collision query. Its first acceptance is retained while the remaining candidates
are visited without further bitmap reads. If no candidate is accepted, the answer is one, matching
ChanHe.minOrOne.
Main definitions #
Search.program: a fixed native prime search using charged collision queries.
Main results #
Search.exec: exact minimum/default selection with native fits, frames and charged cost.Search.preserves_caller: the upper five caller registers are preserved.
Largest candidate prime.
Instances For
Prime bitmap base.
Instances For
Factor multiplied by the candidate prime.
Instances For
Current candidate.
Instances For
One past the largest candidate.
Instances For
Selected prime, or the default one.
Instances For
Whether an acceptance has already occurred.
Instances For
Constant one.
Instances For
Constant zero.
Instances For
Constant two, for positive signed encoding.
Instances For
Unencoded candidate modulus.
Instances For
Bitmap address scratch.
Instances For
Loaded primality bit.
Instances For
Encoded candidate modulus.
Instances For
Acceptance flag returned by the collision query.
Instances For
Compute and encode the candidate modulus, then run the full collision query.
Instances For
Record an accepted candidate, or retain the previous answer.
Instances For
A charged instruction that retains the answer.
Instances For
Load a bitmap entry.
Instances For
Before the first acceptance, run the query exactly on prime candidates.
Instances For
One candidate and its charged cursor increment.
Instances For
Initialize the selector and scan the entire bounded candidate range.
Instances For
The five upper caller registers survive the complete native search.
The least prime whose three actual collision counts satisfy the supplied thresholds.
Every candidate query is executed by Query.program; the hypotheses only constrain native
input values, layout and word fits. All instructions, including the scan after acceptance,
are charged. The final halt is excluded.