Skip to content

Exclude branches collapsed by zero-impedance breaker merges#303

Open
acostarelli wants to merge 1 commit into
mainfrom
ac/self-loop-bug
Open

Exclude branches collapsed by zero-impedance breaker merges#303
acostarelli wants to merge 1 commit into
mainfrom
ac/self-loop-bug

Conversation

@acostarelli
Copy link
Copy Markdown
Member

No description provided.

The implicit breaker-merge in Ybus construction can map both endpoints of
a parallel non-breaker branch to the same surviving bus, producing a
self-loop arc. This corrupted the incidence matrix and crashed
_build_row_to_cols inside RadialReduction.

Bundle the existing breaker merge and a new collapsed-branch sweep into
_apply_implicit_reductions!. Flag collapsed branches via a skip set that
_get_ybus_two_terminal_ac_branches consults, so they never enter the
matrix. Also harden _build_row_to_cols to error on incomplete rows
instead of returning uninitialized memory.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@acostarelli acostarelli requested a review from m-bossart May 18, 2026 14:28
@github-actions
Copy link
Copy Markdown
Contributor

Performance Results

Precompile Time

Main This Branch Delta
2.156 s 2.148 s -0.4%

Execution Time

Test Main This Branch Delta
matpower_ACTIVSg2000_sys-Build PTDF First 1.671 s 1.741 s +4.2%
matpower_ACTIVSg2000_sys-Build PTDF Second 97.6 ms 180.0 ms +84.4%
matpower_ACTIVSg2000_sys-Build Ybus First 12.5 ms 14.2 ms +13.5%
matpower_ACTIVSg2000_sys-Build Ybus Second 11.0 ms 14.0 ms +27.6%
matpower_ACTIVSg2000_sys-Build LODF First 606.3 ms 543.3 ms -10.4%
matpower_ACTIVSg2000_sys-Build LODF Second 170.5 ms 158.9 ms -6.8%
matpower_ACTIVSg2000_sys-Build VirtualMODF First 3.745 s 5.006 s +33.7%
matpower_ACTIVSg2000_sys-Build VirtualMODF Second 198.2 ms 720.8 ms +263.7%
matpower_ACTIVSg2000_sys-VirtualMODF Query 10 rows 504.2 ms 499.8 ms -0.9%
matpower_ACTIVSg2000_sys-Radial network reduction First 475.9 ms 464.9 ms -2.3%
matpower_ACTIVSg2000_sys-Radial network reduction Second 0.7 ms 0.6 ms -0.2%
matpower_ACTIVSg2000_sys-Degree two network reduction First 1.859 s 1.741 s -6.3%
matpower_ACTIVSg2000_sys-Degree two network reduction Second 1.1 ms 0.9 ms -24.3%
Base_Eastern_Interconnect_515GW-Build Ybus First 3.8 s 3.754 s -1.2%
Base_Eastern_Interconnect_515GW-Build Ybus Second 3.361 s 3.798 s +13.0%
Base_Eastern_Interconnect_515GW-Radial network reduction First 40.6 ms 42.8 ms +5.3%
Base_Eastern_Interconnect_515GW-Radial network reduction Second 39.5 ms 45.5 ms +15.2%
Base_Eastern_Interconnect_515GW-Degree two network reduction First 369.0 ms 367.9 ms -0.3%
Base_Eastern_Interconnect_515GW-Degree two network reduction Second 39.8 ms 33.6 ms -15.6%

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.

1 participant