Skip to content

Fix saved simulation reloads and live-viewer cancellation - #62

Draft
georgeoshardo wants to merge 1 commit into
mainfrom
fix/persistence-live-cancel
Draft

Fix saved simulation reloads and live-viewer cancellation#62
georgeoshardo wants to merge 1 commit into
mainfrom
fix/persistence-live-cancel

Conversation

@georgeoshardo

Copy link
Copy Markdown
Owner

What changed

  • Let the custom Pymunk joint classes initialize from either SyMBac cell configuration or the base constructor arguments stored by Pymunk. This restores real saved spaces containing pivot, rotary-limit, and damped-spring joints.
  • Treat closing the live viewer while its worker is active as cancellation. Shutdown now requests a stop, joins the worker without a timeout, and returns without replacing the canonical simulation pickles.
  • Add a one-frame real Simulation save/reload regression and a real-thread cancellation lifecycle regression without opening a GUI.

Root causes

Pymunk unpickles constraints by calling the concrete subclass with its serialized base constructor arguments. The SyMBac wrappers only accepted (segment_a, segment_b, config), so loading a real space_timeseries.p raised TypeError.

The live-viewer cleanup waited at most one second for the worker, then always wrote canonical artifacts. A slow in-progress frame could therefore keep mutating simulation state while a partial run was saved as complete.

Validation

  • pixi run pytest -q tests/test_simulation_persistence.py tests/test_live_viewer.py tests/test_simcell_core.py tests/test_division_manager_split.py — 19 passed
  • pixi run pytest -q — 65 passed, with the existing CPU FFT fallback warning from SyMBac/renderer.py

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