Setup Guide
What You Need
Every experiment on this site is a standalone .sx file written in the
Simplex programming language.
To run an experiment you need three things:
- The Simplex compiler (
sxc) — compiles.sxfiles to LLVM IR - A C compiler (Clang) — links the IR with the Simplex runtime into a binary
- The experiment source file (
.sx) — downloadable from each experiment page
There are two paths: download pre-built binaries from GitHub releases (fastest) or build from source (full control).
Option A: Pre-Built Binaries (Fastest)
A1. Download
Go to github.com/senuamedia/lab/releases and download the latest release for your platform (macOS or Linux). The release contains:
sxc— the Simplex compiler binarystandalone_runtime.c— the C runtime (needed for linking)
A2. Install Dependencies
You need Clang (C compiler) and OpenSSL (for the runtime's crypto functions).
# macOS — Clang ships with Xcode Command Line Tools
xcode-select --install
# Install OpenSSL and Python 3 via Homebrew
brew install openssl python3
# Ubuntu / Debian Linux
sudo apt update
sudo apt install clang libssl-dev python3
A3. Verify Installation
# Check Clang is available
clang --version
# Check the Simplex compiler runs
./sxc --version
# Should print: sxc 0.17.0 (or later)
Option B: Build From Source
B1. Install Dependencies
Same as Option A — you need Clang, OpenSSL, and Python 3.
# macOS
xcode-select --install
brew install openssl python3
# Linux
sudo apt update && sudo apt install clang libssl-dev python3
B2. Clone the Repository
git clone https://github.com/senuamedia/lab.git
cd lab
B3. Build the Compiler
./build.sh
This uses the Python bootstrap compiler (stage0.py) to compile the
Simplex compiler (sxc) from its own source code. The resulting binary
is at build/sxc. The runtime source is at runtime/standalone_runtime.c.
B4. Verify the Build
./build/sxc --version
# Should print: sxc 0.17.0 (or later)
Running an Experiment
Every experiment page on this site includes a Download .sx button. Download the file, then follow these three steps.
Step 1: Compile the Simplex Source to LLVM IR
# Replace EXPERIMENT with the filename (e.g., exp_iratio_proof)
./sxc EXPERIMENT.sx -o EXPERIMENT.ll
This produces an LLVM IR file (.ll). The compiler will print
Compilation successful. if the source is valid.
Step 2: Link with the 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
This produces a native executable. You need standalone_runtime.c in
the same directory (or provide the full path). If you built from source,
it's at simplex/runtime/standalone_runtime.c.
Step 3: Run
./EXPERIMENT
The experiment prints its results to the terminal. Exit code 0 means all tests passed. Non-zero means one or more tests failed — the output will indicate which.
Running All Experiments at Once
If you built from source and have the experiment files in a directory alongside the Simplex source:
# Directory structure expected:
# simplex/ ← the compiler source
# build/sxc ← compiled compiler
# runtime/standalone_runtime.c
# theorem-proof/ ← experiment files
# exp_contraction.sx
# exp_lyapunov.sx
# run_all.sh
# run_math_tests.sh
cd theorem-proof
# Run 6 core theorem experiments
./run_all.sh
# Run 188 compiler math validation tests
./run_math_tests.sh
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: 375B× 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.