Skip to content

Test Suite

Raul Montoya Cardenas edited this page Jul 29, 2026 · 2 revisions

Test Suite (test/runtests.jl)

Architecture

Single file test suite under @testset "LiquidCortex".

Always-on (CPU)

Testset Asserts
Package loads Module defined
Public API is exported All 9 public symbols in names(LiquidCortex; all=false)
Removed domain symbols are NOT exported No MarketPulse, decode_market_pulse, pulse_to_input

GPU-gated (if LiquidCortex._cuda_available[])

Testset Coverage
Reference LSM lazy initialization clear state → first run_lsm_step inits; sizes match defaults
Reference LSM custom dimensions _init_ref_lsm!(n_in=8, n_out=4) + step
Reference LSM dimension validation ArgumentError on zero dims; DimensionMismatch on wrong input length
Reference LSM string output run_lsm_step_str CSV parts
SparseBrain default dims τ_m, tick_count, n_in=14, n_out=16
SparseBrain custom dims n_in/n_out wiring, W_in columns
EnsembleBrain default / custom dims 4 lobes, shared dims
step! with generic inhibition tick advances; v_thresh_dynamic > V_THRESH
ensemble_step! with generic inhibition output length matches n_out

When CUDA is unavailable: log skip + @test_skip.

Reference LSM Isolation Helpers

Tests use snapshot / clear / restore helpers so reference module globals do not leak between cases:

  • snapshot_reference_lsm_state()
  • clear_reference_lsm_state!()
  • restore_reference_lsm_state!(state)

Wrapped in try / finally around each reference testset.

Public Symbol Checklist

Exported:

SparseBrain, EnsembleBrain,
step!, ensemble_step!, get_output, get_ensemble_output,
compute_reservoir_covariance!, diagnostics, ensemble_diagnostics

Running Locally

julia --project -e 'using Pkg; Pkg.test()'

On GPU hosts, expect full SparseBrain construction (can take noticeable time and VRAM for EnsembleBrain tests).

Related


Last updated: July 28, 2026 Updated by: Grok Build: Grok 4.5 Package tip reference: 4e2698c (main)

Clone this wiki locally