You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No suitable hot-path performance bottlenecks were identified to optimize.
Cold-path initialization routines were identified, but intentionally skipped
to avoid premature optimizations, per Bolt's guidelines. Codebase
integrity and tests verified.
Co-authored-by: NoWon1 <126711057+NoWon1@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
There are correctness gaps in the new/changed steppable logic (notably ECM tracking/removal consistency and a registered chemotaxis steppable that is currently a no-op) plus test isolation/coverage issues that should be addressed before merging.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the CancerInvasion CompuCell3D simulation to use “paper-based” (Kumar et al. 2016) parameters and expands the simulation logic by introducing additional steppables (growth, mitosis, chemotaxis), plus configuration and test scaffolding.
Changes:
Refactors CancerInvasionSteppables.py to use paper parameterization and adds GrowthSteppable, MitosisSteppable, and ChemotaxisSteppable.
Updates CC3D XML configuration (energies, diffusion/decay, and NeighborTracker) and registers new steppables in the runner.
Adds a pytest-based test module with CC3D dependency mocking, plus repo hygiene docs/config (.jules/bolt.md, .gitignore).
File summaries
File
Description
Simulation/CancerInvasionSteppables.py
Switches to paper-based parameters; adds/updates core simulation logic and new steppables.
Simulation/CancerInvasion.xml
Adjusts CC3D configuration to match the updated model assumptions (energies, diffusion/decay, plugins).
Simulation/CancerInvasion.py
Registers additional steppables so they run in the simulation.
tests/test_performance.py
Adds mocked CC3D tests to exercise steppable methods without CC3D runtime.
.jules/bolt.md
Documents CC3D-specific performance guidance (bounds checking and loop-bounding).
.gitignore
Ignores common Python build/test artifacts.
Review details
Suppressed comments (2)
Simulation/CancerInvasionSteppables.py:228
safe_cell_removal clears fiber pixels from cell_field but does not keep fiber_locations in sync, so fiber_locations can retain coordinates that no longer belong to any ECMFiber.
if self.cell_field[x, y, 0] == cell:
self.cell_field[x, y, 0] = None
pixels_cleared += 1
Simulation/CancerInvasionSteppables.py:314
paper_mmp_system removes only the fiber COM coordinate from fiber_locations, but each fiber adds many coordinates; this leaves stale entries behind. If fiber_locations is meant to track all occupied ECM pixels, removal should be coordinated with pixel clearing (e.g., in safe_cell_removal) and this single-point removal should be dropped.
self.safe_cell_removal(fiber)
if (int(fiber.xCOM), int(fiber.yCOM)) in self.fiber_locations:
self.fiber_locations.remove((int(fiber.xCOM), int(fiber.yCOM)))
Replaced `max()` and `min()` calls with conditional `if/else` expressions to evaluate boundary box calculations. Avoids expensive built-in function calls inside a critical hot path (which scales per cell * per cell perimeter check), significantly improving speed.
Co-authored-by: NoWon1 <126711057+NoWon1@users.noreply.github.com>
- Add a `seen` set to `create_paper_fiber` to achieve O(1) membership checks while preserving CC3D C++ array requirements.
- Replace `math.sqrt(dx**2 + dy**2)` with `math.hypot(dx, dy)` in `finish` for natively faster C-level calculations avoiding Python arithmetic overhead.
Co-authored-by: NoWon1 <126711057+NoWon1@users.noreply.github.com>
Replace `list.pop(0)` with `collections.deque(maxlen=N)` for tracking cell velocity history. This avoids the O(N) memory shifting overhead associated with popping from the front of a list, improving performance in the cell dynamics hot loop.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Implement chemotaxis response for nonzero gradients
Simulation/CancerInvasionSteppables.py:487
This steppable is registered and computes an MMP gradient, but the only branch for a nonzero gradient is pass, so no chemotaxis data, force, or cell property is ever changed. As a result cells cannot chemotax despite chemotaxis_strength; configure the Chemotaxis plugin/data and apply the gradient, or do not register this steppable until it has an effect.
Replaced a list allocation with a constant tuple in the hot loop
to avoid redundant allocations and garbage collection overhead.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This is a no-op: the gradient is computed and then discarded, while chemotaxis_strength is never used and no motility or chemotaxis state is updated. Because this steppable is registered every MCS, the new chemotaxis feature currently cannot move cells toward MMP gradients; implement the CC3D motility/chemotaxis update or defer registering this steppable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.