Skip to content

latentcollapse/HLX_research_language

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

625 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HLX

A compiled, governed programming language for symbolic AI and autonomous agent systems. Not a general-purpose language — built for reasoning systems that need deterministic, bounded, and auditable execution.

21.5% on ARC-AGI-1 (86/400 tasks) — pure symbolic solver, no neural network, no fine-tuning.


What is HLX?

HLX is a neurosymbolic runtime for autonomous agents. It combines:

  • A bytecode VM with a Cranelift JIT backend for executing reasoning programs
  • A formal policy engine (APE) that gates what code is allowed to do at runtime
  • A language server (LSP) for IDE integration with diagnostics and RSI cockpit
  • A standard library of symbolic reasoning primitives (grids, graphs, patterns, neural ops)

If you're building a reasoning system that needs to stay legible and auditable under iteration, HLX is worth a look. If your workload is web APIs or data science, use Python.


Quick Start

Prerequisites

Build from source

git clone https://github.com/latentcollapse/HLX_research_language
cd HLX_research_language
cargo build --release -p hlx-run

The hlx binary lands in target/release/hlx.

Run your first program

./target/release/hlx hlx/tests/hello_world.hlx

Run with tracing

./target/release/hlx --debug hlx/tests/hello_world.hlx

Call a specific function

./target/release/hlx your_program.hlx --func main

Your First HLX Program

Save this as hello.hlx:

program hello {
    export fn main() -> string {
        let greeting = "hello world";
        print(greeting);
        return greeting;
    }
}

Run it:

./target/release/hlx hello.hlx
# Output: hello world

That's it. The program keyword declares an entry point. export fn main makes the function callable from the CLI. print() sends to stdout. return is required — bare expressions don't return values.


Key Language Features

Bounded loops

All loops require an explicit iteration cap. This is enforced by the VM, not advisory:

fn sum_to(n: i64) -> i64 {
    let acc = 0;
    let i = 0;
    loop(i <= n, 10000) {    // cap of 10000 iterations
        acc = acc + i;
        i = i + 1;
    }
    return acc;
}

Deterministic execution

Same input always produces the same execution path. Seeded PRNG, stable sort, deterministic map iteration. No ambient nondeterminism.

Governed I/O

File writes, network calls, and model invocations go through the APE policy engine. Policies are enforced at the VM level — not conventions, not comments.

Grid-first operations

2D grid operations are first-class, designed for ARC-AGI solving:

let g = grid_create(3, 3, 0);
let g = grid_set(g, 1, 1, 5);
let val = grid_get(g, 1, 1);   // returns 5

What's In The Repo

Directory What it is
hlx-runtime/ Parser, AST, lowerer, bytecode VM, JIT backend, builtins
hlx-run/ CLI runner
hlx-lsp/ Language server (diagnostics, type flow, RSI cockpit)
hlx-lint/ Static analysis and lint rules
hlx-eval/ ARC-AGI evaluation harness
ape/ APE governance engine (formal policy, G1–G6 gates)
hlx/stdlib/ Standard library written in HLX
hlx/tests/ Runnable examples and tests
examples/ Larger example programs
docs/ Documentation — start with walkthrough.md

Documentation


Core Invariants

These are enforced by the VM — not conventions.

Invariant What it means
Determinism Identical input → identical execution path, always
Boundedness All loops have an explicit cap; the step counter is the enforcement mechanism
Bijection Any live value serializes to LC-B wire format and back with zero loss
Universal Values All values are `I64
Reversibility Values are immutable and copy-on-write; old states are never destroyed

These are distinct from the RSI Synthesis Gates (G1–G6) in ape/, which specifically gate self-improvement operations.


APE — The Governance Engine

ape/ is a separate Rust crate that enforces policy at the VM level.

Good entry points:

  • ape/examples/embed_verify.rs
  • ape/examples/embed_execute.rs
  • ape/examples/redteam_attack_suite.rs

The ARC-AGI Work

HLX includes a symbolic solver for ARC-AGI, a benchmark designed to test general reasoning in AI systems.

Current score: 86/400 (21.5%) — pure symbolic solver, no LLM assistance on the core path.

The solver lives in hlx/stdlib/hil/solve.hlx. The evaluation harness is in hlx-eval/. If you want to understand how the symbolic reasoning works, that is the best place to start.


Validation

Run the full production validation matrix:

./scripts/validate.sh

This runs 15+ lanes covering:

Phase Lanes
Language/Runtime Parser round-trips, VM builtins, stdlib module load, governed handles, state reset
LSP Protocol tests, scope boundaries, outcome exhaustiveness, branch-drift tracking
RSI Gap sensor tests, RSI entry point execution
Bond Qwen3.5 0.8B and 4B model load + coherent response (skipped if models absent)

For the ARC-AGI eval harness, see scripts/eval.sh and scripts/run_arc_eval_fast.sh.


Language Server

cargo run -p hlx-lsp

Provides diagnostics, type flow visualization, and the RSI cockpit for the language server protocol.


Status

This is an active research project, not a production SDK. Things break, APIs change, and the standard library is growing. The ARC-AGI score is the most honest signal of where the system is at.

Contributions and issues welcome.


License

AGPL v3.

About

HLX(Hybrid Logic eXtension): an experimental research language exploring whether symbolic intelligence can be deterministically encoded in syntax. Its design is informed by Python’s semantic accessibility and Tiny Recursive Models research by Samsung Montreal, with the goal of creating a persistent symbolic substrate for recursive intelligence

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages