|
11 | 11 | //! the field, and by **Parseval for the Walsh–Hadamard transform** (`Hᵀ H = N·I`, |
12 | 12 | //! the involution-up-to-`N` the pyramid already provides via [`fwht`]): |
13 | 13 | //! `⟨field, arc⟩ = (1/N)·⟨Ĥfield, Ĥarc⟩`. Transform the field **once** |
14 | | -//! (`O(N log N)`); then every witness arc is an `O(N)` dot against its spectrum — |
15 | | -//! the whole arc is evaluated at once, no walk. |
| 14 | +//! (`O(N log N)`); then each witness arc is read against the field spectrum — |
| 15 | +//! the whole arc is evaluated at once, no hop-by-hop walk. |
16 | 16 | //! |
17 | 17 | //! **The identity `particle == wave` is what this probe proves** ([`particle_equals_wave`]). |
18 | | -//! The payoff is amortization: [`field_spectrum`] computes the standing wave once, |
19 | | -//! and [`witness_from_spectrum`] reads many arcs off it — `O(N log N) + q·O(N)` for |
20 | | -//! `q` arcs, vs the particle view's `q` independent pointer-chasing walks. |
| 18 | +//! The amortized quantity is the **field** transform: [`field_spectrum`] computes the |
| 19 | +//! standing wave once and [`witness_from_spectrum`] reuses it across many arcs. As |
| 20 | +//! implemented, each arc is itself transformed (`fwht` on the arc), so the per-arc |
| 21 | +//! cost is `O(N log N)` and the `q`-arc total is `O(N log N) + q·O(N log N)`; it |
| 22 | +//! narrows to `O(N log N) + q·O(N)` only when the arc spectrum is precomputed or the |
| 23 | +//! arc is structured/sparse (its spectrum known in closed form). The win over the |
| 24 | +//! particle view's `q` independent pointer-chasing walks is therefore in the regime |
| 25 | +//! "one field, many arcs whose spectra are reusable", not for a single dense arc — |
| 26 | +//! this probe makes **no measured** speed claim (see [`crate::sketch`] for the same |
| 27 | +//! honest framing of the demo-`N` exact path). |
21 | 28 | //! |
22 | 29 | //! Self-contained, in perturbation-sim — this demonstrates the pyramid/field |
23 | 30 | //! mechanism on a grid field (e.g. the [`crate::inertia_buffer_column`] field). |
24 | | -//! Wiring it as the *actual* `witness_table` evaluator in the contract is a separate, |
25 | | -//! gated step: the witness/SoA types are the cognitive spine — additive only, behind |
26 | | -//! the iron rules. |
| 31 | +//! |
| 32 | +//! # NOT the same "witness arc" as `lance_graph_contract::witness_table` |
| 33 | +//! |
| 34 | +//! This module's "witness arc" is a **numeric** object: a signed `&[f64]` weight |
| 35 | +//! vector read against an `&[f64]` field by an inner product (`∑ field·arc`). The |
| 36 | +//! contract's `WitnessTable` arc is an **identity** object: a chain of 6-bit |
| 37 | +//! W-slot indices each resolving to a `WitnessEntry { mailbox_ref: u32, |
| 38 | +//! spo_fact_ref: Option<u64> }` (which mailbox witnessed a belief, and whether it |
| 39 | +//! crystallised to an SPO fact). They share the *word* "witness arc" and the |
| 40 | +//! Markov-#1-reference-chain *shape*, but operate on **different value categories** |
| 41 | +//! — there is no Parseval identity over identity tuples, and the W-slot table is |
| 42 | +//! already `O(1)` array indexing with nothing to transform away. Do **not** unify |
| 43 | +//! them under one trait: that would conflate field-evaluation with |
| 44 | +//! identity-resolution (a register-loss / Frankenstein hazard, cf. `I-VSA-IDENTITIES`). |
| 45 | +//! |
| 46 | +//! Wiring this evaluator into a real SoA traversal is a separate, downstream, **gated** |
| 47 | +//! step (D-MBX-A3, gated on D-MBX-A2; see `TD-WITNESS-EVAL-WIRING-1`): the witness/SoA |
| 48 | +//! types are the cognitive spine — additive only, behind the iron rules. When it |
| 49 | +//! happens it is a *consumer-side projection* (W-slot arc → support of an `&[f64]` |
| 50 | +//! arc over a borrowed numeric column), evaluated by these free functions — never a |
| 51 | +//! `WitnessArcEvaluator` trait on the zero-dep contract. (Contract type: |
| 52 | +//! `crates/lance-graph-contract/src/witness_table.rs`.) |
27 | 53 |
|
28 | 54 | use crate::sketch::fwht; |
29 | 55 |
|
|
0 commit comments