Repository navigation
feat(adr-001 #3): coherence-gated event filter — skip-on-small-delta - #34
Merged
Merged
Conversation
…gate
ADR-001 thesis: "intelligence is sparse, event-driven, sub-linear,
coherence-gated activation." This lands the coherence-gated part of
the activation gate — the "no event, no work" path enriched with
magnitude awareness.
Math: for strict-DD A = D - O with coherence margin
c = min_i (|A[i,i]| - Σ_{j≠i}|A[i,j]|) / |A[i,i]|,
the Neumann-series envelope gives
‖A⁻¹ δ‖_∞ ≤ ‖δ‖_∞ / (min_i |A[i,i]| · c).
If that bound is below the caller's tolerance, the solve cannot
produce a meaningful change in x — and the caller can skip it
entirely, in O(|δ|) time. Independent of n, independent of nnz(A).
Lands:
src/coherence.rs (+108 LOC)
delta_inf_bound(matrix, delta_values) -> Option<Precision>
Computes the bound directly from a matrix + delta. Linear cost,
meant for the "one-shot" call site. Returns None on non-strict-DD
input (envelope doesn't hold).
delta_below_solve_threshold(coherence, min_diag, delta, tolerance) -> bool
Cached-input fast path. O(|δ|) per call — independent of n + nnz.
Callers cache (coherence_score, min_diag) once at matrix-build
time and probe this on every event.
Returns false (refuse to skip) on:
- tolerance <= 0 (gate disabled)
- coherence <= 0 (non-strict-DD; bound doesn't hold)
- min_diag <= 0
- bound exceeds tolerance (meaningful change may have happened)
src/lib.rs
Re-exports delta_inf_bound + delta_below_solve_threshold.
Tests: 7 new coherence::tests covering the strict-DD fast path,
non-DD rejection, tiny-delta skip, above-threshold no-skip, disabled
tolerance, and empty-delta edge case.
This composes naturally with solve_on_change_sublinear: an agent's
inner loop probes delta_below_solve_threshold first; only if the
check fails does it pay the closure + per-entry-Neumann cost.
Co-Authored-By: claude-flow <ruv@ruv.net>
This was referenced May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ADR-001 thesis: intelligence is sparse, event-driven, sub-linear, coherence-gated activation. This PR lands the coherence-gated part — the "no event, no work" path enriched with magnitude awareness.
Math
For strict-DD `A = D - O` with coherence margin
`c = min_i (|A[i,i]| - Σ_{j≠i}|A[i,j]|) / |A[i,i]|`
the Neumann-series envelope gives
`‖A⁻¹ δ‖_∞ ≤ ‖δ‖_∞ / (min_i |A[i,i]| · c)`.
If that bound is below the caller's tolerance, the solve cannot produce a meaningful change in `x` — and the caller can skip it in `O(|δ|)`. Independent of `n`, independent of `nnz(A)`.
API
Refuses to skip on:
Composition
Composes naturally with `solve_on_change_sublinear` and `contrastive_solve_on_change_sublinear` shipped in #29 / #27. An agent's inner loop probes `delta_below_solve_threshold` first; only on a meaningful event does it pay the closure + per-entry-Neumann cost.
Test plan
🤖 Generated with claude-flow