YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
- J Matrix Twin
J Matrix Twin
โโโ โโโโ โโโโ โโโโโโ โโโโโโโโโโโโโโโโ โโโโโโ โโโ
โโโ โโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโ โโโโโโโโโโโโโโโโโโโ โโโ โโโโโโโโโโโ โโโโโโ
โโ โโโ โโโโโโโโโโโโโโโโโโโ โโโ โโโโโโโโโโโ โโโโโโ
โโโโโโโโ โโโ โโโ โโโโโโ โโโ โโโ โโโ โโโโโโโโโโ โโโ
โโโโโโ โโโ โโโโโโ โโโ โโโ โโโ โโโโโโโโโ โโโ
โโโโโโโโโโโโ โโโโโโโโโโ โโโ
โโโโโโโโโโโโ โโโโโโโโโโโ โโโ
โโโ โโโ โโ โโโโโโโโโโโโ โโโ
โโโ โโโโโโโโโโโโโโโโโโโโโโโ
โโโ โโโโโโโโโโโโโโโโ โโโโโโ
โโโ โโโโโโโโ โโโโโโ โโโโโ
SUBLEQ Attention Engine โข Tacit Array Programming โข Goldilocks Field Arithmetic
๐ Live Playground โข ๐ Documentation โข ๐ฏ Quick Start
๐ What Is This?
J Matrix Twin is a revolutionary attention mechanism that replaces transformer softmax with SUBLEQ (one-instruction computing). Built in pure J with a WebAssembly playground.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Traditional Attention โ SUBLEQ Attention โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ softmax(QK^T/โd) V โ SUBLEQ([A,B,C]...) โ Born โ
โ โข Exponentials โ โข Subtract-and-branch โ
โ โข Normalization โ โข No exponentials โ
โ โข Floating point โ โข Deterministic โ
โ โข Unstable โ โข ฯ-weighted collapse โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฏ Key Features
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โก SUBLEQ Replaces Softmax No exponentials, pure logic โ
โ ๐จ Tacit Programming Point-free J verbs โ
โ ๐ Goldilocks Field ZK-SNARK compatible โ
โ ๐ WebAssembly Playground Interactive browser UI โ
โ ๐ฌ AI Chat Assistant Learn as you code โ
โ ๐ฆ Zero Dependencies Works offline โ
โ ๐ GitHub Pages Ready Deploy in 3 commands โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Quick Start
One-Line Install
git clone https://github.com/SNAPKITTYWEST/j-matrix-twin.git && cd j-matrix-twin/playground && npm install && npm start
Or Step-by-Step
# 1. Clone repository
git clone https://github.com/SNAPKITTYWEST/j-matrix-twin.git
cd j-matrix-twin
# 2. Start playground
cd playground
npm install
npm start
# 3. Open browser
open http://localhost:8080
That's it! ๐ The playground works without J installed (WASM fallback).
๐ WORM Integration (Phase 5)
Matrix computation results are now finalized as immutable ledger entries:
# worm_receipts.nim โ Seal j-matrix results to append-only WORM ledger
proc sealJMatrixResult*(
j_code: string,
result_vector: seq[int64],
writer_id: seq[byte]): bool
# Automatically invoked after matrix operations complete
# Results: deterministic, signed, tamper-evident
See worm_receipts.nim for implementation.
๐ Documentation
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ README.md You are here โ
โ โก QUICKSTART.md 5-minute getting started โ
โ ๐ INTEGRATION.md Wire to sovereign stack โ
โ ๐ DEPLOYMENT.md GitHub Pages deployment โ
โ ๐ HANDOFF.md Project context & decisions โ
โ ๐ฎ playground/ Interactive web playground โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐จ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ J Matrix Twin Stack โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโผโโโโโ โโโโโโผโโโโโ โโโโโโผโโโโโ
โ Canvas โ โ SUBLEQ โ โResonanceโ
โTransformโ โAttentionโ โ Word โ
โโโโโโฌโโโโโ โโโโโโฌโโโโโ โโโโโโฌโโโโโ
โ โ โ
โ โโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโ โ
โ โ โ โ
โโโโโโผโโโโโผโโโโโ โโโโโโผโโโโผโโโโโ
โ Nim Bridge โโโโโโWebSocketโโโโโโโโบโ Playground โ
โ (In-Memory) โ โ (Browser) โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
Core Components
1๏ธโฃ Canvas Transform (canvas.ijs)
NB. Tacit matrix growth - no named variables!
getRows =: {. @ $
getCols =: {: @ $
padRight =: ] ,. (getRows@] $ 4 $ ' '"_)
growCanvasTacit =: addFooter @: padRight
2๏ธโฃ SUBLEQ Attention (subleq_attention.ijs)
NB. Replace softmax with subtract-and-branch
subleq_step =: 4 : 0
'A B C pc' =. x
mem =. y
val =. (B { mem) - (A { mem)
mem =. val B } mem
if. val <: 0 do. npc =. C
else. npc =. pc + 3 end.
mem ; npc
)
3๏ธโฃ Goldilocks Field (resonance_word.ijs)
NB. ZK-SNARK compatible arithmetic
P_GOLD =: 18446744069414584321x
gf_add =: P_GOLD & |@+
gf_mul =: P_GOLD & |@*
๐ฎ Playground Features
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ ๐จ IBM Carbon Design Professional dark theme โ โ
โ โ ๐ฌ AI Chat Assistant Context-aware help โ โ
โ โ โก Live Execution Real-time J code โ โ
โ โ ๐ Built-in Examples Canvas, SUBLEQ, Fields โ โ
โ โ ๐ WebSocket Server Optional J execution โ โ
โ โ ๐ฆ WASM Fallback Works offline โ โ
โ โ โจ๏ธ Keyboard Shortcuts Ctrl+Enter to run โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Screenshots
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Editor โ Output โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ NB. Tacit growth โ --- Original Canvas --- โ
โ canvas =: 3 50 $ 'J ENGINE...' โ J ENGINE: NB. ASCII... โ
โ growCanvasTacit =: ... โ โ
โ echo growCanvasTacit canvas โ --- After Growth --- โ
โ โ J ENGINE: NB. ASCII... โ
โ [Run Code] Ctrl+Enter โ NB. J AUTOMATED GROWTH โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฌ The Science
SUBLEQ as Attention
Traditional attention uses softmax for normalization:
attention(Q,K,V) = softmax(QK^T/โd) V
^^^^^^^^
Exponentials!
SUBLEQ attention uses memory-addressed branching:
attention(activations) = SUBLEQ([A,B,C]...) โ Born_collapse(outputs)
^^^^^^ ^^^^
Subtract-branch ฯ-weighted selection
Why this works:
- Softmax = normalization + selection
- SUBLEQ = deterministic branching
- Born collapse = ฯ-weighted selection
- No exponentials, no instability!
Tacit Programming
Point-free composition eliminates named variables:
NB. Explicit (named variables)
growCanvas =: 3 : 0
shape =. $ y
rows =. {. shape
cols =. {: shape
...
)
NB. Tacit (point-free)
getRows =: {. @ $
getCols =: {: @ $
growCanvasTacit =: addFooter @: padRight
Same behavior, pure composition!
Goldilocks Field
Prime: p = 2^64 - 2^32 + 1 = 18446744069414584321
Properties:
- โ Fits in 64-bit unsigned integer
- โ ZK-SNARK friendly (Plonky2, Miden)
- โ Fast modular arithmetic
- โ Lattice-based crypto compatible
๐ Sovereign Stack Integration
claudes-harness โ Prolog identity kernel
sovereign-transformer โ Datalog + x86 ASM corpus gate
sovereign-array โ Lean 4 APL algebra (zero sorry)
sov-kernel-monster โ Fortran 2018 quantum sim (152K lines)
errant โ Linear Forth ISA (QTT + WORM)
bob-orchestrator โ Lean 4 + Ada + Mamba + Prolog
abjad-swarm โ Arabic numerology compute substrate
systemic-intelligence โ 7-layer verified pipeline (Agda โ SUBLEQ)
j-matrix-twin โ THIS โ J tacit engine + Nim bridge
See INTEGRATION.md for wiring specifications.
๐ Performance
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Metric โ Value โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโชโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ
โ J Execution โ 10-500ms (depends on code) โ
โ WebSocket Latency โ <10ms (local) โ
โ WASM Fallback โ ~100ms (simulated) โ
โ Cold Start โ ~50ms (server spawn) โ
โ Memory Usage โ <50MB (browser) โ
โ Bundle Size โ ~100KB (uncompressed) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโงโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ค Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ Found a bug? Open an issue โ
โ ๐ก Have an idea? Start a discussion โ
โ ๐ง Want to help? Submit a PR โ
โ ๐ Improve docs? Edit and PR โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ License
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ SOVEREIGN SOURCE LICENSE โ
โ Apache 2.0 โ
โ โ
โ Copyright 2026 Jessica (SNAPKITTYWEST) โ
โ โ
โ Licensed under the Apache License, Version 2.0 โ
โ You may obtain a copy at: โ
โ http://www.apache.org/licenses/LICENSE-2.0 โ
โ โ
โ All IP belongs to Jessica (jessicalw34@gmail.com) โ
โ Ahmad Ali Parr was a prior collaborator who has left โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
See LICENSE for full text.
๐ Community
Join the conversation!
๐ฌ Discussions โข ๐ Issues โข ๐ง Email
๐ฏ Roadmap
โ
Phase 1: Core Implementation
โโ Canvas transforms
โโ SUBLEQ attention
โโ Goldilocks field
โโ Nim bridge
โ
Phase 2: Web Playground
โโ IBM Carbon UI
โโ WebSocket server
โโ AI chat assistant
โโ GitHub Pages deployment
๐ง Phase 3: Advanced Features
โโ Multi-head attention visualization
โโ Real-time collaboration
โโ WASM J interpreter
โโ Mobile app (React Native)
๐ Phase 4: Research
โโ Benchmark vs transformer attention
โโ Formal verification (Lean 4)
โโ Academic paper
โโ Conference presentation
๐ Learn More
J Language
SUBLEQ
Goldilocks Field
๐ Acknowledgments
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โข J Software (jsoftware.com) for the J language โ
โ โข IBM Carbon Design System for UI inspiration โ
โ โข Ahmad Ali Parr (prior collaborator) โ
โ โข The array programming community โ
โ โข Everyone who stars, forks, and contributes! โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ Made with โค๏ธ by SNAPKITTYWEST โ
โ โ
โ "Sovereign AI through tacit composition" โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โญ Star this repo โข ๐ Try the playground โข ๐ Read the docs