Skip to content

Review codebase and implement high-impact fix - #103

Merged
lwJi merged 1 commit into
mainfrom
claude/codebase-review-fix-Otgzo
Jan 15, 2026
Merged

lwJi merged 1 commit into
mainfrom
claude/codebase-review-fix-Otgzo

Conversation

@lwJi

@lwJi lwJi commented Jan 15, 2026

Copy link
Copy Markdown
Owner

Add defensive check before StringPosition call in AMReX.wl and CarpetXGPU.wl. Previously, if a tensorname didn't start with 'd', the code assumed it must contain 'd' somewhere. If this assumption was violated, StringPosition returned {} and [[-1]][[1]] crashed with Part::pkspec1.

Now uses Which[] to explicitly check if 'd' exists in the string before accessing its position, and throws a clear error message if the derivative tensor name is malformed.

Add defensive check before StringPosition call in AMReX.wl and
CarpetXGPU.wl. Previously, if a tensorname didn't start with 'd',
the code assumed it must contain 'd' somewhere. If this assumption
was violated, StringPosition returned {} and [[-1]][[1]] crashed
with Part::pkspec1.

Now uses Which[] to explicitly check if 'd' exists in the string
before accessing its position, and throws a clear error message
if the derivative tensor name is malformed.
@lwJi
lwJi merged commit e193ce2 into main Jan 15, 2026
1 check passed
@lwJi
lwJi deleted the claude/codebase-review-fix-Otgzo branch January 15, 2026 14:08
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.

2 participants