|
| 1 | +# perturbation-sim ≡ `compute_dag` — the electricity cascade IS the topological recompute |
| 2 | + |
| 3 | +> **Status:** FINDING (conceptual mapping; no code dependency added). `perturbation-sim` |
| 4 | +> stays zero-dep / workspace-excluded — this is a doc-level join, not a `lance-graph-contract` |
| 5 | +> import. The two crates share a *mechanism*, proven on opposite ends: this crate ships the |
| 6 | +> certified physics + full recompute + the router/field/witness encoders; `compute_dag` |
| 7 | +> (`lance-graph-contract::class_view`) ships the incremental dispatch the physics bound certifies. |
| 8 | +> |
| 9 | +> **Grounds:** `E-CHESS-TENSOR-PROVEN`, `E-EXCEL-SHADER-PROJECTION`, `E-OGAR-ROUTER-ENCODER`, |
| 10 | +> `probe-excel-compute-dag-v1`. **Cross-ref iron rule:** `I-NOISE-FLOOR-JIRAK` (significance |
| 11 | +> uses Jirak 2016, not IID Berry–Esseen), `I-VSA-IDENTITIES` (the numeric witness arc is NOT |
| 12 | +> the contract's identity `WitnessTable` — this crate's own `witness.rs` already guards that). |
| 13 | +
|
| 14 | +## The one-line claim |
| 15 | + |
| 16 | +A cascading grid outage and a spreadsheet recompute are **the same dependency-driven |
| 17 | +topological recompute**. Trip a line → redistribute flow → re-trip whatever now overloads |
| 18 | +is, *structurally*, edit a cell → dirty its dependents → recompute them in topological order. |
| 19 | +`perturbation-sim::simulate_outage` is the physical instance; `ClassView::compute_dag` + |
| 20 | +`compute_dag_topo_order` + `write_row` is the abstract substrate. NNUE proves the same shape |
| 21 | +at world-champion strength (`E-CHESS-TENSOR-PROVEN`). |
| 22 | + |
| 23 | +## The mapping (each row a mechanism, not a rhyme) |
| 24 | + |
| 25 | +| `perturbation-sim` (physical grid) | `compute_dag` / OGAR substrate | what it is | |
| 26 | +|---|---|---| |
| 27 | +| `simulate_outage` round loop (trip → recompute survivors → re-trip) | `compute_dag_topo_order` recompute dispatch (edit → dirty-set → recompute dependents) | **the cascade ≡ the topological recompute** | |
| 28 | +| `PerturbationShape::trip_round[e]` (round each line tripped; `0` = seed) | the topological *generation* of each recomputed field = its position in `compute_dag_topo_order` | **trip generation = topo generation** | |
| 29 | +| seed `alive[seed_line]=false` → rank-1 `E` on Laplacian `L` | the dirty seed: `write_row(seed_cell, cycle)` | **the trip = the gated edit** | |
| 30 | +| `spectral_perturbation`: Weyl `\|λᵢ(L′)−λᵢ(L)\| ≤ ‖E‖₂`, Davis–Kahan `sinθ ≤ ‖E‖₂/gap` | the **NNUE incremental ≡ full** invariant: a bounded local edit perturbs the global field by a bounded amount, so recomputing only the dirty-set provably equals a full recompute | **the bound that certifies incrementality** | |
| 31 | +| `PerturbationShape::node_field` (per-bus magnitude, the red footprint) | the wave/field readoff over the grid (`E-OGAR-ROUTER-ENCODER` field side) | **the wave** | |
| 32 | +| `splat::morton2` (x/y nibble-interleave) | the 2-axis router ADDRESS (`HEEL/HIP/TWIG` 256×256 tile) | **the router** (`E-OGAR-ROUTER-ENCODER` GREEN 2-axis case) | |
| 33 | +| `sketch::fwht` + `walsh_pyramid_energy` | the deterministic FIELD ENCODER (Walsh–Hadamard pyramid) | **the encoder** | |
| 34 | +| `witness::particle_equals_wave` (Parseval over FWHT) | particle (pointer-chase `∑field·arc`) ≡ wave (one transform, many arcs) | **the particle/wave click, proven on a real field** | |
| 35 | + |
| 36 | +## The crucial honesty (why this is a join, not a merge) |
| 37 | + |
| 38 | +The two ends are **complementary halves**, deliberately: |
| 39 | + |
| 40 | +- **`perturbation-sim` does the EXACT FULL recompute each round** — `simulate_outage` recomputes |
| 41 | + DC flows on the *surviving* network from scratch every round ("robust where iterated single-line |
| 42 | + LODF would drift", per `cascade.rs`). It is NOT incremental. What it ships *alongside* is the |
| 43 | + **certification apparatus**: `spectral_perturbation`'s Weyl/Davis–Kahan bounds are exactly the |
| 44 | + inequalities an incremental scheme needs to prove it equals the full recompute. |
| 45 | +- **`compute_dag` is the INCREMENTAL dispatch** — recompute only the dirty dependents, in |
| 46 | + `compute_dag_topo_order`, each gated by the cycle-aware `write_row`. The Weyl bound this crate |
| 47 | + certifies is *why* that incremental recompute is sound (a bounded local change → bounded global |
| 48 | + perturbation → the dirty-set is the complete support of the change). |
| 49 | + |
| 50 | +So: **this crate = the proof + the full reference + the router/field/witness encoders; the |
| 51 | +`compute_dag` harness = the incremental consumer whose equivalence this crate's Weyl bound |
| 52 | +certifies.** Stockfish NNUE is the existence proof that the incremental side works at scale; |
| 53 | +this crate is the existence proof that the bound holding it together is real. |
| 54 | + |
| 55 | +## What this does NOT claim (scope guard) |
| 56 | + |
| 57 | +- **No speed claim.** `witness.rs` already states the particle/wave win is "one field, many arcs |
| 58 | + whose spectra are reusable", not a measured single-arc speedup. This doc inherits that honesty. |
| 59 | +- **No new dependency.** `perturbation-sim` remains zero-dep, workspace-excluded, standalone. |
| 60 | + This is a conceptual bridge; the only wiring is the optional `ndarray-simd` git feature that |
| 61 | + already existed for the eigensolver/reliability path. |
| 62 | +- **The numeric witness arc ≠ the contract `WitnessTable`.** Already guarded in `witness.rs` |
| 63 | + (`I-VSA-IDENTITIES` register-loss / Frankenstein hazard). The mapping above pairs *mechanisms* |
| 64 | + (Parseval ≡ particle/wave), never the value categories (`&[f64]` field vs 6-bit W-slot identity). |
| 65 | +- **Per-node/per-cell evaluation semantics are general compute**, dispatched via the DO arm / |
| 66 | + `UnifiedStep` — not the Walsh field. The *recompute structure* transfers; the *formula content* |
| 67 | + (`=VLOOKUP`, a per-square chess eval, a per-bus injection) does not. Same line `E-EXCEL` / |
| 68 | + `E-CHESS` already drew. |
| 69 | + |
| 70 | +## Consumer payoff |
| 71 | + |
| 72 | +The probe `probe-excel-compute-dag-v1` lands `ClassView::compute_dag` on the clean 2-axis sheet. |
| 73 | +This doc shows the *same* `compute_dag` already has a physical, certified instance here: an OSM → |
| 74 | +gaussian-splat → electricity-perturbation consumer (the 3D sibling cascade of `E-OGAR-ROUTER-ENCODER`) |
| 75 | +is a `compute_dag` consumer whose recompute order is `simulate_outage`'s round structure and whose |
| 76 | +incremental-equivalence is Weyl-bounded. Every computed-field AR consumer (odoo `@api.depends`, |
| 77 | +medcare lab-trends, woa calc, q2 cells, **and** the electricity-cascade analytics) reduces to the |
| 78 | +same `compute_dag_topo_order` dispatch. |
0 commit comments