Skip to content

refactor(probability): extract exact box rejection sampling - #742

Merged
SamuelSchlesinger merged 2 commits into
mainfrom
feat/rejection-sampling-shared-645
Oct 24, 2026
Merged

SamuelSchlesinger merged 2 commits into
mainfrom
feat/rejection-sampling-shared-645

Conversation

@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator

Closes #737; precedes the #660/#645 protocol refresh under #733.

Extract Probability/RejectionSampling.lean byte-identically from the already reviewed #660 7dfa10ab, preserving its original author, citations and exact finite-PMF API. The direct shared-module test carries the existing box-law examples and axiom guard, plus empty-dimensional and singleton-box boundaries. This proves exact translated-uniform/box rejection laws; it supplies no fair-bit efficiency, simulator or security theorem.

Framework friction: reusable sampling algebra was bundled with a protocol. This preceding shared-home PR lets the protocol and future sampling clients import one API; no parallel probability notion is introduced. Fair-bit realization and full-view/model obligations remain #645/#680, with native extraction in #729.

Validation at de417c22: strict focused shared test passes; all six default gates pass. An initial generated-import ordering failure was corrected using mk_all; a later test attempt encountered read-only local cached outputs, privately materialized in this worktree before the successful full run. Shared caches were not modified. No catalogue statement/scope or renderer changes; abstract impact none.

Preserves the original #660 mathematics/credit and reuses its independent mathematical review 5635805253; independent review of extraction/tests/current integration requested. AI-assisted integration by Codex worker codex-audit-prerequisites-660 under coordinator takeover 6379756339. No self-approval or merge.

Preserve the shared module byte-identically from #660 7dfa10a, retaining original source credit. Move existing box law clients into a direct Probability test, with empty and singleton boundary cases. Refs #737, #645, #733.

Copy link
Copy Markdown
Collaborator Author

Independent coordinator verdict — coordinator-reviewer-codex-20261023 (not Samuel): APPROVED at exact head de417c22cad76fcd6a47f296e712e4133976b7b3.

The extracted 272-line sampler is byte-identical to the already reviewed #660 source; I adopt mathematical review 5635805253 for that unchanged code. The lower Probability placement has no Crypto dependency, source credit/citations are preserved, and the split tests retain the four original box-law examples and axiom guard while adding empty-dimension/singleton boundaries. The API proves exact finite-PMF rejection laws; it makes no fair-bit efficiency, simulator, or security claim. This supplies the preceding shared home required by #733.

Required hosted validation is green: CI 40062167210, with all six Lean gates successful. No abstract selection, statement, scope, or renderer change. No local full-library build was repeated by this reviewer. Recheck the exact head and integration state before enqueueing; a later rebase needs a bounded delta review.

@SamuelSchlesinger
SamuelSchlesinger added this pull request to the merge queue Oct 24, 2026
Merged via the queue into main with commit 5d52521 Oct 24, 2026
2 checks 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.

refactor(probability): extract exact box rejection sampling from lattice protocols

1 participant