Correct sampler lifecycle and Bayesian posterior evaluation - #1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9dbd8adc08
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
No need to preserve legacy support here, clean it up. |
Stacked on #1. Prepare the first versioned release, 1.0.0, with a header-only CMake export (`best_cpp::best_cpp`) and public Bzlmod target (`@bayes//:best_cpp`). Tests, CLI and benchmark builds are opt-in. No third-party numerical libraries or worker-thread runtime dependencies are imposed on consumers. Add installed CMake and renamed-repository Bazel consumers, independently compiled public headers, and an archive-based temporary BCR registry consumer with checksum verification. The registry generator preserves existing configuration; actual BCR submission waits for a public reviewed release archive. Include model/API documentation, compatibility notes, reproducibility and convergence limitations, release instructions, and a workload-specific performance comparison. Harden CLI parsing, including malformed trailing numeric tokens. Address the parent review finding by clamping initial sigmas to both prior bounds, with a highly imbalanced data regression. Validation: 57 numerical/lifecycle checks; optimized and sanitizer Linux/macOS CI passed in #1. Local CMake library/tests/CLI/benchmark/install and independent consumer passed; Bazel 9.2 regression, renamed consumer and registry archive consumer passed. This PR adds Linux/macOS/Windows CMake CI plus Bazel CI. No tag or package has been published. Addressed the API cleanup requested in #1 (comment): Init accepts only the starting state and log-posterior callback. Removed compatibility cases and updated the benchmark and documentation in the stack.
The current sampler shares one RNG across worker threads, chooses the first accepted speculative proposal, and can stop
Sample(n)before recording n samples. Replace that path with sequential adaptive Metropolis-within-Gibbs: exactly one proposal per coordinate and one retained state per completed sweep. Remove the obsolete thread-count argument from AMWG::Init. Independent chains are the supported parallelism model.Fix model support (both sigma bounds and nu >= 1), log-density underflow, precision loss, temporary observation lifetimes, reinitialization, burn/storage coupling and empty/nonfinite statistics. Add deterministic lifecycle checks, analytic density/posterior references and fixed-seed normal/exponential distribution tests. This deliberately changes inferred results and random sequences; migration details are in CHANGELOG.md.
Validation: optimized C++17 regression tests pass locally; ASan/UBSan passes with all 56 checks on Linux and macOS CI. CI runs optimized and sanitized tests on Linux and macOS. Stacked PR #2 adds portable packaging, independent consumers and release preparation. No release has been published.
Addressed the API cleanup requested in #1 (comment): Init accepts only the starting state and log-posterior callback. Removed compatibility cases and updated the benchmark and documentation in the stack.