Skip to content

CHAODA epicenter probe (negative — refutes WHERE=CHAODA) + IT cross-grid replication of family-basin Weyl#553

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/chaoda-epicenter-and-it-replication
Jun 19, 2026
Merged

CHAODA epicenter probe (negative — refutes WHERE=CHAODA) + IT cross-grid replication of family-basin Weyl#553
AdaWorldAPI merged 1 commit into
mainfrom
claude/chaoda-epicenter-and-it-replication

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Both cuts you asked for, on real PyPSA data. One confirms, one refutes — both honest.

1. IT cross-grid replication — CONFIRMS the family-basin Weyl finding

Reran the family_basin_weyl_multihop probe on the IT grid (192 buses, the other C-solid grid, (λ₃−λ₂)/λ₂ = 2.38):

tier basins within seam ratio verdict
HEEL 2 0.730 0.561 1.30 HOP-LOCAL
HIP 4 0.791 0.587 1.35 HOP-LOCAL
LEAF 8 0.592 0.512 1.16 leaks

IT replicates and slightly extends ES — crisp-tier hop-locality at HEEL and HIP (ES was HEEL only), LEAF leaks. Same shape on an independent grid → the family-basin Weyl-multi-hop reinstatement is not an ES artifact. (E-FAMILY-BASIN-WEYL-IT-REPLICATION.)

2. CHAODA epicenter — NEGATIVE, refutes my own conjecture

New gated example chaoda_surge_epicenter.rs (--features ndarray-simd) using the real ndarray::hpc::clam ClamTree + anomaly_scores (the engine you pointed me at). ES, 64-bit Fiedler-sign fingerprints:

seam (inter-HEEL-basin cut): 4 nodes  (= the 2-line bottleneck)
mean anomaly, SEAM nodes : 0.302
mean anomaly, ALL nodes  : 0.339
ratio (seam / all)       : 0.89        ← seam is LESS anomalous
seam share of top-quartile: 1/4, lift 1.00 (chance)
VERDICT: NOT SUPPORTED

CHAODA's LFD anomaly does NOT single out the seam epicenter. The reason is clear in hindsight: Fiedler-sign fingerprints cluster nodes by basin, so the cut nodes sit in a dense, low-LFD region (low anomaly), while CHAODA flags high-LFD geometric complexity elsewhere. So the "WHERE = CHAODA anomaly" synthesis claim is withdrawn — I built the real engine and it killed my own earlier conjecture. (E-CHAODA-IS-NOT-THE-SEAM-EPICENTER.)

Non-tuning note: this is one encoding on one grid; I did not keep swapping fingerprints until it went green. The defensible statement is "on the natural spectral-embedding encoding, CHAODA doesn't identify the seam" — a different fingerprint might, but the clean claim is withdrawn pending that probe.

Net effect on the three-axis surge decomposition

  • HOW it spreads = family-basin block-local Weyl multi-hop — holds, now cross-grid (ES + IT).
  • WHERE it breaks = CHAODA anomaly — does NOT hold on the natural encoding; withdrawn.
  • HOW MUCH = Weyl magnitude — unchanged ([G] exact, probes A–D).

So the synthesis is more honest after this: two of three axes stand, the third is an open question, not a claim.

The CHAODA example is gated behind ndarray-simd (real ndarray dep, git form per P0); the default build compiles the stub. Verified locally against the ndarray sibling. Cargo.lock unchanged.

🤖 Generated with Claude Code


Generated by Claude Code

Summary by CodeRabbit

Release Notes

  • Documentation

    • Updated research findings with new analytical results on grid seam analysis and basin replication studies.
  • New Features

    • Added a new example analysis tool for detecting and scoring anomalies in power grids using spectral fingerprinting techniques.

…eplication of family-basin Weyl

Two results closing the three-axis surge synthesis on real PyPSA data.

(1) CHAODA epicenter — NEGATIVE, refutes my own conjecture. New gated example
chaoda_surge_epicenter.rs (--features ndarray-simd) uses the REAL
ndarray::hpc::clam ClamTree + anomaly_scores. ES, 64-bit Fiedler-sign
fingerprints: the brittle 2-line seam (4 nodes) is LESS anomalous than average
(0.302 vs 0.339, ratio 0.89; top-quartile lift 1.00 = chance). CHAODA's LFD
anomaly does NOT single out the spectral-cut bottleneck — Fiedler-sign
fingerprints put boundary nodes in a dense low-LFD region. The "WHERE = CHAODA
anomaly" synthesis claim is WITHDRAWN (one encoding, not tuned to win).
Epiphany E-CHAODA-IS-NOT-THE-SEAM-EPICENTER.

(2) IT replication — CONFIRMS E-FAMILY-BASIN-WEYL across grids. The
family_basin_weyl_multihop probe on IT (192 buses, C=2.38): HEEL 1.30 + HIP 1.35
HOP-LOCAL, LEAF leaks — same crisp-tier-localizes / fine-tier-leaks shape as ES,
on an independent grid. Not an ES artifact. Epiphany
E-FAMILY-BASIN-WEYL-IT-REPLICATION.

CHAODA example gated behind ndarray-simd (real ndarray dep, git form); default
build compiles the stub. Verified locally against the ndarray sibling (the
committed dep stays the git fork per P0). Cargo.lock unchanged (path resolution
not committed).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CcpLeEC3XK8Eye53GKBVvi
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a new chaoda_surge_epicenter Rust example to perturbation-sim that probes whether the HHTL inter-HEEL-basin seam is a CHAODA anomaly epicenter using a Fiedler-sign spectral fingerprint and ClamTree scoring, gated on the ndarray-simd feature. Two new dated findings are prepended to the epiphanies board recording a negative ES-grid result and a positive IT-grid replication.

Changes

CHAODA Seam Epicenter Probe

Layer / File(s) Summary
chaoda_surge_epicenter example binary
crates/perturbation-sim/Cargo.toml, crates/perturbation-sim/examples/chaoda_surge_epicenter.rs
Registers the new example target in the manifest. Implements a feature-gated binary: without ndarray-simd it prints an error and exits; with it, loads grid CSVs, computes Laplacian eigenvector-based bit fingerprints, builds ClamTree, scores per-node anomalies, identifies seam nodes from heel-partition-crossing edges, computes mean anomaly ratio and top-quartile lift, and prints a SUPPORTED/NOT SUPPORTED verdict gated at >= 1.30.
Epiphanies board findings
.claude/board/EPIPHANIES.md
Prepends two new dated sections: E-CHAODA-IS-NOT-THE-SEAM-EPICENTER records the ES-grid negative result (seam reported less anomalous than average, conjecture withdrawn); E-FAMILY-BASIN-WEYL-IT-REPLICATION records the IT-grid re-run confirming crisp-tier hop-locality at HEEL/HIP with LEAF leaking.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • AdaWorldAPI/lance-graph#511: Introduced HHTL heel/partition keying and the CLAM/CHAODA framing that the new chaoda_surge_epicenter example directly builds upon for seam node identification and ClamTree scoring.
  • AdaWorldAPI/lance-graph#551: Reinstated tier-scoped seam/basin hop-locality with the same crisp-tier/HEEL seam-vs-within containment framing and 1.30 ratio gate that appears in the new probe's verdict logic.

Poem

🐇 The seam is not the villain, as numbers now confess,
I sniffed the Fiedler eigenvecs with spectral eagerness.
CHAODA said "less anomalous" — the conjecture fell to ground,
But IT-grid hops at HEEL and HIP? Crisp-tier truth was found!
Not every cut's an epicenter, dear friends, let's not assume —
A rabbit checks the data twice before declaring doom. 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures both major changes: refutation of the CHAODA-seam-epicenter hypothesis and confirmation of family-basin Weyl hop-locality across grids.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
crates/perturbation-sim/examples/chaoda_surge_epicenter.rs (1)

36-159: 🏗️ Heavy lift

Add focused #[cfg(test)] coverage for the new scoring/gating logic.

This file introduces non-trivial metric and verdict logic but no colocated unit tests. Please extract small pure helpers (e.g., seam extraction, ratio/lift computation, verdict gate) and add targeted tests.

As per coding guidelines, crates/**/*.rs: Add Rust unit tests alongside implementations via #[cfg(test)] modules; prefer focused scenarios over broad integration tests.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/perturbation-sim/examples/chaoda_surge_epicenter.rs` around lines 36 -
159, The main function contains non-trivial logic for seam extraction, anomaly
score calculations, ratio and lift computations, and verdict gating but lacks
unit test coverage. Extract the pure helper functions from main: create separate
functions for seam node extraction (the loop checking heel inequality in
grid.edges), the mean anomaly calculation (the mean closure), the ratio and lift
computation logic, and the verdict gate logic that checks anom_ratio >= 1.30 &&
lift >= 1.30. Then add a #[cfg(test)] module with focused unit tests for each
extracted helper, covering edge cases such as empty seams, zero anomaly scores,
and boundary conditions for the verdict thresholds.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/perturbation-sim/examples/chaoda_surge_epicenter.rs`:
- Around line 27-33: The main function that handles the missing ndarray-simd
feature logs an error message via eprintln! but does not exit with a non-zero
exit code, causing the program to exit successfully despite the error condition.
Add a call to std::process::exit(1) after the eprintln! statement in the main
function (conditionally compiled with cfg(not(feature = "ndarray-simd"))) to
ensure the program exits with a failure status when this feature precondition is
not met.

---

Nitpick comments:
In `@crates/perturbation-sim/examples/chaoda_surge_epicenter.rs`:
- Around line 36-159: The main function contains non-trivial logic for seam
extraction, anomaly score calculations, ratio and lift computations, and verdict
gating but lacks unit test coverage. Extract the pure helper functions from
main: create separate functions for seam node extraction (the loop checking heel
inequality in grid.edges), the mean anomaly calculation (the mean closure), the
ratio and lift computation logic, and the verdict gate logic that checks
anom_ratio >= 1.30 && lift >= 1.30. Then add a #[cfg(test)] module with focused
unit tests for each extracted helper, covering edge cases such as empty seams,
zero anomaly scores, and boundary conditions for the verdict thresholds.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: edee96f9-936b-4f56-b9e6-163626a92fe9

📥 Commits

Reviewing files that changed from the base of the PR and between 2f96888 and 330f32b.

📒 Files selected for processing (3)
  • .claude/board/EPIPHANIES.md
  • crates/perturbation-sim/Cargo.toml
  • crates/perturbation-sim/examples/chaoda_surge_epicenter.rs

Comment on lines +27 to +33
#[cfg(not(feature = "ndarray-simd"))]
fn main() {
eprintln!(
"chaoda_surge_epicenter requires `--features ndarray-simd` \
(it uses ndarray::hpc::clam — the real CLAM/CHAODA engine)."
);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Return a non-zero exit code when the feature precondition is unmet.

Line 29-33 logs an error but still exits successfully, so scripted runs can misclassify this as a pass.

Proposed fix
 #[cfg(not(feature = "ndarray-simd"))]
 fn main() {
     eprintln!(
         "chaoda_surge_epicenter requires `--features ndarray-simd` \
          (it uses ndarray::hpc::clam — the real CLAM/CHAODA engine)."
     );
+    std::process::exit(2);
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#[cfg(not(feature = "ndarray-simd"))]
fn main() {
eprintln!(
"chaoda_surge_epicenter requires `--features ndarray-simd` \
(it uses ndarray::hpc::clam — the real CLAM/CHAODA engine)."
);
}
#[cfg(not(feature = "ndarray-simd"))]
fn main() {
eprintln!(
"chaoda_surge_epicenter requires `--features ndarray-simd` \
(it uses ndarray::hpc::clam — the real CLAM/CHAODA engine)."
);
std::process::exit(2);
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/perturbation-sim/examples/chaoda_surge_epicenter.rs` around lines 27 -
33, The main function that handles the missing ndarray-simd feature logs an
error message via eprintln! but does not exit with a non-zero exit code, causing
the program to exit successfully despite the error condition. Add a call to
std::process::exit(1) after the eprintln! statement in the main function
(conditionally compiled with cfg(not(feature = "ndarray-simd"))) to ensure the
program exits with a failure status when this feature precondition is not met.

@AdaWorldAPI AdaWorldAPI merged commit 2e84972 into main Jun 19, 2026
6 checks passed
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