@@ -51,7 +51,7 @@ class Nexus:
5151 def __init__ (self , run_dir : str , N :int = 1000 , k :int = 12 , hz :int = 10 ,
5252 domain :str = 'biology_consciousness' , use_time_dynamics :bool = True ,
5353 log_every :int = 1 , checkpoint_every :int = 0 , seed :int = 0 ,
54- sparse_mode : bool = False , threshold :float = 0.15 , lambda_omega :float = 0.1 ,
54+ threshold :float = 0.15 , lambda_omega :float = 0.1 ,
5555 candidates :int = 64 , walkers :int = 256 , hops :int = 3 , status_interval :int = 1 ,
5656 bundle_size :int = 3 , prune_factor :float = 0.10 ,
5757 speak_auto :bool = True , speak_z :float = 1.0 , speak_hysteresis :float = 1.0 ,
@@ -121,49 +121,14 @@ def __init__(self, run_dir: str, N:int=1000, k:int=12, hz:int=10,
121121 self ._ng2 = {} # bigram: w1 -> {w2: count}
122122 self ._ng3 = {} # trigram: (w1,w2) -> {w3: count}
123123
124- # Sparse-first backend policy (void-faithful, no scans):
125- # Runtime uses SparseConnectome by default. Dense is validation-only via FORCE_DENSE=1.
126- use_dense = str (os .getenv ("FORCE_DENSE" , "0" )).strip ().lower () in ("1" , "true" , "yes" , "on" , "y" , "t" )
124+ from vdm_rt .core .sparse_connectome import SparseConnectome
127125
128- # Keep 'sparse_mode' arg for compatibility but ignore it; log once.
129- if sparse_mode :
130- try :
131- self .logger .info ("deprecated_arg_sparse_mode_ignored" , extra = {"extra" : {"arg" : bool (sparse_mode )}})
132- except Exception :
133- pass
134-
135- # Select implementation with dynamic import to avoid accidental dense usage
136- try :
137- if use_dense : # TODO REMOVE DENSE SCANS
138- from vdm_rt .core .connectome import Connectome as _Conn # validation-only
139- else :
140- from vdm_rt .core .sparse_connectome import SparseConnectome as _Conn
141- except Exception :
142- # Fallback to sparse on any import failure
143- from vdm_rt .core .sparse_connectome import SparseConnectome as _Conn
144-
145- # Instantiate connectome (both backends accept the same constructor args here)
146- try : # TODO REMOVE DENSE SCANS
147- self .connectome = _Conn (
148- N = self .N , k = self .k , seed = self .seed ,
149- threshold = threshold , lambda_omega = lambda_omega ,
150- candidates = candidates , traversal_walkers = walkers , traversal_hops = hops ,
151- bundle_size = bundle_size , prune_factor = prune_factor
152- )
153- if use_dense :
154- try :
155- self .logger .info ("backend_dense_forced" , extra = {"extra" : {"reason" : "FORCE_DENSE" }})
156- except Exception :
157- pass
158- except Exception :
159- # Ensure we have a working sparse connectome if constructor failed
160- from vdm_rt .core .sparse_connectome import SparseConnectome as _SConn
161- self .connectome = _SConn (
162- N = self .N , k = self .k , seed = self .seed ,
163- threshold = threshold , lambda_omega = lambda_omega ,
164- candidates = candidates , traversal_walkers = walkers , traversal_hops = hops ,
165- bundle_size = bundle_size , prune_factor = prune_factor
166- )
126+ self .connectome = SparseConnectome (
127+ N = self .N , k = self .k , seed = self .seed ,
128+ threshold = threshold , lambda_omega = lambda_omega ,
129+ candidates = candidates , traversal_walkers = walkers , traversal_hops = hops ,
130+ bundle_size = bundle_size , prune_factor = prune_factor
131+ )
167132 # Load engram if provided (after backend selection)
168133 # Defer engram loading until after ADC is initialized to avoid spurious errors/logs.
169134 # The actual load (with logging) happens below after ADC is constructed.
@@ -179,7 +144,7 @@ def __init__(self, run_dir: str, N:int=1000, k:int=12, hz:int=10,
179144 self .stim_group_size = int (max (1 , stim_group_size ))
180145 self .stim_amp = float (stim_amp )
181146 self .stim_max_symbols = int (max (1 , stim_max_symbols ))
182- try : # TODO REMOVE DENSE SCANS
147+ try :
183148 if hasattr (self .connectome , "_stim_decay" ):
184149 self .connectome ._stim_decay = float (stim_decay )
185150 except Exception :
@@ -236,7 +201,7 @@ def __init__(self, run_dir: str, N:int=1000, k:int=12, hz:int=10,
236201 self .adc = ADC (r_attach = float (r_attach ), ttl_init = int (ttl_init ), split_patience = int (split_patience ))
237202 # Attach bus to connectome so walkers can publish Observation events
238203 try :
239- self .connectome .bus = self .bus # TODO REMOVE DENSE SCANS
204+ self .connectome .bus = self .bus
240205 except Exception :
241206 pass
242207
0 commit comments