Skip to content

elgatoconbote/CTNet-Omega

Repository files navigation

CTNet Ω-R

CTNet Ω-R is an auditable implementation path from CTNet 2.6 toward a reversible nodal-closure architecture with fixed internal topological memory.

It is not a Transformer wrapper, not a KV-cache, and not a vector-store memory system. The core contract is:

reversible cardinal state + fixed-size internal memory + fixed-size relation bank + coherence-derived phases + separated readout

Core invariants

  1. Cardinal state Z=[u,p] with d % 4 == 0.
  2. Explicit reversible core: inverse_core(core(x)) ≈ x.
  3. Internal memory M: [B,F,dm] has fixed shape. No append, no growth.
  4. Reified relations R: [B,E,dr] have fixed shape. No relation list growth.
  5. Coherence field derives atlas, fragility, saturation, incoherence debt and executive phase.
  6. Readout is separated from the reversible transition.
  7. Expanded-state reversible path: OmegaStateReversibleCore provides (Z,M,R) <-> (Z',M',R') with fixed support.

Install

python -m venv .venv
source .venv/bin/activate
pip install -e .[test]

Audit

python -m ctnet_omega --batch 2 --N 128 --d 32 --fp64

Expected regime:

fp32 MAE <= 1e-6
fp64 MAE <= 1e-14
memory_shape_ok == 1
relations_shape_ok == 1

Test

pytest -q

Minimal use

import torch
from ctnet_omega import CTNetOmega

model = CTNetOmega(d=32, n_tokens=128)
x = model.lift_text("CTNet Omega memoria topológica interna")
step = model(x)
print(step.output.shape)
print(model.phase_name(step.metrics))

xr = model.inverse_core(step.state.z)
print((x - xr).abs().mean())

Expanded reversible state core

The dissipative CTNetOmega path keeps the cardinal inverse exact and updates memory/relations as fixed-size internal fields. The stronger experimental path is OmegaStateReversibleCore, which makes the complete Omega state reversible:

import torch
from ctnet_omega import OmegaStateReversibleCore

core = OmegaStateReversibleCore(d=8, n_tokens=8, mem_slots=4, mem_dim=8, rel_edges=4, rel_dim=8)
state = core.init_state(batch=1, dtype=torch.float32, random_z=True)
next_state = core(state)
recovered = core.inverse(next_state)
print(core.reconstruction_errors(state, recovered))

The expanded coupling is triangular and additive:

Z' = Z + F(M, R)
M' = M + G(Z', R)
R' = R + H(Z', M')

and its inverse is explicit:

R = R' - H(Z', M')
M = M' - G(Z', R)
Z = Z' - F(M, R)

Architecture

The implemented first layer of CTNet Ω-R is:

input/lift
  -> CTNetFractalCore reversible transition
  -> CoherenceMetricField
  -> FixedTopologicalMemory update, shape invariant
  -> ReifiedRelationBank update, shape invariant
  -> ProjectionHead readout, outside inverse

The memory is internal and topological. In the standard CTNetOmega path, memory and relation updates remain fixed-size dissipative fields around an exact reversible cardinal core. In OmegaStateReversibleCore, (Z,M,R) are lifted into one explicitly invertible expanded-state coupling.

Development law

A change is accepted only if it fits one of these categories:

REVERSIBLE_CORE
FIXED_INTERNAL_MEMORY
OBSERVABLE
LOSS
READOUT
TRAINING_LOOP

Forbidden in the core:

append, cat-growing memory, KV-cache as memory, vector-store as memory, irreversible attention as state replacement, detach on state, dropout on state, destructive top-k/argmax, dimension-reducing projection inside inverse path

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages