neuro-compiler / ARCHITECTURE.md
chrisuser's picture
Release 0.2.0-experimental graph compiler
51c8a9f verified
|
Raw History Blame Contribute Delete
2.72 kB

Graph compiler architecture

flowchart TD
  S[Restricted C++ source] --> T[Tokenization and character-offset mapping]
  T --> Q[Frozen Qwen blocks 1–6]
  Q --> A[Source-indexed neural AST]
  A --> SSA[Graph neural SSA]
  SSA --> I[Graph neural instruction selection]
  I --> R[Occupancy-supervised physical resource streams]
  R --> B[Independent neural binary encoding]
  B --> P[Bit packing and serialization]
  P --> X[Callable x86-64 SysV bytes]

The AST predicts active nodes, types, literal values, root and child pointers at source-character identities. Raw tokenizer offsets map input characters to features; they do not parse expressions or identify AST structure.

SSA preserves computational identities and learns execution ordering, value dependencies and operand references. Instruction selection retains associations with originating computations through learned pointers and copying of operand identities and immediate values.

The allocator maintains latent streams for physical register resources. Local temporal processing learns bindings and instruction-emission counts. Register content supervision supplies an auxiliary training signal at reference-aligned boundaries; reference occupancy is never supplied during inference. The model does not build a deterministic interference graph or run a conventional allocator.

The independent binary encoder operates per physical MIR instruction, predicting encoding templates and payload fields. Tensor lookup, bit packing, concatenation and EOS/PAD serialization are infrastructure around learned encoding decisions. There is no conventional assembler, ISA-based correction or semantic repair.

Stage Parameters Selected epoch
AST 753,739 68
SSA 1,078,162 79
Instruction selection 913,695 68
Register allocation 585,134 30
Independent binary encoder 311,553 2
Specialized total 3,642,283
Frozen backbone 225,608,960
Compiler total 229,251,243

Precision boundaries, masks, graph identity conventions, register descriptors, instruction vocabularies and encoding templates are preserved in the packaged definitions and manifest configs. Intermediate APIs return the original graph fields, MIR fields, emission counts, overflow flags and instruction lengths.

Resource-stream allocation and independent binary encoding have approximately linear program-length scaling under fixed resources and local processing. This is an architectural scaling argument, not measured generalization beyond seven operations. Other stages, including Qwen attention, retain quadratic components. Dynamic representations do not imply unrestricted language support.