Setup Guide
What You Need
This site hosts experiments in three languages:
- C — Paper 3 (NS regularity, 3D Galerkin solver, energy conservation)
- Python — Paper 3 (independent validation, scipy cross-validation)
- Simplex — Papers 1 & 2 (Unified Adaptation Theorem, Scaffold Framework)
To verify the NS regularity result (Paper 3), you only need a C compiler and Python. No Simplex installation is required.
Paper 3: NS Regularity (C & Python)
DOI: 10.5281/zenodo.19212394 — Energy Conservation, Cascade Stabilisation, and the Regularity of the 3D Navier–Stokes Equations.
Prerequisites
# macOS
xcode-select --install # Clang C compiler
pip3 install numpy scipy # Python validation
# Linux
sudo apt update && sudo apt install gcc python3-pip
pip3 install numpy scipy
Clone the Repository
git clone https://github.com/senuamedia/lab.git
cd lab
Step 1: Verify Energy Conservation (The Central Claim)
This test verifies that the v3 solver conserves energy exactly. At ν=0, the nonlinear term must produce zero net energy change. Any drift proves a solver bug.
# Build the v3 kernel and energy audit
gcc -O3 -c solvers/v3/triad_kernel_v3.c -o kernel.o
gcc -O3 -c experiments/v3_final/experiment_energy_audit.c -o audit.o
gcc -O2 audit.o kernel.o -o run_audit -lm
# Run
./run_audit
Expected: At ν=0, energy drift < 0.02% at all N (Euler truncation only, not RHS error). At ν>0, energy DECREASES at every N.
Step 2: Independent Python Validation
A completely independent Python implementation — no shared code with the C kernel. Verifies energy conservation, energy decrease, and divergence-free preservation.
python3 validation/ns_galerkin_3d.py
Expected:
- Σ conj(û)·NL = 0.000000e+00 at all N (energy conserved)
- Energy decreases at ν > 0
- Divergence-free preserved to 10−16
Step 3: scipy RK45 Cross-Validation (Third Implementation)
Uses scipy's adaptive RK45 integrator at rtol=10−10 as a high-accuracy reference. If the C and Python Euler-based solvers match scipy's RK45, the physics is correct.
python3 validation/dedalus_ns_test.py
Expected: E(0) matches to all digits. E(T) within 9×10−6 (time-stepping difference).
Step 4: Taylor–Green Analytical Test
The Taylor–Green vortex has a known exact energy decay rate. If the solver reproduces it, the implementation is correct.
gcc -O3 -c validation/taylor_green_test.c -o tg.o
gcc -O2 tg.o kernel.o -o run_tg -lm
./run_tg
Expected: Energy decay matches exp(−6νt) to 10−7 relative error at all tested viscosities.
Step 5: Cascade Stabilisation (Adaptive Truncation)
The key experiment: does the forward cascade stabilise at a finite wavenumber? N grows dynamically — no artificial boundary.
gcc -O3 -c experiments/v3_final/experiment_adaptive_n.c -o adaptive.o
gcc -O2 adaptive.o kernel.o -o run_adaptive -lm
./run_adaptive
Expected: At A=0.1, ν=0.01: N stabilises at ~10–14. Energy monotonically decreases. Enstrophy bounded.
Step 6: Scaffold Array Contraction Test
Measures contraction ratios across truncation levels. All ratios ρ < 1 means perspectives converge.
gcc -O3 -c experiments/v3_final/experiment_tipping_point.c -o tipping.o \
-DPARAM_N_MAX=8
gcc -O2 tipping.o kernel.o -o run_tipping -lm
./run_tipping
Expected: All ρ < 1 at every amplitude through A=0.35.
Step 7: Lemma Verification
Verifies the formal proof's key lemma: RK = |TK| / (E · Ω1/2 · Kγ−1) is bounded.
gcc -O3 -c validation/verify_lemma.c -o vl.o
gcc -O2 vl.o kernel.o -o run_vl -lm
./run_vl
Expected: R ≤ 0.031 at all (K, t, ν, A). BOUNDED at every row.
Reproducing the v2 Bug (Optional)
To confirm the energy conservation failure in the original v2 solver:
# Build with v2 kernel instead
gcc -O3 -c solvers/v2/triad_kernel_v2.c -o kernel_v2.o
gcc -O3 -c experiments/v3_final/experiment_energy_audit.c -o audit.o
gcc -O2 audit.o kernel_v2.o -o run_audit_v2 -lm
./run_audit_v2
Expected: At ν=0, energy drift of +1% to +15% (Δt-independent). This confirms the bug that Paper 3 identified and corrected.
Papers 1 & 2: Simplex Experiments
The Unified Adaptation Theorem and Scaffold Framework experiments are implemented in Simplex. These require building the Simplex compiler.
Option A: Pre-Built Binaries (Fastest)
Go to github.com/senuamedia/lab/releases and download the latest release for your platform (macOS or Linux).
Option B: Build From Source
# Prerequisites
# macOS: xcode-select --install && brew install openssl python3
# Linux: sudo apt install clang libssl-dev python3
git clone https://github.com/senuamedia/lab.git
cd lab
./build.sh
./build/sxc --version # Should print: sxc 0.17.0 (or later)
Running a Simplex Experiment
# Step 1: Compile to LLVM IR
./sxc EXPERIMENT.sx -o EXPERIMENT.ll
# Step 2: Link with runtime
# macOS:
OPENSSL=$(brew --prefix openssl)
clang -O2 EXPERIMENT.ll standalone_runtime.c \
-o EXPERIMENT -lm -lssl -lcrypto -L${OPENSSL}/lib
# Linux:
clang -O2 EXPERIMENT.ll standalone_runtime.c \
-o EXPERIMENT -lm -lssl -lcrypto -lpthread
# Step 3: Run
./EXPERIMENT
Running All Simplex Experiments at Once
cd theorem-proof
./run_all.sh # 6 core theorem experiments
./run_math_tests.sh # 188 compiler math tests
Troubleshooting
| Problem | Solution |
|---|---|
sxc: command not found |
Use the full path: ./build/sxc or add to your PATH |
Undefined symbols ... _SSL_* |
OpenSSL not linked. Add -L$(brew --prefix openssl)/lib (macOS) or install libssl-dev (Linux) |
standalone_runtime.c: No such file |
Provide the full path to the runtime file, e.g., ../simplex/runtime/standalone_runtime.c |
warning: overriding module target triple |
Harmless. The compiler targets x86_64; Clang adjusts to your system automatically |
Experiment prints FAIL |
Check the output — it indicates which specific test failed and the expected vs actual values |
xcode-select: error |
On macOS, you need the Command Line Tools. Run xcode-select --install and follow the prompt |
Understanding .sx Files
Simplex (.sx) files are plain text source code. You can open them in
any text editor. Each experiment is self-contained — no imports, no
dependencies beyond the compiler and runtime.
Key syntax patterns you'll see:
// Variables: 'let' for immutable, 'var' for mutable
let x: f64 = 3.14;
var count: i64 = 0;
// Functions
fn add(a: f64, b: f64) -> f64 {
a + b
}
// Loops
while count < 100 {
count = count + 1;
}
// Output
println("Hello from Simplex");
print_f64(x);
// Entry point — returns 0 for success
fn main() -> i64 {
// ... experiment code ...
0
}
For the full language reference, see the Simplex documentation.
Complete Experiment Index
Core Theorem Validation
| File | What it proves |
|---|---|
| exp_contraction.sx | 5 subsystems contract in Fisher metric |
| exp_gradient_interference.sx | Cosine-scaled projection: 100% resolution |
| exp_lyapunov.sx | Normalised Lyapunov: 0% violations |
| exp_invariants.sx | Foundational constraints: 0 violations / 20K steps |
| exp_timescale.sx | Timescale separation: 100% |
| exp_composition.sx | Full composed system converges |
| exp_interaction_matrix.sx | Interaction matrix converges in 5 cycles |
| exp_convergence_order.sx | Higher-order score S → 0 |
| exp_iratio_proof.sx | I = -0.5 for K=2..20 (138/138) |
| exp_iratio_proof_statistical.sx | I = -0.5 for 70 random problems |
| exp_balance_residual.sx | B-flow: 14T× precision |
Cognitive / Belief System
| File | What it proves |
|---|---|
| exp_anima_deep.sx | Belief interaction, consolidation, desires |
| exp_anima_correlated.sx | Correlated beliefs: 55% improvement |
| exp_belief_cascade.sx | Chain, circular, and delayed beliefs |
| exp_skeptical_annealing.sx | Skeptic wins at ALL horizons |
| exp_memory_dynamics.sx | Forgetting, transfer, self-reference, phase |
Cross-Domain Applications
| File | What it proves |
|---|---|
| exp_chaos_boundary.sx | S detects Feigenbaum point |
| exp_s_vs_lyapunov.sx | S-λ complementarity |
| exp_nash_equilibrium.sx | 83.5% Pareto via skeptical desire |
| exp_gan_convergence.sx | GAN stabilisation |
| exp_ode_solvers.sx | Learned solver blending |
| exp_prime_gaps.sx | Prime gap derivative series |
| exp_iratio_applications.sx | I = -0.5 in 5 domains |
| exp_code_gates.sx | Code structure convergence |
| exp_compiler_passes.sx | Per-program pass interaction |
| exp_structure_discovery.sx | Gradient topology as probe |
| exp_equilibrium_mapping.sx | B-flow equilibrium location |
Stress Tests and Robustness
| File | What it proves |
|---|---|
| exp_sensitivity.sx | 3 OOM learning rate stability |
| exp_stress_test.sx | Rosenbrock + Rastrigin |
| exp_stress_rosenbrock.sx | Banana valley at 4-10D |
| exp_stress_adversarial.sx | Anti-parallel objectives |
| exp_symmetry_breaking.sx | Groups, perturbation, phase transition |
| exp_convergence_ratios.sx | Ratio series, entropy, dominant pair |
| exp_stochastic_projection.sx | Noise unnecessary (implicit exploration) |
| exp_stochastic_rastrigin.sx | Noise on multimodal landscape |
Compiler Math Validation
| File | Tests | Coverage |
|---|---|---|
| test_math_arithmetic.sx | 75 | f64/i64 +, -, *, /, casts, edge cases |
| test_math_comparisons.sx | 23 | All 6 operators, both types, mixed |
| test_math_transcendental.sx | 66 | sqrt, sin, cos, tan, exp, ln, pow, tanh, identities |
| test_math_loops.sx | 10 | Accumulation, Newton, series, convergence |
| test_math_functions.sx | 14 | Composition, recursion, dot product, nested calls |
Total: 188/188 pass.