Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Delta-Behavior
The mathematics of systems that refuse to collapse.
Delta-behavior is a design principle for building systems where change is permitted but collapse is not. It provides a framework for constraining state transitions to preserve global coherence.
Key Features
- Coherence-First Design: Optimize for stability, not just performance
- Three-Layer Enforcement: Energy cost, scheduling, and memory gating
- Attractor Dynamics: Systems naturally gravitate toward stable states
- 11 Exotic Applications: From AI safety to extropic intelligence substrates
- WASM + TypeScript SDK: Full browser/Node.js support
- Performance Optimized: O(n) algorithms with SIMD acceleration
Quick Start
Add to your Cargo.toml:
[]
= "0.1"
Basic usage:
use ;
use ;
// Create an enforcer with default configuration
let config = default;
let mut enforcer = new;
// Check if a transition should be allowed
let current = clamped;
let predicted = clamped;
match enforcer.check
The Four Properties
A system exhibits Delta-behavior when:
- Local Change: State updates happen in bounded steps
- Global Preservation: Local changes don't break overall structure
- Violation Resistance: Destabilizing transitions are damped/blocked
- Closure Preference: System naturally settles into stable attractors
Configuration
Three preset configurations are available:
// Default: Balanced stability and flexibility
let config = default;
// Strict: For safety-critical applications
let config = strict;
// Relaxed: For exploratory applications
let config = relaxed;
Custom configuration:
use ;
let config = DeltaConfig ;
11 Exotic Applications
| # | Application | Description | Key Innovation |
|---|---|---|---|
| 01 | Self-Limiting Reasoning | AI that does less when uncertain | Depth/scope scales with coherence |
| 02 | Computational Event Horizon | Bounded computation without hard limits | Asymptotic approach, never arrival |
| 03 | Artificial Homeostasis | Synthetic life with coherence-based survival | Death = coherence collapse |
| 04 | Self-Stabilizing World Model | Models that refuse to hallucinate | Observations that would destabilize are dampened |
| 05 | Coherence-Bounded Creativity | Novelty without chaos | Perturbations rejected if incoherent |
| 06 | Anti-Cascade Financial System | Markets that cannot collapse | Leverage tied to systemic coherence |
| 07 | Graceful Aging | Systems that simplify over time | Capability reduction as coherence maintenance cost |
| 08 | Swarm Intelligence | Collective behavior without pathology | Actions modified to preserve swarm coherence |
| 09 | Graceful Shutdown | Systems that seek safe termination | Cleanup as coherence-preserving operation |
| 10 | Pre-AGI Containment | Bounded intelligence growth | Intelligence ↔ coherence bidirectional constraint |
| 11 | Extropic Substrate | Complete intelligence substrate | Goal mutation, agent lifecycles, spike semantics |
Application 11: Extropic Intelligence Substrate
The crown jewel - implements three missing pieces for explicit extropic intelligence:
use ;
// 1. Goals that mutate autonomously under coherence constraints
let mut goal = new;
goal.attempt_mutation; // Coherence-gated
// 2. Agents with native lifecycles in memory
let mut substrate = new;
let agent_id = substrate.spawn_agent;
// Agent progresses: Embryonic → Growing → Mature → Senescent → Dying → Dead
// 3. Hardware-enforced spike/silence semantics
substrate.tick; // Processes spike bus, enforces refractory periods
Three-Layer Enforcement
Delta-behavior uses defense-in-depth:
Transition
|
v
+-------------+ Soft constraint:
| Energy Cost |---> Unstable = expensive
+-------------+
|
v
+-------------+ Medium constraint:
| Scheduling |---> Unstable = delayed
+-------------+
|
v
+-------------+ Hard constraint:
| Memory Gate |---> Incoherent = blocked
+-------------+
|
v
Applied
Performance Optimizations
The implementation includes several critical optimizations:
| Component | Optimization | Improvement |
|---|---|---|
| Swarm neighbors | SpatialGrid partitioning | O(n²) → O(n·k) |
| Coherence calculation | Incremental cache | O(n) → O(1) |
| Financial history | VecDeque | O(n) → O(1) removal |
| Distance calculations | Squared comparisons | Avoids sqrt() |
| Batch operations | SIMD with 8x unrolling | ~4x throughput |
SIMD Utilities
use ;
// Process vectors in batches with SIMD acceleration
let distances = batch_squared_distances;
let neighbors = batch_in_range;
WASM Support
Build for WebAssembly:
TypeScript SDK
import init, {
WasmCoherence,
WasmSelfLimitingReasoner,
WasmCoherentSwarm,
WasmContainmentSubstrate,
} from 'delta-behavior';
await init();
// Self-limiting reasoning
const reasoner = new WasmSelfLimitingReasoner(10, 5);
console.log(`Allowed depth: ${reasoner.allowed_depth()}`);
// Coherent swarm
const swarm = new WasmCoherentSwarm();
swarm.add_agent("agent-1", "[0, 0]", "[1, 0]", "[10, 10]");
const result = swarm.propose_action("agent-1", "move", "[0.5, 0.5]");
// Pre-AGI containment
const substrate = new WasmContainmentSubstrate(1.0, 10.0);
const growth = substrate.attempt_growth("Reasoning", 0.5);
Architecture
delta-behavior/
├── src/
│ ├── lib.rs # Core traits, Coherence, DeltaConfig
│ ├── wasm.rs # WASM bindings for all 11 applications
│ └── simd_utils.rs # SIMD-accelerated batch operations
├── applications/ # 11 exotic application implementations
│ ├── 01-self-limiting-reasoning.rs
│ ├── 02-computational-event-horizon.rs
│ ├── ...
│ └── 11-extropic-substrate.rs
├── adr/ # Architecture Decision Records
│ ├── ADR-000-DELTA-BEHAVIOR-DEFINITION.md
│ ├── ADR-001-COHERENCE-BOUNDS.md
│ ├── ADR-002-ENERGY-COST-LAYER.md
│ └── ...
├── wasm/ # TypeScript SDK
│ └── src/index.ts
└── pkg/ # Built WASM package
Test Coverage
✅ 32 lib tests
✅ 14 WASM binding tests
✅ 13 doc tests
───────────────────────
59 tests passing
Documentation
- API Reference
- Whitepaper - Full theoretical foundations
- API Guide - Comprehensive API documentation
- ADR Series - Architecture Decision Records
ADR Overview
| ADR | Title |
|---|---|
| 000 | Delta-Behavior Definition |
| 001 | Coherence Bounds |
| 002 | Energy Cost Layer |
| 003 | Scheduling Layer |
| 004 | Memory Gating Layer |
| 005 | Attractor Dynamics |
| 006 | Application Framework |
| 007 | WASM Architecture |
| 008 | TypeScript SDK |
| 009 | Performance Targets |
| 010 | Security Model |
Minimum Supported Rust Version
Rust 1.75.0 or later.
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.
Contributing
Contributions are welcome! Please read the contributing guidelines before submitting PRs.
Citation
If you use Delta-behavior in academic work, please cite: