Skip to content

Correct sampler conditionals, posterior scores and detector edge cases - #3

Draft
ZacharyHendrix wants to merge 1 commit into
mainfrom
fix/validated-core-sampler
Draft

ZacharyHendrix wants to merge 1 commit into
mainfrom
fix/validated-core-sampler

Conversation

@ZacharyHendrix

Copy link
Copy Markdown
Collaborator

This fixes inconsistent sampler conditionals and incorrect saved posterior scores.

  • Sampler: preserve calibrated background in brightness proposals, refresh accepted-position caches, prevent endpoint likelihood double counting, and keep the MSD conditional consistent with likelihood-only tempering.
  • Scoring: correct the initial-position prior sign, include the brightness prior and count-dependent Gaussian normalizers, score the initial sample, and select finite MAP/MLE candidates with validated burn-in.
  • Detector/activity: stabilize SPAD likelihood calculations, preserve binary activity masks, handle inactive 3D emitters, and exclude nonfinite masked pixels before reduction.

Validation on Windows x64 with Julia 1.12.6: Pkg.test() passed all 511 assertions, including 506 new regressions covering Float32/Float64, SPAD/EMCCD, activity masks, and zero-emitter cases.

An independent one-frame, one-emitter SPAD reference check jointly varied position and brightness. Three chains retained 80,000 draws each; all nine checked moments agreed with numerical integration within 1.109 batch Monte Carlo standard errors. Quadrature refinement and domain-extension checks passed.

GPU validation remains blocked: CUDA.jl compilation fails on a basic broadcast independently of SP2T. Extension loading succeeds, but numerical GPU validation is outstanding. Julia 1.11 and other platforms also need CI.

This draft covers core correctness; reconnection, unknown-count mixing, and broader scientific performance remain separate validation work.

Preserve calibrated background and accepted-position caches, correct endpoint motion-buffer reuse and likelihood-only annealing, and repair stored scores and finite sample selection. Stabilize SPAD likelihoods and inactive-emitter handling.

Validation: 511 CPU assertions pass with Pkg.test(); nine joint-posterior moments agree with independent quadrature within 1.11 batch MCSE. GPU numerical validation remains blocked by a CUDA compilation failure reproduced without SP2T. Association and unknown-count convergence require separate validation.
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.

1 participant