Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .jules/bolt.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
## 2026-08-30 - Pre-calculate nested spatial loops bounds in CC3D
**Learning:** Checking boundary conditions (e.g., `0 <= x < self.dim.x`) during *every single iteration* inside tightly nested loops degrades performance in operations executed frequently per MCS (like cell removals or checking neighborhood contacts).
**Action:** When a bounding box is known relative to a central coordinate, use `min` and `max` with grid dimensions *outside* the loop to strictly bound the `range()` generators, completely eliminating conditionally evaluated boundary checks inside the innermost loop body.
## 2023-10-27 - CC3D Steppable Safety and Semantics
**Learning:** In CompuCell3D, attempting to optimize `O(N)` loops by combining sequential physics operations (like secretion then degradation) into a single iteration over `self.cell_list` alters the fundamental physics of the simulation by interleaving state updates. Additionally, `self.cell_list` is dynamic; removing dictionary existence checks for `cell.id` on hot paths causes `KeyError` regressions when cells divide.
**Action:** Do not combine sequential loop operations that compute distinct simulation steps. Never remove `cell.id` initialization checks from state dictionaries in hot paths, as cells are dynamically created during the simulation.
Comment on lines +8 to +9