========================================
=== TESTING CONFIG: config3 ===
========================================
  Parameters:
    h (depth): 1.9
    m0 (wavenum): 1.0
    a (radii): [0.3 0.5 1.  1.2 1.6]
    d (drafts): [0.5 0.7 0.8 0.2 0.5]

  [SUPERPOSITION START] Combining 5 active bodies...

[POTENTIAL MATRIX AUDIT] Boundary 0 (CONTRACTION (Step Up))
  Depth L vs R : 1.4000 vs 1.2000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 0 (CONTRACTION (Step Up))
  Depth L vs R : 1.4000 vs 1.2000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 1 (CONTRACTION (Step Up))
  Depth L vs R : 1.2000 vs 1.1000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 1 (CONTRACTION (Step Up))
  Depth L vs R : 1.2000 vs 1.1000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 2 (EXPANSION (Step Down))
  Depth L vs R : 1.1000 vs 1.7000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)

[POTENTIAL MATRIX AUDIT] Boundary 2 (EXPANSION (Step Down))
  Depth L vs R : 1.1000 vs 1.7000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)

[POTENTIAL MATRIX AUDIT] Boundary 3 (CONTRACTION (Step Up))
  Depth L vs R : 1.7000 vs 1.4000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 3 (CONTRACTION (Step Up))
  Depth L vs R : 1.7000 vs 1.4000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 4 (EXPANSION (Step Down))
  Depth L vs R : 1.4000 vs 1.9000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)

[POTENTIAL MATRIX AUDIT] Boundary 4 (EXPANSION (Step Down))
  Depth L vs R : 1.4000 vs 1.9000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)

  [DEPTH CONSISTENCY CHECK]
    Global Geometry h: 1.9
    Region 0 (Index 0):
      Global h (Geometry) : 1.9000
      Global h (Domain)   : 1.9000  ✅
      Draft d (Domain)    : 0.5000
      Local Depth (h - d) : 1.4000
    Region 1 (Index 1):
      Global h (Geometry) : 1.9000
      Global h (Domain)   : 1.9000  ✅
      Draft d (Domain)    : 0.7000
      Local Depth (h - d) : 1.2000
    Region 2 (Index 2):
      Global h (Geometry) : 1.9000
      Global h (Domain)   : 1.9000  ✅
      Draft d (Domain)    : 0.8000
      Local Depth (h - d) : 1.1000
    Region 3 (Index 3):
      Global h (Geometry) : 1.9000
      Global h (Domain)   : 1.9000  ✅
      Draft d (Domain)    : 0.2000
      Local Depth (h - d) : 1.7000
    Region 4 (Index 4):
      Global h (Geometry) : 1.9000
      Global h (Domain)   : 1.9000  ✅
      Draft d (Domain)    : 0.5000
      Local Depth (h - d) : 1.4000
    Region 5 (Index 5):
      Global h (Geometry) : 1.9000
      Global h (Domain)   : 1.9000  ✅
      Draft d (Domain)    : 0.0000
      Local Depth (h - d) : 1.9000

  [DEBUG] Running Orthogonality Checks for 6 regions...

  [ORTHOGONALITY CHECK] Region 0
    Type: Interior (d=0.5, h=1.9)
    Inner Products <Zm, Zn> (Expect Diag ~ h-d, Off-Diag ~ 0):
    m=0: [  1.4000e+00   0.0000e+00   0.0000e+00  ]
    m=1: [  0.0000e+00   1.4000e+00   0.0000e+00  ]
    m=2: [  0.0000e+00   0.0000e+00   1.4000e+00  ]
    (Theoretical H-d = 1.4000)

  [ORTHOGONALITY CHECK] Region 1
    Type: Interior (d=0.7, h=1.9)
    Inner Products <Zm, Zn> (Expect Diag ~ h-d, Off-Diag ~ 0):
    m=0: [  1.2000e+00   0.0000e+00   0.0000e+00  ]
    m=1: [  0.0000e+00   1.2000e+00   0.0000e+00  ]
    m=2: [  0.0000e+00   0.0000e+00   1.2000e+00  ]
    (Theoretical H-d = 1.2000)

  [ORTHOGONALITY CHECK] Region 2
    Type: Interior (d=0.8, h=1.9)
    Inner Products <Zm, Zn> (Expect Diag ~ h-d, Off-Diag ~ 0):
    m=0: [  1.1000e+00   0.0000e+00   0.0000e+00  ]
    m=1: [  0.0000e+00   1.1000e+00   0.0000e+00  ]
    m=2: [  0.0000e+00   0.0000e+00   1.1000e+00  ]
    (Theoretical H-d = 1.1000)

  [ORTHOGONALITY CHECK] Region 3
    Type: Interior (d=0.2, h=1.9)
    Inner Products <Zm, Zn> (Expect Diag ~ h-d, Off-Diag ~ 0):
    m=0: [  1.7000e+00   0.0000e+00   0.0000e+00  ]
    m=1: [  0.0000e+00   1.7000e+00   0.0000e+00  ]
    m=2: [  0.0000e+00   0.0000e+00   1.7000e+00  ]
    (Theoretical H-d = 1.7000)

  [ORTHOGONALITY CHECK] Region 4
    Type: Interior (d=0.5, h=1.9)
    Inner Products <Zm, Zn> (Expect Diag ~ h-d, Off-Diag ~ 0):
    m=0: [  1.4000e+00   0.0000e+00   0.0000e+00  ]
    m=1: [  0.0000e+00   1.4000e+00   0.0000e+00  ]
    m=2: [  0.0000e+00   0.0000e+00   1.4000e+00  ]
    (Theoretical H-d = 1.4000)

  [ORTHOGONALITY CHECK] Region 5
    Type: Exterior (d=0.0, h=1.9)
    Inner Products <Zm, Zn> (Expect Diag ~ h-d, Off-Diag ~ 0):
    m=0: [  1.9000e+00   0.0000e+00   0.0000e+00  ]
    m=1: [  0.0000e+00   1.9000e+00   0.0000e+00  ]
    m=2: [  0.0000e+00   0.0000e+00   1.9000e+00  ]
    (Theoretical H-d = 1.9000)
    [Diagnosing Linear System for config3]
  [Matrix Plot saved to: /Users/hopebest/Documents/semi-analytical-hydro/package/test_artifacts/config3_matrix_A.png]
      [Matrix Info] Size: (400, 400) | Condition Num: 1.3024e+03

  [CONTINUITY DIAGNOSTIC - FLUX] config3
    Boundary 0 (R=0.30): ✅ PASS
      Common Height: 0.70
      RMS Vel Diff : 1.0372e+00
      Rel Flux Err : 0.00%
      Step Check (Left (Reg 0)): ✅
      Avg Leak Vel : -5.9002e-02
      Step Height  : 0.2000
    Boundary 1 (R=0.50): ✅ PASS
      Common Height: 0.80
      RMS Vel Diff : 3.0691e-01
      Rel Flux Err : 0.00%
      Step Check (Left (Reg 1)): ✅
      Avg Leak Vel : -3.2938e-02
      Step Height  : 0.1000
    Boundary 2 (R=1.00): ✅ PASS
      Common Height: 0.80
      RMS Vel Diff : 8.8568e-02
      Rel Flux Err : 0.00%
      Step Check (Right (Reg 3)): ✅
      Avg Leak Vel : -2.2771e-03
      Step Height  : 0.6000
    Boundary 3 (R=1.20): ✅ PASS
      Common Height: 0.50
      RMS Vel Diff : 1.3362e-02
      Rel Flux Err : 0.00%
      Step Check (Left (Reg 3)): ✅
      Avg Leak Vel : -7.4906e-04
      Step Height  : 0.3000
    Boundary 4 (R=1.60): ✅ PASS
      Common Height: 0.50
      RMS Vel Diff : 3.9482e-02
      Rel Flux Err : 0.00%

  [CONTINUITY DIAGNOSTIC - POTENTIAL] config3

[DEBUG] Region 1 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.10424099+1.02163926e-02j -0.00530177-1.01874886e-04j
  0.00376538-4.42745998e-06j] ...
R2 coefficients (Cs[NMK:]): [-0.17924099-1.02163926e-02j -0.03344102+4.09287308e-08j
  0.01443681-6.27625588e-08j] ...
[DEBUG] Region 1 mask count: 0

[DEBUG] Region 2 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.08182092+1.16246992e-02j  0.00186566-2.74952994e-04j
 -0.00064689+4.97757520e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.16363911-1.16246992e-02j -0.01673802+4.41516625e-07j
  0.00520099-4.65967662e-07j] ...
[DEBUG] Region 2 mask count: 0

[DEBUG] Region 3 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.02399093+8.72055745e-03j -0.00076618-5.27279376e-04j
  0.00072391-5.17353588e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.07693211-8.72055745e-03j  0.00412443-9.54125088e-05j
 -0.00328406+5.82005143e-05j] ...
[DEBUG] Region 3 mask count: 0

[DEBUG] Region 4 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.0205036 +0.00908332j  0.00165125-0.00105635j -0.00050738+0.00029925j] ...
R2 coefficients (Cs[NMK:]): [-0.08478932-9.08331560e-03j  0.00062173-3.46263894e-05j
 -0.00098932+1.88561499e-05j] ...
[DEBUG] Region 4 mask count: 0

[DEBUG] Region 1 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.10424099+1.02163926e-02j -0.00530177-1.01874886e-04j
  0.00376538-4.42745998e-06j] ...
R2 coefficients (Cs[NMK:]): [-0.17924099-1.02163926e-02j -0.03344102+4.09287308e-08j
  0.01443681-6.27625588e-08j] ...
[DEBUG] Region 1 mask count: 50
Region 1 min/max R: 0.3001/0.3001
R1n_vals max: 7.8590e-01
R2n_vals max: 9.9960e-01

[DEBUG] Region 2 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.08182092+1.16246992e-02j  0.00186566-2.74952994e-04j
 -0.00064689+4.97757520e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.16363911-1.16246992e-02j -0.01673802+4.41516625e-07j
  0.00520099-4.65967662e-07j] ...
[DEBUG] Region 2 mask count: 0

[DEBUG] Region 3 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.02399093+8.72055745e-03j -0.00076618-5.27279376e-04j
  0.00072391-5.17353588e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.07693211-8.72055745e-03j  0.00412443-9.54125088e-05j
 -0.00328406+5.82005143e-05j] ...
[DEBUG] Region 3 mask count: 0

[DEBUG] Region 4 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.0205036 +0.00908332j  0.00165125-0.00105635j -0.00050738+0.00029925j] ...
R2 coefficients (Cs[NMK:]): [-0.08478932-9.08331560e-03j  0.00062173-3.46263894e-05j
 -0.00098932+1.88561499e-05j] ...
[DEBUG] Region 4 mask count: 0

[DEBUG] Region 1 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.10424099+1.02163926e-02j -0.00530177-1.01874886e-04j
  0.00376538-4.42745998e-06j] ...
R2 coefficients (Cs[NMK:]): [-0.17924099-1.02163926e-02j -0.03344102+4.09287308e-08j
  0.01443681-6.27625588e-08j] ...
[DEBUG] Region 1 mask count: 50
Region 1 min/max R: 0.4999/0.4999
R1n_vals max: 9.9990e-01
R2n_vals max: 4.7572e-01

[DEBUG] Region 2 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.08182092+1.16246992e-02j  0.00186566-2.74952994e-04j
 -0.00064689+4.97757520e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.16363911-1.16246992e-02j -0.01673802+4.41516625e-07j
  0.00520099-4.65967662e-07j] ...
[DEBUG] Region 2 mask count: 0

[DEBUG] Region 3 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.02399093+8.72055745e-03j -0.00076618-5.27279376e-04j
  0.00072391-5.17353588e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.07693211-8.72055745e-03j  0.00412443-9.54125088e-05j
 -0.00328406+5.82005143e-05j] ...
[DEBUG] Region 3 mask count: 0

[DEBUG] Region 4 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.0205036 +0.00908332j  0.00165125-0.00105635j -0.00050738+0.00029925j] ...
R2 coefficients (Cs[NMK:]): [-0.08478932-9.08331560e-03j  0.00062173-3.46263894e-05j
 -0.00098932+1.88561499e-05j] ...
[DEBUG] Region 4 mask count: 0

[DEBUG] Region 1 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.10424099+1.02163926e-02j -0.00530177-1.01874886e-04j
  0.00376538-4.42745998e-06j] ...
R2 coefficients (Cs[NMK:]): [-0.17924099-1.02163926e-02j -0.03344102+4.09287308e-08j
  0.01443681-6.27625588e-08j] ...
[DEBUG] Region 1 mask count: 0

[DEBUG] Region 2 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.08182092+1.16246992e-02j  0.00186566-2.74952994e-04j
 -0.00064689+4.97757520e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.16363911-1.16246992e-02j -0.01673802+4.41516625e-07j
  0.00520099-4.65967662e-07j] ...
[DEBUG] Region 2 mask count: 50
Region 2 min/max R: 0.5001/0.5001
R1n_vals max: 6.5353e-01
R2n_vals max: 9.9963e-01

[DEBUG] Region 3 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.02399093+8.72055745e-03j -0.00076618-5.27279376e-04j
  0.00072391-5.17353588e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.07693211-8.72055745e-03j  0.00412443-9.54125088e-05j
 -0.00328406+5.82005143e-05j] ...
[DEBUG] Region 3 mask count: 0

[DEBUG] Region 4 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.0205036 +0.00908332j  0.00165125-0.00105635j -0.00050738+0.00029925j] ...
R2 coefficients (Cs[NMK:]): [-0.08478932-9.08331560e-03j  0.00062173-3.46263894e-05j
 -0.00098932+1.88561499e-05j] ...
[DEBUG] Region 4 mask count: 0

[DEBUG] Region 1 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.10424099+1.02163926e-02j -0.00530177-1.01874886e-04j
  0.00376538-4.42745998e-06j] ...
R2 coefficients (Cs[NMK:]): [-0.17924099-1.02163926e-02j -0.03344102+4.09287308e-08j
  0.01443681-6.27625588e-08j] ...
[DEBUG] Region 1 mask count: 0

[DEBUG] Region 2 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.08182092+1.16246992e-02j  0.00186566-2.74952994e-04j
 -0.00064689+4.97757520e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.16363911-1.16246992e-02j -0.01673802+4.41516625e-07j
  0.00520099-4.65967662e-07j] ...
[DEBUG] Region 2 mask count: 50
Region 2 min/max R: 0.9999/0.9999
R1n_vals max: 9.9995e-01
R2n_vals max: 3.4652e-01

[DEBUG] Region 3 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.02399093+8.72055745e-03j -0.00076618-5.27279376e-04j
  0.00072391-5.17353588e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.07693211-8.72055745e-03j  0.00412443-9.54125088e-05j
 -0.00328406+5.82005143e-05j] ...
[DEBUG] Region 3 mask count: 0

[DEBUG] Region 4 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.0205036 +0.00908332j  0.00165125-0.00105635j -0.00050738+0.00029925j] ...
R2 coefficients (Cs[NMK:]): [-0.08478932-9.08331560e-03j  0.00062173-3.46263894e-05j
 -0.00098932+1.88561499e-05j] ...
[DEBUG] Region 4 mask count: 0

[DEBUG] Region 1 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.10424099+1.02163926e-02j -0.00530177-1.01874886e-04j
  0.00376538-4.42745998e-06j] ...
R2 coefficients (Cs[NMK:]): [-0.17924099-1.02163926e-02j -0.03344102+4.09287308e-08j
  0.01443681-6.27625588e-08j] ...
[DEBUG] Region 1 mask count: 0

[DEBUG] Region 2 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.08182092+1.16246992e-02j  0.00186566-2.74952994e-04j
 -0.00064689+4.97757520e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.16363911-1.16246992e-02j -0.01673802+4.41516625e-07j
  0.00520099-4.65967662e-07j] ...
[DEBUG] Region 2 mask count: 0

[DEBUG] Region 3 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.02399093+8.72055745e-03j -0.00076618-5.27279376e-04j
  0.00072391-5.17353588e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.07693211-8.72055745e-03j  0.00412443-9.54125088e-05j
 -0.00328406+5.82005143e-05j] ...
[DEBUG] Region 3 mask count: 50
Region 3 min/max R: 1.0001/1.0001
R1n_vals max: 9.0889e-01
R2n_vals max: 9.9977e-01
🚨 Expansion region 3 has nonzero R1 coeffs at indices [ 0  1  2  3  4  5  7  8  9 10 11 13 14 15 16 20]: [ 2.39909300e-02+8.72055745e-03j -7.66182947e-04-5.27279376e-04j
  7.23907755e-04-5.17353588e-05j -4.08699329e-04+5.19387597e-05j
  1.97003360e-04-2.54510600e-05j -6.66381962e-05+8.28264610e-06j
  4.44611295e-05-4.33537942e-06j -5.42973434e-05+5.12075258e-06j
  4.70719037e-05-4.28019260e-06j -3.07344078e-05+2.69532965e-06j
  1.18742368e-05-9.80126012e-07j -1.54517875e-05+1.36537641e-06j
  1.97119947e-05-1.69442917e-06j -1.79019524e-05+1.50913836e-06j
  1.18243114e-05-9.74881676e-07j -1.06700382e-05+8.90451778e-07j]
[DEBUG] Expansion region 3 phiH stats: min=0.021663857492631958, max=0.02346278815026505

[DEBUG] Region 4 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.0205036 +0.00908332j  0.00165125-0.00105635j -0.00050738+0.00029925j] ...
R2 coefficients (Cs[NMK:]): [-0.08478932-9.08331560e-03j  0.00062173-3.46263894e-05j
 -0.00098932+1.88561499e-05j] ...
[DEBUG] Region 4 mask count: 0

[DEBUG] Region 1 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.10424099+1.02163926e-02j -0.00530177-1.01874886e-04j
  0.00376538-4.42745998e-06j] ...
R2 coefficients (Cs[NMK:]): [-0.17924099-1.02163926e-02j -0.03344102+4.09287308e-08j
  0.01443681-6.27625588e-08j] ...
[DEBUG] Region 1 mask count: 0

[DEBUG] Region 2 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.08182092+1.16246992e-02j  0.00186566-2.74952994e-04j
 -0.00064689+4.97757520e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.16363911-1.16246992e-02j -0.01673802+4.41516625e-07j
  0.00520099-4.65967662e-07j] ...
[DEBUG] Region 2 mask count: 0

[DEBUG] Region 3 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.02399093+8.72055745e-03j -0.00076618-5.27279376e-04j
  0.00072391-5.17353588e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.07693211-8.72055745e-03j  0.00412443-9.54125088e-05j
 -0.00328406+5.82005143e-05j] ...
[DEBUG] Region 3 mask count: 50
Region 3 min/max R: 1.1999/1.1999
R1n_vals max: 9.9996e-01
R2n_vals max: 6.3598e-01
🚨 Expansion region 3 has nonzero R1 coeffs at indices [ 0  1  2  3  4  5  7  8  9 10 11 13 14 15 16 20]: [ 2.39909300e-02+8.72055745e-03j -7.66182947e-04-5.27279376e-04j
  7.23907755e-04-5.17353588e-05j -4.08699329e-04+5.19387597e-05j
  1.97003360e-04-2.54510600e-05j -6.66381962e-05+8.28264610e-06j
  4.44611295e-05-4.33537942e-06j -5.42973434e-05+5.12075258e-06j
  4.70719037e-05-4.28019260e-06j -3.07344078e-05+2.69532965e-06j
  1.18742368e-05-9.80126012e-07j -1.54517875e-05+1.36537641e-06j
  1.97119947e-05-1.69442917e-06j -1.79019524e-05+1.50913836e-06j
  1.18243114e-05-9.74881676e-07j -1.06700382e-05+8.90451778e-07j]
[DEBUG] Expansion region 3 phiH stats: min=0.025232772042699015, max=0.026844522646784053

[DEBUG] Region 4 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.0205036 +0.00908332j  0.00165125-0.00105635j -0.00050738+0.00029925j] ...
R2 coefficients (Cs[NMK:]): [-0.08478932-9.08331560e-03j  0.00062173-3.46263894e-05j
 -0.00098932+1.88561499e-05j] ...
[DEBUG] Region 4 mask count: 0

[DEBUG] Region 1 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.10424099+1.02163926e-02j -0.00530177-1.01874886e-04j
  0.00376538-4.42745998e-06j] ...
R2 coefficients (Cs[NMK:]): [-0.17924099-1.02163926e-02j -0.03344102+4.09287308e-08j
  0.01443681-6.27625588e-08j] ...
[DEBUG] Region 1 mask count: 0

[DEBUG] Region 2 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.08182092+1.16246992e-02j  0.00186566-2.74952994e-04j
 -0.00064689+4.97757520e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.16363911-1.16246992e-02j -0.01673802+4.41516625e-07j
  0.00520099-4.65967662e-07j] ...
[DEBUG] Region 2 mask count: 0

[DEBUG] Region 3 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.02399093+8.72055745e-03j -0.00076618-5.27279376e-04j
  0.00072391-5.17353588e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.07693211-8.72055745e-03j  0.00412443-9.54125088e-05j
 -0.00328406+5.82005143e-05j] ...
[DEBUG] Region 3 mask count: 0

[DEBUG] Region 4 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.0205036 +0.00908332j  0.00165125-0.00105635j -0.00050738+0.00029925j] ...
R2 coefficients (Cs[NMK:]): [-0.08478932-9.08331560e-03j  0.00062173-3.46263894e-05j
 -0.00098932+1.88561499e-05j] ...
[DEBUG] Region 4 mask count: 50
Region 4 min/max R: 1.2001/1.2001
R1n_vals max: 8.5620e-01
R2n_vals max: 9.9974e-01

[DEBUG] Region 1 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.10424099+1.02163926e-02j -0.00530177-1.01874886e-04j
  0.00376538-4.42745998e-06j] ...
R2 coefficients (Cs[NMK:]): [-0.17924099-1.02163926e-02j -0.03344102+4.09287308e-08j
  0.01443681-6.27625588e-08j] ...
[DEBUG] Region 1 mask count: 0

[DEBUG] Region 2 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.08182092+1.16246992e-02j  0.00186566-2.74952994e-04j
 -0.00064689+4.97757520e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.16363911-1.16246992e-02j -0.01673802+4.41516625e-07j
  0.00520099-4.65967662e-07j] ...
[DEBUG] Region 2 mask count: 0

[DEBUG] Region 3 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.02399093+8.72055745e-03j -0.00076618-5.27279376e-04j
  0.00072391-5.17353588e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.07693211-8.72055745e-03j  0.00412443-9.54125088e-05j
 -0.00328406+5.82005143e-05j] ...
[DEBUG] Region 3 mask count: 0

[DEBUG] Region 4 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.0205036 +0.00908332j  0.00165125-0.00105635j -0.00050738+0.00029925j] ...
R2 coefficients (Cs[NMK:]): [-0.08478932-9.08331560e-03j  0.00062173-3.46263894e-05j
 -0.00098932+1.88561499e-05j] ...
[DEBUG] Region 4 mask count: 50
Region 4 min/max R: 1.5999/1.5999
R1n_vals max: 9.9997e-01
R2n_vals max: 3.5624e-01

[DEBUG] Region 1 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.10424099+1.02163926e-02j -0.00530177-1.01874886e-04j
  0.00376538-4.42745998e-06j] ...
R2 coefficients (Cs[NMK:]): [-0.17924099-1.02163926e-02j -0.03344102+4.09287308e-08j
  0.01443681-6.27625588e-08j] ...
[DEBUG] Region 1 mask count: 0

[DEBUG] Region 2 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.08182092+1.16246992e-02j  0.00186566-2.74952994e-04j
 -0.00064689+4.97757520e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.16363911-1.16246992e-02j -0.01673802+4.41516625e-07j
  0.00520099-4.65967662e-07j] ...
[DEBUG] Region 2 mask count: 0

[DEBUG] Region 3 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.02399093+8.72055745e-03j -0.00076618-5.27279376e-04j
  0.00072391-5.17353588e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.07693211-8.72055745e-03j  0.00412443-9.54125088e-05j
 -0.00328406+5.82005143e-05j] ...
[DEBUG] Region 3 mask count: 0

[DEBUG] Region 4 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.0205036 +0.00908332j  0.00165125-0.00105635j -0.00050738+0.00029925j] ...
R2 coefficients (Cs[NMK:]): [-0.08478932-9.08331560e-03j  0.00062173-3.46263894e-05j
 -0.00098932+1.88561499e-05j] ...
[DEBUG] Region 4 mask count: 0

  [MATRIX BALANCE AUDIT - 6️⃣ KILLER CHECK] config3

[POTENTIAL MATRIX AUDIT] Boundary 0 (CONTRACTION (Step Up))
  Depth L vs R : 1.4000 vs 1.2000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 0 (CONTRACTION (Step Up))
  Depth L vs R : 1.4000 vs 1.2000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)
    Boundary 0 (Project on RIGHT):
      Matrix Imbalance: 1.3893e-17
      ✅ PASS

[POTENTIAL MATRIX AUDIT] Boundary 1 (CONTRACTION (Step Up))
  Depth L vs R : 1.2000 vs 1.1000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 1 (CONTRACTION (Step Up))
  Depth L vs R : 1.2000 vs 1.1000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)
    Boundary 1 (Project on RIGHT):
      Matrix Imbalance: 7.8274e-17
      ✅ PASS

[POTENTIAL MATRIX AUDIT] Boundary 2 (EXPANSION (Step Down))
  Depth L vs R : 1.1000 vs 1.7000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)

[POTENTIAL MATRIX AUDIT] Boundary 2 (EXPANSION (Step Down))
  Depth L vs R : 1.1000 vs 1.7000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)
    Boundary 2 (Project on LEFT):
      Matrix Imbalance: 1.5505e-17
      ✅ PASS

[POTENTIAL MATRIX AUDIT] Boundary 3 (CONTRACTION (Step Up))
  Depth L vs R : 1.7000 vs 1.4000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 3 (CONTRACTION (Step Up))
  Depth L vs R : 1.7000 vs 1.4000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)
    Boundary 3 (Project on RIGHT):
      Matrix Imbalance: 7.1524e-18
      ✅ PASS
    Boundary 4: Skipping (Exterior Boundary handled by different functions)

    [COEFFICIENT DECAY CHECK] config3
      Reg 0 (Inner): Head(avg3)=1.09e-01 | Tail(avg3)=1.10e-04 | Ratio=1.01e-03
      Reg 1 (Annulus):
        R1: Head=3.79e-02 | Tail=1.70e-05
        R2: Head=7.58e-02 | Tail=2.18e-04
      Reg 2 (Annulus):
        R1: Head=2.84e-02 | Tail=1.00e-05
        R2: Head=6.20e-02 | Tail=5.79e-05
      Reg 3 (Annulus):
        R1: Head=9.06e-03 | Tail=3.34e-06
        R2: Head=2.83e-02 | Tail=1.26e-05
      Reg 4 (Annulus):
        R1: Head=8.32e-03 | Tail=7.03e-06
        R2: Head=2.90e-02 | Tail=2.19e-06
      Reg 5 (Outer): Head(avg3)=6.25e-03 | Tail(avg3)=7.13e-06 | Ratio=1.14e-03

[DEBUG] Region 1 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.10424099+1.02163926e-02j -0.00530177-1.01874886e-04j
  0.00376538-4.42745998e-06j] ...
R2 coefficients (Cs[NMK:]): [-0.17924099-1.02163926e-02j -0.03344102+4.09287308e-08j
  0.01443681-6.27625588e-08j] ...
[DEBUG] Region 1 mask count: 150
Region 1 min/max R: 0.326530612244898/0.4571428571428572
R1n_vals max: 9.5519e-01
R2n_vals max: 9.0024e-01

[DEBUG] Region 2 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.08182092+1.16246992e-02j  0.00186566-2.74952994e-04j
 -0.00064689+4.97757520e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.16363911-1.16246992e-02j -0.01673802+4.41516625e-07j
  0.00520099-4.65967662e-07j] ...
[DEBUG] Region 2 mask count: 400
Region 2 min/max R: 0.5224489795918368/0.979591836734694
R1n_vals max: 9.8969e-01
R2n_vals max: 9.1974e-01

[DEBUG] Region 3 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.02399093+8.72055745e-03j -0.00076618-5.27279376e-04j
  0.00072391-5.17353588e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.07693211-8.72055745e-03j  0.00412443-9.54125088e-05j
 -0.00328406+5.82005143e-05j] ...
[DEBUG] Region 3 mask count: 150
Region 3 min/max R: 1.0448979591836736/1.1755102040816328
R1n_vals max: 9.8969e-01
R2n_vals max: 9.0220e-01

=== MODE CONTRIBUTIONS @ BAD POINT ===
n=0:
  R1 contrib = +2.3744e-02
  R2 contrib = -6.2200e-03
n=1:
  R1 contrib = +1.0466e-03
  R2 contrib = -3.9102e-03
n=2:
  R1 contrib = +9.3876e-04
  R2 contrib = -2.2321e-03
n=3:
  R1 contrib = +5.0174e-04
  R2 contrib = -4.2807e-05
n=4:
  R1 contrib = +2.2815e-04
  R2 contrib = +3.0750e-04

Partial sums:
  Σ R1 = +2.645879e-02
  Σ R2 = -1.209762e-02
  Σ total = +1.436117e-02

=== RECONSTRUCTION DECISION ===
Region 3
is_expansion = True
Used contribution (R1 only) = +2.645879e-02
Alternative contribution (R2 only) = -1.209762e-02
🚨 Expansion region 3 has nonzero R1 coeffs at indices [ 0  1  2  3  4  5  7  8  9 10 11 13 14 15 16 20]: [ 2.39909300e-02+8.72055745e-03j -7.66182947e-04-5.27279376e-04j
  7.23907755e-04-5.17353588e-05j -4.08699329e-04+5.19387597e-05j
  1.97003360e-04-2.54510600e-05j -6.66381962e-05+8.28264610e-06j
  4.44611295e-05-4.33537942e-06j -5.42973434e-05+5.12075258e-06j
  4.70719037e-05-4.28019260e-06j -3.07344078e-05+2.69532965e-06j
  1.18742368e-05-9.80126012e-07j -1.54517875e-05+1.36537641e-06j
  1.97119947e-05-1.69442917e-06j -1.79019524e-05+1.50913836e-06j
  1.18243114e-05-9.74881676e-07j -1.06700382e-05+8.90451778e-07j]
[DEBUG] Expansion region 3 phiH stats: min=0.021770001482053235, max=0.0264062684909321

[DEBUG] Region 4 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.0205036 +0.00908332j  0.00165125-0.00105635j -0.00050738+0.00029925j] ...
R2 coefficients (Cs[NMK:]): [-0.08478932-9.08331560e-03j  0.00062173-3.46263894e-05j
 -0.00098932+1.88561499e-05j] ...
[DEBUG] Region 4 mask count: 300
Region 4 min/max R: 1.2408163265306125/1.5673469387755103
R1n_vals max: 9.8969e-01
R2n_vals max: 8.9838e-01
    > Body 0 Active ([True, False, False, False, False]):
      OpenFlash Max |phi|: 4.511758e-01
      OpenFlash Mean |phi|: 2.665020e-02

[POTENTIAL MATRIX AUDIT] Boundary 0 (CONTRACTION (Step Up))
  Depth L vs R : 1.4000 vs 1.2000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 0 (CONTRACTION (Step Up))
  Depth L vs R : 1.4000 vs 1.2000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 1 (CONTRACTION (Step Up))
  Depth L vs R : 1.2000 vs 1.1000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 1 (CONTRACTION (Step Up))
  Depth L vs R : 1.2000 vs 1.1000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 2 (EXPANSION (Step Down))
  Depth L vs R : 1.1000 vs 1.7000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)

[POTENTIAL MATRIX AUDIT] Boundary 2 (EXPANSION (Step Down))
  Depth L vs R : 1.1000 vs 1.7000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)

[POTENTIAL MATRIX AUDIT] Boundary 3 (CONTRACTION (Step Up))
  Depth L vs R : 1.7000 vs 1.4000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 3 (CONTRACTION (Step Up))
  Depth L vs R : 1.7000 vs 1.4000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 4 (EXPANSION (Step Down))
  Depth L vs R : 1.4000 vs 1.9000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)

[POTENTIAL MATRIX AUDIT] Boundary 4 (EXPANSION (Step Down))
  Depth L vs R : 1.4000 vs 1.9000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)
      [Matrix Info] Size: (400, 400) | Condition Num: 1.3024e+03

[DEBUG] Region 1 coefficients:
R1 coefficients (Cs[:NMK]): [-0.07715212+1.81926991e-02j  0.10726661-1.81412287e-04j
 -0.0149062 -7.88413780e-06j] ...
R2 coefficients (Cs[NMK:]): [ 0.15215212-1.81926991e-02j  0.03332301+7.28832683e-08j
 -0.01425575-1.11763554e-07j] ...
[DEBUG] Region 1 mask count: 150
Region 1 min/max R: 0.326530612244898/0.4571428571428572
R1n_vals max: 9.5519e-01
R2n_vals max: 9.0024e-01

[DEBUG] Region 2 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.1452288 +2.07005214e-02j  0.00335762-4.89618721e-04j
 -0.00117024+8.86374784e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.29068335-2.07005214e-02j -0.03291256+7.86224591e-07j
  0.01237595-8.29765435e-07j] ...
[DEBUG] Region 2 mask count: 400
Region 2 min/max R: 0.5224489795918368/0.979591836734694
R1n_vals max: 9.8969e-01
R2n_vals max: 9.1974e-01

[DEBUG] Region 3 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.0426734 +1.55290114e-02j -0.00138826-9.38945417e-04j
  0.00130212-9.21270208e-05j] ...
R2 coefficients (Cs[NMK:]): [-0.13679105-0.01552901j  0.00694515-0.0001699j  -0.00607666+0.00010364j] ...
[DEBUG] Region 3 mask count: 150
Region 3 min/max R: 1.0448979591836736/1.1755102040816328
R1n_vals max: 9.8969e-01
R2n_vals max: 9.0220e-01

=== MODE CONTRIBUTIONS @ BAD POINT ===
n=0:
  R1 contrib = +4.2233e-02
  R2 contrib = -1.1060e-02
n=1:
  R1 contrib = +1.8963e-03
  R2 contrib = -6.5844e-03
n=2:
  R1 contrib = +1.6886e-03
  R2 contrib = -4.1301e-03
n=3:
  R1 contrib = +9.0272e-04
  R2 contrib = -1.1403e-04
n=4:
  R1 contrib = +4.1075e-04
  R2 contrib = +5.6966e-04

Partial sums:
  Σ R1 = +4.713176e-02
  Σ R2 = -2.131859e-02
  Σ total = +2.581317e-02

=== RECONSTRUCTION DECISION ===
Region 3
is_expansion = True
Used contribution (R1 only) = +4.713176e-02
Alternative contribution (R2 only) = -2.131859e-02
🚨 Expansion region 3 has nonzero R1 coeffs at indices [ 0  1  2  3  4  5  6  7  8  9 10 11 13 14 15 16 19 20 21 22 25 26 27]: [ 4.26733994e-02+1.55290114e-02j -1.38826337e-03-9.38945417e-04j
  1.30211652e-03-9.21270208e-05j -7.35317091e-04+9.24892242e-05j
  3.54677480e-04-4.53216212e-05j -1.20059186e-04+1.47492069e-05j
 -1.46512106e-05+1.04416467e-06j  8.01524179e-05-7.72016663e-06j
 -9.79240548e-05+9.11870897e-06j  8.49196559e-05-7.62189347e-06j
 -5.54631405e-05+4.79967079e-06j  2.14402220e-05-1.74534577e-06j
 -2.78783705e-05+2.43137505e-06j  3.55743831e-05-3.01733119e-06j
 -3.23138998e-05+2.68737716e-06j  2.13481515e-05-1.73600699e-06j
  1.57408403e-05-1.32049168e-06j -1.92612131e-05+1.58565962e-06j
  1.70556175e-05-1.38371245e-06j -1.06119108e-05+8.43553471e-07j
 -1.07534899e-05+8.84437381e-07j  1.23897061e-05-1.00468885e-06j
 -1.04525625e-05+8.37098613e-07j]
[DEBUG] Expansion region 3 phiH stats: min=0.03870859202420018, max=0.04703685447819471

[DEBUG] Region 4 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.03640894+0.01617499j  0.00294035-0.00188107j -0.00090432+0.00053289j] ...
R2 coefficients (Cs[NMK:]): [-0.15069465-1.61749880e-02j  0.00082029-6.16604615e-05j
 -0.00179554+3.35778268e-05j] ...
[DEBUG] Region 4 mask count: 300
Region 4 min/max R: 1.2408163265306125/1.5673469387755103
R1n_vals max: 9.8969e-01
R2n_vals max: 8.9838e-01
    > Body 1 Active ([False, True, False, False, False]):
      OpenFlash Max |phi|: 2.894489e-01
      OpenFlash Mean |phi|: 3.965724e-02

[POTENTIAL MATRIX AUDIT] Boundary 0 (CONTRACTION (Step Up))
  Depth L vs R : 1.4000 vs 1.2000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 0 (CONTRACTION (Step Up))
  Depth L vs R : 1.4000 vs 1.2000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 1 (CONTRACTION (Step Up))
  Depth L vs R : 1.2000 vs 1.1000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 1 (CONTRACTION (Step Up))
  Depth L vs R : 1.2000 vs 1.1000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 2 (EXPANSION (Step Down))
  Depth L vs R : 1.1000 vs 1.7000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)

[POTENTIAL MATRIX AUDIT] Boundary 2 (EXPANSION (Step Down))
  Depth L vs R : 1.1000 vs 1.7000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)

[POTENTIAL MATRIX AUDIT] Boundary 3 (CONTRACTION (Step Up))
  Depth L vs R : 1.7000 vs 1.4000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 3 (CONTRACTION (Step Up))
  Depth L vs R : 1.7000 vs 1.4000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 4 (EXPANSION (Step Down))
  Depth L vs R : 1.4000 vs 1.9000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)

[POTENTIAL MATRIX AUDIT] Boundary 4 (EXPANSION (Step Down))
  Depth L vs R : 1.4000 vs 1.9000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)
      [Matrix Info] Size: (400, 400) | Condition Num: 1.3024e+03

[DEBUG] Region 1 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.40285847+8.71849431e-02j -0.07545204-8.69382812e-04j
  0.01783992-3.77831845e-05j] ...
R2 coefficients (Cs[NMK:]): [-4.02858466e-01-8.71849431e-02j  5.69523410e-05+3.49278772e-07j
 -8.74519229e-05-5.35604918e-07j] ...
[DEBUG] Region 1 mask count: 150
Region 1 min/max R: 0.326530612244898/0.4571428571428572
R1n_vals max: 9.5519e-01
R2n_vals max: 9.0024e-01

[DEBUG] Region 2 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.24822097+0.09920319j  0.11290228-0.0023464j  -0.02894919+0.00042478j] ...
R2 coefficients (Cs[NMK:]): [-0.02094824-9.92031900e-02j  0.04902183+3.76782719e-06j
 -0.01691628-3.97648815e-06j] ...
[DEBUG] Region 2 mask count: 400
Region 2 min/max R: 0.5224489795918368/0.979591836734694
R1n_vals max: 9.8969e-01
R2n_vals max: 9.1974e-01

[DEBUG] Region 3 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.20213192+0.07441974j -0.00856456-0.00449971j  0.0073183 -0.0004415j ] ...
R2 coefficients (Cs[NMK:]): [-0.64330839-0.07441974j  0.00804045-0.00081423j -0.03675516+0.00049667j] ...
[DEBUG] Region 3 mask count: 150
Region 3 min/max R: 1.0448979591836736/1.1755102040816328
R1n_vals max: 9.8969e-01
R2n_vals max: 9.0220e-01

=== MODE CONTRIBUTIONS @ BAD POINT ===
n=0:
  R1 contrib = +2.0005e-01
  R2 contrib = -5.2012e-02
n=1:
  R1 contrib = +1.1699e-02
  R2 contrib = -7.6228e-03
n=2:
  R1 contrib = +9.4903e-03
  R2 contrib = -2.4982e-02
n=3:
  R1 contrib = +5.1055e-03
  R2 contrib = -5.5753e-03
n=4:
  R1 contrib = +2.3516e-03
  R2 contrib = +2.8957e-03

Partial sums:
  Σ R1 = +2.286940e-01
  Σ R2 = -8.729610e-02
  Σ total = +1.413979e-01

=== RECONSTRUCTION DECISION ===
Region 3
is_expansion = True
Used contribution (R1 only) = +2.286940e-01
Alternative contribution (R2 only) = -8.729610e-02
🚨 Expansion region 3 has nonzero R1 coeffs at indices [ 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 24 25 26 27 28 30 31 32 33 34 36 37 38 39]: [ 2.02131921e-01+7.44197423e-02j -8.56455565e-03-4.49971180e-03j
  7.31829992e-03-4.41500683e-04j -4.15874592e-03+4.43236471e-04j
  2.03057539e-03-2.17194983e-04j -6.96701202e-04+7.06826819e-05j
 -8.28107042e-05+5.00395444e-06j  4.68652488e-04-3.69973848e-05j
 -5.77052729e-04+4.36996247e-05j  5.03402454e-04-3.65264299e-05j
 -3.30737533e-04+2.30014811e-05j  1.29289468e-04-8.36422736e-06j
  4.73150780e-05-3.85151915e-06j -1.65431054e-04+1.16518882e-05j
  2.12263121e-04-1.44599681e-05j -1.93545203e-04+1.28787281e-05j
  1.28437305e-04-8.31947310e-06j -4.27708061e-05+2.55086399e-06j
 -3.78957827e-05+2.74545017e-06j  9.40057354e-05-6.32819744e-06j
 -1.15492272e-04+7.59896283e-06j  1.02581910e-04-6.63117059e-06j
 -6.41007773e-05+4.04256460e-06j  1.40043209e-05-7.60616985e-07j
  3.28301512e-05-2.25136520e-06j -6.44592277e-05+4.23849273e-06j
  7.44967787e-05-4.81477429e-06j -6.30184162e-05+4.01163096e-06j
  3.57302073e-05-2.21621576e-06j -2.88810381e-05+1.92252104e-06j
  4.84558611e-05-3.13939895e-06j -5.28416028e-05+3.37696951e-06j
  4.24397187e-05-2.67559744e-06j -2.15442336e-05+1.32026039e-06j
  2.48050640e-05-1.62340412e-06j -3.78339642e-05+2.42895756e-06j
  3.97062661e-05-2.52232992e-06j -3.11122863e-05+1.95616208e-06j]
[DEBUG] Expansion region 3 phiH stats: min=0.18214356475259644, max=0.22811808594733754

[DEBUG] Region 4 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.16801139+0.07751546j  0.01409615-0.00901468j -0.00439218+0.00255379j] ...
R2 coefficients (Cs[NMK:]): [-0.70372567-0.07751546j -0.01329951-0.0002955j  -0.00712911+0.00016092j] ...
[DEBUG] Region 4 mask count: 300
Region 4 min/max R: 1.2408163265306125/1.5673469387755103
R1n_vals max: 9.8969e-01
R2n_vals max: 8.9838e-01
    > Body 2 Active ([False, False, True, False, False]):
      OpenFlash Max |phi|: 4.976841e-01
      OpenFlash Mean |phi|: 1.389281e-01

[POTENTIAL MATRIX AUDIT] Boundary 0 (CONTRACTION (Step Up))
  Depth L vs R : 1.4000 vs 1.2000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 0 (CONTRACTION (Step Up))
  Depth L vs R : 1.4000 vs 1.2000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 1 (CONTRACTION (Step Up))
  Depth L vs R : 1.2000 vs 1.1000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 1 (CONTRACTION (Step Up))
  Depth L vs R : 1.2000 vs 1.1000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 2 (EXPANSION (Step Down))
  Depth L vs R : 1.1000 vs 1.7000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)

[POTENTIAL MATRIX AUDIT] Boundary 2 (EXPANSION (Step Down))
  Depth L vs R : 1.1000 vs 1.7000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)

[POTENTIAL MATRIX AUDIT] Boundary 3 (CONTRACTION (Step Up))
  Depth L vs R : 1.7000 vs 1.4000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 3 (CONTRACTION (Step Up))
  Depth L vs R : 1.7000 vs 1.4000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 4 (EXPANSION (Step Down))
  Depth L vs R : 1.4000 vs 1.9000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)

[POTENTIAL MATRIX AUDIT] Boundary 4 (EXPANSION (Step Down))
  Depth L vs R : 1.4000 vs 1.9000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)
      [Matrix Info] Size: (400, 400) | Condition Num: 1.3024e+03

[DEBUG] Region 1 coefficients:
R1 coefficients (Cs[:NMK]): [ 8.64906776e-02+5.57974014e-02j -5.81790441e-03-5.56395406e-04j
 -2.88602280e-05-2.41808211e-05j] ...
R2 coefficients (Cs[NMK:]): [-8.64906776e-02-5.57974014e-02j  2.50950944e-06+2.23534560e-07j
 -3.84859174e-06-3.42781236e-07j] ...
[DEBUG] Region 1 mask count: 150
Region 1 min/max R: 0.326530612244898/0.4571428571428572
R1n_vals max: 9.5519e-01
R2n_vals max: 9.0024e-01

[DEBUG] Region 2 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.09755681+0.06348895j -0.01559025-0.00150167j  0.00550604+0.00027185j] ...
R2 coefficients (Cs[NMK:]): [-9.75568149e-02-6.34889468e-02j  2.74409939e-05+2.41136782e-06j
 -2.89984171e-05-2.54490853e-06j] ...
[DEBUG] Region 2 mask count: 400
Region 2 min/max R: 0.5224489795918368/0.979591836734694
R1n_vals max: 9.8969e-01
R2n_vals max: 9.1974e-01

[DEBUG] Region 3 coefficients:
R1 coefficients (Cs[:NMK]): [0.01401281+0.04762781j 0.1018845 -0.00287977j 0.00401804-0.00028256j] ...
R2 coefficients (Cs[NMK:]): [0.57422248-0.04762781j 0.05015619-0.0005211j  0.00504306+0.00031787j] ...
[DEBUG] Region 3 mask count: 150
Region 3 min/max R: 1.0448979591836736/1.1755102040816328
R1n_vals max: 9.8969e-01
R2n_vals max: 9.0220e-01

=== MODE CONTRIBUTIONS @ BAD POINT ===
n=0:
  R1 contrib = +1.3868e-02
  R2 contrib = +4.6427e-02
n=1:
  R1 contrib = -1.3917e-01
  R2 contrib = -4.7551e-02
n=2:
  R1 contrib = +5.2106e-03
  R2 contrib = +3.4276e-03
n=3:
  R1 contrib = +1.6583e-02
  R2 contrib = +3.3924e-03
n=4:
  R1 contrib = +1.3349e-02
  R2 contrib = +7.6853e-04

Partial sums:
  Σ R1 = -9.015618e-02
  Σ R2 = +6.464397e-03
  Σ total = -8.369179e-02

=== RECONSTRUCTION DECISION ===
Region 3
is_expansion = True
Used contribution (R1 only) = -9.015618e-02
Alternative contribution (R2 only) = +6.464397e-03
🚨 Expansion region 3 has nonzero R1 coeffs at indices [ 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39]: [ 1.40128136e-02+4.76278138e-02j  1.01884497e-01-2.87976589e-03j
  4.01803634e-03-2.82555565e-04j -1.35078355e-02+2.83666450e-04j
  1.15267241e-02-1.39002392e-04j -7.28716650e-03+4.52361364e-05j
  3.13648726e-03+3.20247562e-06j  5.84118049e-05-2.36779179e-05j
 -2.00134860e-03+2.79672775e-05j  2.72614622e-03-2.33765121e-05j
 -2.47950189e-03+1.47206941e-05j  1.62368966e-03-5.35301321e-06j
 -5.45057038e-04-2.46492975e-06j -4.24113069e-04+7.45707985e-06j
  1.05984749e-03-9.25421999e-06j -1.27012770e-03+8.24224384e-06j
  1.08751374e-03-5.32437097e-06j -6.36619017e-04+1.63252480e-06j
  8.69201919e-05+1.75705781e-06j  3.96680342e-04-4.04997653e-06j
 -6.94118200e-04+4.86325235e-06j  7.53296901e-04-4.24387600e-06j
 -5.93039872e-04+2.58719673e-06j  2.87919173e-04-4.86786476e-07j
  5.89159390e-05-1.44084888e-06j -3.46616490e-04+2.71258857e-06j
  5.02988597e-04-3.08140241e-06j -5.00168155e-04+2.56739954e-06j
  3.56835421e-04-1.41835363e-06j -1.27913209e-04+1.77930390e-08j
 -1.14199872e-04+1.23039225e-06j  3.01042765e-04-2.00918068e-06j
 -3.86232111e-04+2.16122322e-06j  3.55847851e-04-1.71235283e-06j
 -2.29053101e-04+8.44952080e-07j  4.97083149e-05+1.66774001e-07j
  1.27936383e-04-1.03896072e-06j -2.55081044e-04+1.55450603e-06j
  3.01329729e-04-1.61426331e-06j -2.61492003e-04+1.25192214e-06j]
[DEBUG] Expansion region 3 phiH stats: min=-0.13446978936454781, max=0.14987176324741533

[DEBUG] Region 4 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.09197674+0.04960904j  0.00913247-0.00576929j -0.00301771+0.0016344j ] ...
R2 coefficients (Cs[NMK:]): [-0.40626246-0.04960904j -0.04339457-0.00018911j  0.01941254+0.00010298j] ...
[DEBUG] Region 4 mask count: 300
Region 4 min/max R: 1.2408163265306125/1.5673469387755103
R1n_vals max: 9.8969e-01
R2n_vals max: 8.9838e-01
    > Body 3 Active ([False, False, False, True, False]):
      OpenFlash Max |phi|: 5.746394e-01
      OpenFlash Mean |phi|: 6.190733e-02

[POTENTIAL MATRIX AUDIT] Boundary 0 (CONTRACTION (Step Up))
  Depth L vs R : 1.4000 vs 1.2000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 0 (CONTRACTION (Step Up))
  Depth L vs R : 1.4000 vs 1.2000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 1 (CONTRACTION (Step Up))
  Depth L vs R : 1.2000 vs 1.1000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 1 (CONTRACTION (Step Up))
  Depth L vs R : 1.2000 vs 1.1000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 2 (EXPANSION (Step Down))
  Depth L vs R : 1.1000 vs 1.7000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)

[POTENTIAL MATRIX AUDIT] Boundary 2 (EXPANSION (Step Down))
  Depth L vs R : 1.1000 vs 1.7000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)

[POTENTIAL MATRIX AUDIT] Boundary 3 (CONTRACTION (Step Up))
  Depth L vs R : 1.7000 vs 1.4000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 3 (CONTRACTION (Step Up))
  Depth L vs R : 1.7000 vs 1.4000
  Block Side   : RIGHT (Diagonal)
  Formulation  : CONTRACTION (Assumes R<L)

[POTENTIAL MATRIX AUDIT] Boundary 4 (EXPANSION (Step Down))
  Depth L vs R : 1.4000 vs 1.9000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)

[POTENTIAL MATRIX AUDIT] Boundary 4 (EXPANSION (Step Down))
  Depth L vs R : 1.4000 vs 1.9000
  Block Side   : LEFT (Diagonal)
  Formulation  : EXPANSION (Assumes L<R)
      [Matrix Info] Size: (400, 400) | Condition Num: 1.3024e+03

[DEBUG] Region 1 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.13569975+1.53112847e-01j -0.00859951-1.52679663e-03j
 -0.00015372-6.63542434e-05j] ...
R2 coefficients (Cs[NMK:]): [-1.35699746e-01-1.53112847e-01j  3.62152879e-06+6.13397970e-07j
 -5.55380948e-06-9.40621061e-07j] ...
[DEBUG] Region 1 mask count: 150
Region 1 min/max R: 0.326530612244898/0.4571428571428572
R1n_vals max: 9.5519e-01
R2n_vals max: 9.0024e-01

[DEBUG] Region 2 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.15316779+0.17421911j -0.02310061-0.00412071j  0.00682834+0.00074599j] ...
R2 coefficients (Cs[NMK:]): [-1.53167787e-01-1.74219106e-01j  3.94154250e-05+6.61699975e-06j
 -4.16337176e-05-6.98344689e-06j] ...
[DEBUG] Region 2 mask count: 400
Region 2 min/max R: 0.5224489795918368/0.979591836734694
R1n_vals max: 9.8969e-01
R2n_vals max: 9.1974e-01

[DEBUG] Region 3 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.16162769+0.1306948j  -0.06468872-0.00790232j  0.01249465-0.00077536j] ...
R2 coefficients (Cs[NMK:]): [-0.16162769-0.1306948j  -0.01578436-0.00142995j  0.01064959+0.00087225j] ...
[DEBUG] Region 3 mask count: 150
Region 3 min/max R: 1.0448979591836736/1.1755102040816328
R1n_vals max: 9.8969e-01
R2n_vals max: 9.0220e-01

=== MODE CONTRIBUTIONS @ BAD POINT ===
n=0:
  R1 contrib = +1.5996e-01
  R2 contrib = -1.3068e-02
n=1:
  R1 contrib = +8.8360e-02
  R2 contrib = +1.4964e-02
n=2:
  R1 contrib = +1.6203e-02
  R2 contrib = +7.2382e-03
n=3:
  R1 contrib = -3.7584e-03
  R2 contrib = +1.2426e-03
n=4:
  R1 contrib = -7.7968e-03
  R2 contrib = -7.9982e-04

Partial sums:
  Σ R1 = +2.529694e-01
  Σ R2 = +9.577689e-03
  Σ total = +2.625471e-01

=== RECONSTRUCTION DECISION ===
Region 3
is_expansion = True
Used contribution (R1 only) = +2.529694e-01
Alternative contribution (R2 only) = +9.577689e-03
🚨 Expansion region 3 has nonzero R1 coeffs at indices [ 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39]: [ 1.61627695e-01+1.30694799e-01j -6.46887193e-02-7.90232417e-03j
  1.24946527e-02-7.75356661e-04j  3.06140582e-03+7.78405026e-04j
 -6.73244999e-03-3.81434465e-04j  5.76957994e-03+1.24131831e-04j
 -3.29383939e-03+8.78786729e-06j  8.13019684e-04-6.49742341e-05j
  9.81489996e-04+7.67446041e-05j -1.87499387e-03-6.41471506e-05j
  1.94436763e-03+4.03948449e-05j -1.43049485e-03-1.46891266e-05j
  6.36969913e-04-6.76397827e-06j  1.50628307e-04+2.04628656e-05j
 -7.21653092e-04-2.53943720e-05j  9.69713024e-04+2.26174228e-05j
 -8.94145674e-04-1.46105298e-05j  5.78128257e-04+4.47978783e-06j
 -1.51888310e-04+4.82151706e-06j -2.48517928e-04-1.11134823e-05j
  5.16807160e-04+1.33451808e-05j -5.98990905e-04-1.16455591e-05j
  4.99356194e-04+7.09948935e-06j -2.70794653e-04-1.33578377e-06j
  2.47637493e-04+7.44357528e-06j -3.90874461e-04-8.45563204e-06j
  4.06998042e-04+7.04516416e-06j -3.05603760e-04-3.89208379e-06j
  1.27634577e-04+4.88256225e-08j  6.91863138e-05+3.37630168e-06j
 -2.27879652e-04-5.51336382e-06j  3.07721580e-04+5.93058154e-06j
 -2.93795189e-04-4.69884278e-06j  1.98595494e-04+2.31862085e-06j
 -5.60054969e-05+4.57642139e-07j -9.00253657e-05-2.85099717e-06j
  1.98551880e-04+4.26569765e-06j -2.42739535e-04-4.42967673e-06j
  2.16138829e-04+3.43538155e-06j]
[DEBUG] Expansion region 3 phiH stats: min=0.08664395178380932, max=0.2639082199160567

[DEBUG] Region 4 coefficients:
R1 coefficients (Cs[:NMK]): [ 0.1714123 +0.13613145j  0.14100361-0.01583144j -0.03622977+0.00448492j] ...
R2 coefficients (Cs[NMK:]): [ 0.85715913-0.13613145j  0.07554295-0.00051894j -0.02007036+0.0002826j ] ...
[DEBUG] Region 4 mask count: 300
Region 4 min/max R: 1.2408163265306125/1.5673469387755103
R1n_vals max: 9.8969e-01
R2n_vals max: 8.9838e-01
    > Body 4 Active ([False, False, False, False, True]):
      OpenFlash Max |phi|: 3.593327e-01
      OpenFlash Mean |phi|: 1.393823e-01

  [GEOMETRY TRANSITION ANALYSIS]
    Global Water Depth (h): 1.9
    Domain 0: R=[0.00, 0.30] | Depth=1.4000 | Center Start
    Domain 1: R=[0.30, 0.50] | Depth=1.2000 | CONTRACTION (Step Up / Shallower Fluid)
    Domain 2: R=[0.50, 1.00] | Depth=1.1000 | CONTRACTION (Step Up / Shallower Fluid)
    Domain 3: R=[1.00, 1.20] | Depth=1.7000 | EXPANSION (Step Down / Deeper Fluid) <--- 🚨 POCKET REGION (Likely Failure Point)
    Domain 4: R=[1.20, 1.60] | Depth=1.4000 | CONTRACTION (Step Up / Shallower Fluid)
    Domain 5: R=[1.60, inf] | Depth=1.9000 | EXPANSION (Exit to Open Ocean)

  [CONVERSION DEBUG]
    Omega (w): 3.062791
    Scaling Factor (1/w): 0.326500
    Capytaine Raw Real [Min, Max]: [6.1873e-02, 1.2521e+00]
    Capytaine Raw Imag [Min, Max]: [-1.9857e+00, 9.7727e-01]

--- PHASE / CONVENTION DIAGNOSTIC ---
  Transform 'None': Rel Error = 55.6198%
  Transform 'Negated (-1)': Rel Error = 248.9557%
  Transform 'Conjugate (*)': Rel Error = 147.5438%
  Transform 'Rotated 90 (j)': Rel Error = 172.1528%
  Transform 'Rotated -90 (-j)': Rel Error = 188.2443%
  Transform 'Conjugate & Negated': Rel Error = 208.0945%
  [DIAGNOSTIC] Best match is: 'None'

  [MAGNITUDE CHECK] Max | |phi_of| - |phi_cap| |: 7.579661e-01

  [LOCATOR] Top 3 Real Part Errors:
    @ (R=1.176, Z=-0.233) -> Diff: 1.0227 (OF: 1.0777 vs CAP: 0.0550)
      -> NEAR CORNER of Body 3 (a=1.2, d=0.2) dist=0.0408

  [SERIES SUMMATION DIAGNOSTIC] at R=1.1755, Z=-0.2327
    [REGION LOCATOR] r=1.1755 -> Region 3 selected
    Region Bounds: [1.0000, 1.2000]
    Point is in Region 3
    Top 5 Contributing Terms:
      Mode R1_0: 2.3744e-02+8.6307e-03j (Abs: 2.5264e-02)
      Mode R2_0: -6.2200e-03-7.0507e-04j (Abs: 6.2599e-03)
      Mode R2_1: -3.9102e-03+9.0456e-05j (Abs: 3.9112e-03)
      Mode R2_2: -2.2321e-03+3.9557e-05j (Abs: 2.2324e-03)
      Mode R1_1: 1.0466e-03+7.2023e-04j (Abs: 1.2704e-03)
    Term Summation Check:
      Total Sum: 0.0144+0.0086j
    @ (R=1.176, Z=-0.271) -> Diff: 0.9272 (OF: 1.0384 vs CAP: 0.1112)
      -> NEAR CORNER of Body 3 (a=1.2, d=0.2) dist=0.0755
    @ (R=1.110, Z=-0.233) -> Diff: 0.8684 (OF: 1.0764 vs CAP: 0.2080)
      -> NEAR CORNER of Body 3 (a=1.2, d=0.2) dist=0.0955
[Debug CSV saved to: /Users/hopebest/Documents/semi-analytical-hydro/package/test_artifacts/config3_debug_data.csv]

  [FINAL COMPARISON] config3
    Omega: 3.0628
    Max Abs OpenFlash (Real): 1.264401e+00
    Max Abs Capytaine (Real): 6.483243e-01

[Debug plot saved to: /Users/hopebest/Documents/semi-analytical-hydro/package/test_artifacts/config3_real_comparison.png]

[Debug plot saved to: /Users/hopebest/Documents/semi-analytical-hydro/package/test_artifacts/config3_imag_comparison.png]
F

E           Failed: 
E           Not equal to tolerance rtol=0.13, atol=0.01
E           [config3] Real part mismatch
E           Mismatched elements: 1772 / 2114 (83.8%)
E           Max absolute difference among violations: 1.02269426
E           Max relative difference among violations: 157.00640727
E            ACTUAL: array([ 1.264401,  1.225748,  1.187316, ..., -0.110443, -0.110111,
E                  -0.110001])
E            DESIRED: array([ 0.648324,  0.616882,  0.593708, ..., -0.08108 , -0.080811,
E                  -0.080726])