Skip to content

Fix growth, division, and physics invariants - #61

Draft
georgeoshardo wants to merge 1 commit into
mainfrom
fix/growth-physics-invariants
Draft

Fix growth, division, and physics invariants#61
georgeoshardo wants to merge 1 commit into
mainfrom
fix/growth-physics-invariants

Conversation

@georgeoshardo

Copy link
Copy Markdown
Owner

What changed

  • Let continuous-length cells keep growing until they contain enough segments for two viable daughters.
  • Preserve growth-threshold overshoot and insert every segment implied by an update.
  • Validate timestep, septum duration, granularity, solver iterations, damping, viable segment counts, and lysis probability before Pymunk receives them.
  • Recompute rotational moment and reindex the Pymunk shape whenever segment radius changes.
  • Preflight both cells before overlap trimming, restore adaptive iterations to the configured baseline, and randomize lysis candidate order.

Why

Continuous length and segment-count division readiness could disagree permanently: growth stopped at the length threshold even when the cell did not contain enough segments to split. Separate state updates also discarded growth overshoot, left Pymunk inertia and spatial indexing stale after radius changes, could trim only one side of a mother-daughter pair, decayed solver iterations toward a hard-coded value, and favored cells late in colony list order during lysis.

Validation

  • pixi run pytest -q tests/test_growth_physics_invariants.py tests/test_physics_config_validation.py tests/test_substeps_validation.py tests/test_colony_overlap.py — 57 passed
  • pixi run pytest -q tests/test_simcell_core.py tests/test_division_manager_split.py tests/test_physics_config_validation.py tests/test_colony_overlap.py tests/test_substeps_validation.py tests/test_simulation_persistence.py tests/test_growth_physics_invariants.py — 73 passed
  • pixi run pytest -q — 86 passed, with the existing CPU FFT fallback warning

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