aprender 0.18.2

Next-generation machine learning library in pure Rust
Documentation
# Renacer Performance Assertions for aprender
#
# These assertions enforce performance budgets for aprender (pure Rust ML library).
# Assertions run at build time (via cargo test) and fail CI if violated.
#
# Toyota Way Principle: Andon (stop the line when defects detected)

[[assertion]]
name = "ml_algorithm_latency"
type = "critical_path"
max_duration_ms = 1000  # ML algorithms should complete in <1s for small datasets
fail_on_violation = true
enabled = true

[[assertion]]
name = "max_syscall_budget"
type = "span_count"
max_spans = 3000  # ML workloads may have higher I/O for data loading/model serialization
fail_on_violation = true
enabled = true

[[assertion]]
name = "memory_allocation_budget"
type = "memory_usage"
max_bytes = 1073741824  # 1GB maximum for ML model training + data structures
tracking_mode = "allocations"
fail_on_violation = true
enabled = true

[[assertion]]
name = "prevent_god_process"
type = "anti_pattern"
pattern = "GodProcess"
threshold = 0.8  # 80% confidence threshold
fail_on_violation = false  # Warning only (not blocking)
enabled = true

[[assertion]]
name = "detect_pcie_bottleneck"
type = "anti_pattern"
pattern = "PCIeBottleneck"
threshold = 0.7  # Detect excessive GPU memory transfers (when using trueno GPU backend)
fail_on_violation = false  # Warning only (GPU features optional)
enabled = true

# Disabled assertion (example - can be enabled for stricter checking)
[[assertion]]
name = "ultra_strict_latency"
type = "critical_path"
max_duration_ms = 100  # <100ms (very aggressive for ML algorithms)
fail_on_violation = true
enabled = false  # Disabled by default

# ==============================================================================
# Golden Trace Performance Validation
# ==============================================================================
# Validates that ML algorithms (K-means, decision trees, dataframes, graph analytics)
# meet performance expectations using golden traces for regression detection.

[semantic_equivalence]
enabled = true
baseline_dir = "golden_traces/baseline"
min_confidence = 0.90  # 90% confidence required for PASS

# Validation checks
check_write_patterns = true          # Output correctness
check_file_operations = true         # Model serialization I/O validation
check_output_correctness = true      # Exact output matching
check_memory_allocations = false     # ML allocations may vary

# Performance expectations (SIMD-accelerated ML vs baseline)
expected_speedup_min = 1.0           # Baseline comparison
expected_speedup_max = 50.0          # Sanity check for trueno SIMD speedups

# Lamport clock configuration
[lamport_clock]
enabled = true
propagate_across_fork = true
propagate_across_exec = true
env_var = "RENACER_LAMPORT_CLOCK"

# Trace compression
[compression]
enabled = true
algorithm = "rle"  # Run-length encoding
min_file_size_kb = 100  # Only compress traces >100KB

# OpenTelemetry export (optional - for Jaeger/Grafana integration)
[otlp]
enabled = false  # Enable when observability stack available
endpoint = "http://localhost:4317"
service_name = "aprender"

# CI/CD integration
[ci]
fail_fast = true  # Stop on first assertion failure (Andon principle)
export_format = "json"
export_path = "target/renacer-reports"
compare_with_baseline = true