Skip to content

fix: extend patch validation loops to num_patches_max#1599

Draft
SVS87 wants to merge 2 commits into
MFlowCode:masterfrom
SVS87:fix/inactive-patch-validation
Draft

fix: extend patch validation loops to num_patches_max#1599
SVS87 wants to merge 2 commits into
MFlowCode:masterfrom
SVS87:fix/inactive-patch-validation

Conversation

@SVS87

@SVS87 SVS87 commented Jun 15, 2026

Copy link
Copy Markdown

Description

The alteration rights, smoothing, and primitive variable validation loops were bounded by num_patches, making the inactive-patch else branches unreachable. Changed all three loop bounds to num_patches_max to match the geometry loop, so inactive patch slots are validated across all four passes.

Closes #1482

Type of change (delete unused ones)

  • Bug fix

Testing

Ran ./mfc.sh test -j 4 locally on Ubuntu/WSL with GNU compiler and MPI. 578 tests passed, 0 failed. The fix is output-neutral for valid cases — the newly-reached inactive-patch checks only abort on misconfigured inputs that no passing test exercises.

AI code reviews

Reviews are not retriggered automatically. To request a review, comment on the PR:

  • @claude full review — Claude full review (also triggers on PR open/reopen/ready)
  • Or add label claude-full-review — Claude full review via label

The alteration rights, smoothing, and primitive variable validation
loops were bounded by num_patches, making the inactive-patch else
branches unreachable. Changed all three loop bounds to num_patches_max
to match the geometry loop, so inactive patch slots are validated
across all four passes.

Fixes MFlowCode#1482
@SVS87 SVS87 requested a review from sbryngelson as a code owner June 15, 2026 06:42
@sbryngelson sbryngelson marked this pull request as draft June 15, 2026 12:44

@sbryngelson sbryngelson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Traced this and it looks correct and complete. With the bound change, all four validation passes — geometry (already at num_patches_max), alteration rights, smoothing, and flow variables — now iterate over inactive slots too, and each routes them to its inactive/unsupported branch: s_check_inactive_patch_alteration_rights (L102), s_check_unsupported_patch_smoothing via the else at L113-114, and s_check_inactive_patch_primitive_variables (L123). patch_icpp is sized num_patches_max, so the widened loops are in-bounds, and for valid cases the inactive slots hold defaults so the new checks are output-neutral (consistent with the 578-test pass). LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Inactive-patch validation never runs: s_check_patches loops bound at num_patches instead of num_patches_max

2 participants