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
- Cardinal state
Z=[u,p]withd % 4 == 0. - Explicit reversible core:
inverse_core(core(x)) ≈ x. - Internal memory
M: [B,F,dm]has fixed shape. No append, no growth. - Reified relations
R: [B,E,dr]have fixed shape. No relation list growth. - Coherence field derives atlas, fragility, saturation, incoherence debt and executive phase.
- Readout is separated from the reversible transition.
- Expanded-state reversible path:
OmegaStateReversibleCoreprovides(Z,M,R) <-> (Z',M',R')with fixed support.
python -m venv .venv
source .venv/bin/activate
pip install -e .[test]python -m ctnet_omega --batch 2 --N 128 --d 32 --fp64Expected regime:
fp32 MAE <= 1e-6
fp64 MAE <= 1e-14
memory_shape_ok == 1
relations_shape_ok == 1
pytest -qimport 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())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)
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.
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