Bind runtime array closure to exact frozen worker inputs

This commit is contained in:
Digital Drosophila Archive
2026-09-30 21:06:22 +08:00
parent 0d3eca1c33
commit 80aeb2093d
2 changed files with 27 additions and 4 deletions
@@ -30,6 +30,15 @@ H_ANCHORS = {
'manifests/manifest.json':'d1f187f164f7775a1a02fff259c8f5e31ae035929d808c3876cfc0013d19c73c',
}
# Exact arrays consumed by the pinned isolated worker, not every reference file
# colocated in its graph/APL directories. Tests compare these to that worker.
GRAPH_FILES = ('nodes.npy', 'edge_id.npy', 'src.npy', 'dst.npy', 'signed_raw.npy', 'ptr.npy', 'weights.npy')
APL_FILES = ('input_matrix.npy', 'output_matrix.npy', 'kc_globals.npy', 'apl_globals.npy')
def runtime_array_paths(template):
return {str(Path(template['graph_dir'])/name) for name in GRAPH_FILES} | {
str(Path(template['apl_bundle_dir'])/name) for name in APL_FILES} | {template['coefficients_path']}
def readout_populations(population_file):
import numpy as np
import pyarrow.parquet as pq
@@ -148,10 +157,8 @@ def prepare():
save_npz(EXP/'inputs/static/readout-populations.npz',populations)
save(EXP/'inputs/static/readout-population-binding.json',pop_audit)
# Actual consumed neural dependency closure, all inherited byte pins.
required=set()
for role in ('graph_dir','apl_bundle_dir'):
required.update(str(p) for p in Path(template[role]).iterdir() if p.suffix=='.npy')
required.add(template['coefficients_path'])
required=runtime_array_paths(template)
require(required <= pinned.keys(), 'Consumed runtime arrays missing inherited pins: '+str(sorted(required-pinned.keys())))
original_sources={p:s for p,s in epoch['frozen_inputs'].items() if p.startswith(str(ROOT/'models/male-cns-lif/') )
and ('author-' in p or 'apl-timing-lab-v1/' in p)}
runtime={p:pinned[p] for p in required}