Skip to content

fix(hex-primality): run deterministic verdict tiers before certificate fuel - #9838

Merged
kim-em merged 2 commits into
mainfrom
issue-9781
Aug 30, 2026
Merged

fix(hex-primality): run deterministic verdict tiers before certificate fuel#9838
kim-em merged 2 commits into
mainfrom
issue-9781

Conversation

@kim-em

@kim-em kim-em commented Aug 30, 2026

Copy link
Copy Markdown
Owner

Closes #9781

Summary

  • run size, complete table, and fixed Miller--Rabin verdict tiers before certificate construction fuel
  • define fuel as constructed-node depth and preserve attempt/Rand accounting across deterministic tiers
  • re-derive low-fuel primality and downstream integer-factor conformance cases, including focused zero/one-fuel API guards
  • document the exact fixed-front-end/recursive-construction boundary in the HexPrimality SPEC

Public behavior

At explicit fuel zero, primeCert? can now return a small table certificate or a proved .composite verdict, and isPrime? can return false for composites decided by its fixed front end. Inputs that pass the fixed front end and require certificate construction still exhaust without consuming attempts or Rand state.

Verification

  • lake build HexPrimality HexConformance
  • lake build HexPrimality +HexPrimality.Conformance (after second-opinion documentation refinements)

Second opinion

Claude Opus found no soundness, termination, or accounting defect and independently reproduced the key low-fuel totals. Its SPEC wording concerns were addressed in f80d47f.

@kim-em
kim-em merged commit 0a9c838 into main Aug 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(hex-primality): run deterministic verdict tiers before certificate fuel

1 participant