Skip to content

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

Open

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).

Activity

  1. added
    [scope] bug
    [area] fitting
    [priority] high
    on Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [area] fitting[priority] high[scope] bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions