Skip to content

generate_bouquet leaks coil regularization + drift bounds onto the TokaMaker object (needs teardown) #13

Description

@d-burg

generate_bouquet installs a strong coil soft-regularization (weight=1e4 swap) and _coil_drift_bounds during draw generation. These live on the TokaMaker object — not the equilibrium — so mygs.replace_eq() does not undo them and they outlive the call.

Measured consequence (2026-08-04, fix/rng-seeding-and-anchor-ip test development): a second in-process run on the same solver lands coil currents ~1.4e-3 apart and l_i ~0.6% apart versus a fresh process. The branch's reproducibility tests work around this with subprocess isolation.

Proposed fix: a teardown (context manager or explicit restore) that snapshots the coil reg/bounds state on entry and restores it on exit of generate_bouquet, so sequential in-process runs (run_slices, notebooks, future solve_point scans) are state-clean. A regression test = two sequential in-process σ=0 runs must be bit-identical.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions