Skip to content

Sampler.extend: increasing thin drops retained draws; Ngen is buffer capacity, not generations #267

@rozyczko

Description

@rozyczko

Findings F-M4, F-M5 in DEEP_ANALYSIS.md (parent #261). Verified against bumps 1.0.4.

  1. sampler.py:446-453 computes old_samples = state.Ngen * state.Npop, but MCMCDraw.Ngen is _gen_draws.shape[0] (allocated capacity); after a short/aborted run this over-requests (benign but wrong accounting).
  2. Retained points live in the thinned buffer sized ceil(n_gen / thinning). Extending a thin=1 chain with the default thin=10 makes resize contract the thin buffer and drop ~90% of previously retained draws — directly contradicting the docstring "guarantees no existing draws are dropped... regardless of the thinning interval" (lines 405-412). thin should default to / be validated against state.thinning.
  3. minimizer_bumps.py:584-589 pop recovery: if the original chain used a fractional scale factor (e.g. pop=2.5, 3 params -> Npop=8), neither ceil nor floor recovery reproduces Npop and DREAM dies with the opaque ValueError("Cannot change Nvar, Npop or Ncr on resize"). Robust fix: pass pop = -resume_state.Npop (bumps absolute-count convention). Also sampler_kwargs can override 'pop' after this resolution (lines 610-611).

Metadata

Metadata

Assignees

No one assigned

    Labels

    [area] fittingUmbrella for fitting related work[priority] highShould be prioritized soon[scope] bugBug report or fix (major.minor.PATCH)
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions