Repository navigation
Conversation
recreate_sim_state() assigned the vector's length to every element of every custom vector variable instead of the value it had just read. Also skip the custom data lookups and the cycle phase index lookup when create_cells is false, since pCell is never set in that case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the custom-vector restoration and guarded cell-dependent lookups.
No open issues 🎉
What changed in this PR
Fixes custom-vector restoration in PhysiCell’s MultiCellDS resume reader and guards cell-dependent lookups when cell creation is disabled.
Changes:
- Restore each custom-vector element from its saved value instead of the vector length.
- Run custom-data and cycle phase-index lookups only when
create_cellsis true.
| File | Description |
|---|---|
modules/PhysiCell_MultiCellDS.cpp |
Corrects vector restoration and guards cell-dependent lookups. |
Review effort: Balanced
Collaborator
Author
|
@rheiland another case where Claude found this bug. reading the code, I agree that the bug exists (your comments and debug prints both suggest we should be grabbing |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When resuming with
resume_from_MultiCellDS(),recreate_sim_state()wrote each custom vector variable's length into every element instead of the value it had just read, so a resumed 3-element custom vector came back as[3, 3, 3]in every cell. The scalar branch already had this fix.While here, the custom-data lookups and the cycle phase-index lookup now only run when
create_cellsis true. Withcreate_cells=falsethey dereferenced an unsetpCell, and the reader segfaulted partway through the file.🤖 Generated with Claude Code