| build_cells |
Ran ran; our contract draft was wrong, not the code |
Biodyn-AI/sae-biological-map/src/revision/p2_steering.py code served (permissive licence) · get_code("b406eab057b704b0") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
import os
import tempfile
import h5py
import pickle
class MockOrigObject:
def __init__(self):
self.TOKEN_DICTS_DIR = tempfile.gettempdir()
self.IMMUNE_H5AD = os.path.join(tempfile.gettempdir(), "immune.h5ad")
self.HEMATOPOIETIC_TISSUES = ["blood", "bone marrow"]
self.MYELOID_TYPES = ["monocyte", "macrophage", "neutrophil"]
self.LYMPHOID_TYPES = ["t cell", "b cell", "nk cell"]
self.MAX_SEQ_LEN = 256
self._setup_files()
def _setup_files(self):
# Create token dictionary
token_dict = {"ENSG001": 1, "ENSG002": 2, "ENSG003": 3}
with open(os.path.join(self.TOKEN_DICTS_DIR, 'token_dictionary_gc104M.pkl'), 'wb') as f:
pickle.dump(token_dict, f)
# Create median dictionary
median_dict = {"ENSG001": 1.5, "ENSG002": 2.0}
with open(os.path.join(self.TOKEN_DICTS_DIR, 'gene_median_dictionary_gc104M.pkl'), 'wb') as f:
pickle.dump(median_dict, f)
# Create gene name id dictionary
name_id = {"GENE1": "ENSG001", "GENE2": "ENSG002", "GENE3": "ENSG003"}
with open(os.path.join(self.TOKEN_DICTS_DIR, 'gene_name_id_dict_gc104M.pkl'), 'wb') as f:
pickle.dump(name_id, f)
# Create mock h5ad file
with h5py.File(self.IMMUNE_H5AD, 'w') as f:
# Create X (sparse matrix) - using CSR format
n_cells = 10
n_genes = 3
nnz = 15
data = f.create_dataset('X/data', data=np.random.randn(nnz).astype(np.float32))
indices = f.create_dataset('X/indices', data=np.array([0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2], dtype=np.int32))
indptr = f.create_dataset('X/indptr', data=np.array([0, 2, 4, 6, 8, 10, 12, 14, 15, 15, 15], dtype=np.int32))
# Create var (genes)
var_group = f.create_group('var')
var_group.create_dataset('_index', data=np.array(['GENE1', 'GENE2', 'GENE3'], dtype='S10'))
# Create obs (cells)
obs_group = f.create_group('obs')
cell_types_data = np.array(['Monocyte', 'T Cell', 'B Cell', 'Macrophage', 'NK Cell', 'Neutrophil', 'Monocyte', 'T Cell', 'B Cell', 'Monocyte'], dtype='S20')
obs_group.create_dataset('cell_type', data=cell_types_data)
tissues_data = np.array(['blood', 'blood', 'bone marrow', 'bone marrow', 'blood', 'blood', 'bone marrow', 'blood', 'blood', 'bone marrow'], dtype='S20')
obs_group.create_dataset('tissue_in_publication', data=tissues_data)
def load_categorical_column(self, group, col_name):
"""Mock implementation to load categorical column from h5 group."""
data = group[col_name][:]
if isinstance(data[0], bytes):
return np.array([d.decode('utf-8') for d in data])
return data
def load_sparse_row(self, X_group, idx, n_genes):
"""Mock implementation to load a sparse row."""
indptr = X_group['indptr'][:]
indices = X_group['indices'][:]
data = X_group['data'][:]
row_start = indptr[idx]
row_end = indptr[idx + 1]
row = np.zeros(n_genes, dtype=np.float32)
row[indices[row_start:row_end]] = data[row_start:row_end]
return row
def tokenize_cell(self, row, mvi, mti, mmd, max_seq_len):
"""Mock implementation of tokenization."""
# Simple tokenization: return non-zero indices as tokens
nonzero = np.where(row[mvi] > 0)[0]
if len(nonzero) == 0:
return None
tokens = mti[nonzero[:max_seq_len]]
return tokens.tolist()
orig = MockOrigObject()
ARGS = {
"orig": orig,
"n_total": 500
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- h5py, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple — a tuple output has no array shape of its own; none is stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| feature_pool |
Ran ran; our contract draft was wrong, not the code |
Biodyn-AI/sae-biological-map/src/revision/p3_triplets_extended.py code served (permissive licence) · get_code("01b61380fdf5912e") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
class MockFeatureCatalog:
def __init__(self):
self.features = {
0: {
0: {'activation_freq': 0.05},
1: {'activation_freq': 0.01},
2: {'activation_freq': 0.03},
},
5: {
10: {'activation_freq': 0.04},
11: {'activation_freq': 0.015},
12: {'activation_freq': 0.06},
13: {'activation_freq': 0.02},
},
11: {
20: {'activation_freq': 0.025},
21: {'activation_freq': 0.008},
22: {'activation_freq': 0.035},
}
}
self.labels = {
0: {
0: 'DNA Damage Response',
1: 'Mitotic Spindle',
2: 'Chromatin Remodeling',
},
5: {
10: 'Translation Initiation',
11: 'Ribosomal Assembly',
12: 'mRNA Splicing',
13: 'Vesicle Transport',
},
11: {
20: 'Oxidative Phosphorylation',
21: 'Histone Modification',
22: 'Double-strand Break Repair',
}
}
def load_feature_catalog(self, layer):
active = list(self.features[layer].keys())
info = self.features[layer]
return active, info
def load_feature_labels(self, layer):
return self.labels[layer]
torch.manual_seed(0)
orig = MockFeatureCatalog()
ARGS = {
'orig': orig
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| hedges_g |
Ran ran, honoured the contract we drafted |
Biodyn-AI/sae-biological-map/src/revision/p1b_null_fdr_thresholds.py code served (permissive licence) · get_code("673181d7723a0f76") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
torch.manual_seed(0)
# hedges_g takes two parameters: d and n
# d appears to be a numeric effect size value
# n appears to be a sample size (used in comparison and arithmetic)
d_value = 0.75
n_value = 10
ARGS = {
"d": d_value,
"n": n_value,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| jload |
Ran ran; our contract draft was wrong, not the code |
Biodyn-AI/sae-biological-map/src/revision/make_figures.py code served (permissive licence) · get_code("8c0c8031ac6f0fc4") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import json
import tempfile
import os
# Create a temporary JSON file with test data
temp_dir = tempfile.mkdtemp()
test_file = os.path.join(temp_dir, "test.json")
test_data = {
"key1": "value1",
"key2": [1, 2, 3],
"key3": {"nested": "object"}
}
with open(test_file, "w") as f:
json.dump(test_data, f)
ARGS = {
"p": test_file
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| load_categorical_column |
Ran ran; our contract draft was wrong, not the code |
Biodyn-AI/sae-biological-map/src/exhaustive_feature_tracing.py code served (permissive licence) · get_code("2f11e78bedd3d2ac") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (5,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import h5py
import numpy as np
import tempfile
import os
# Create a temporary HDF5 file with test data
temp_dir = tempfile.mkdtemp()
h5_path = os.path.join(temp_dir, "test.h5")
with h5py.File(h5_path, "w") as f:
# Create a group with categorical data (categories + codes structure)
cat_group = f.create_group("categorical_col")
categories = np.array([b"cat", b"dog", b"bird"], dtype='S10')
codes = np.array([0, 1, 2, 0, 1], dtype=np.int32)
cat_group.create_dataset("categories", data=categories)
cat_group.create_dataset("codes", data=codes)
# Create a simple dataset column
f.create_dataset("simple_col", data=np.array([1.0, 2.0, 3.0, 4.0, 5.0]))
# Open the HDF5 file and prepare arguments
h5file = h5py.File(h5_path, "r")
h5group = h5file
ARGS = {
"h5group": h5group,
"col_name": "categorical_col"
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- h5py, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 1, dtype family float, shape (5,) — shape (5,) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| load_features |
Ran ran, honoured the contract we drafted |
Biodyn-AI/sae-biological-map/src/revision/make_figures.py code served (permissive licence) · get_code("4d8ed6301a3c8094") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import os
import json
import tempfile
import shutil
# Create a temporary directory structure to mimic the expected project layout
temp_dir = tempfile.mkdtemp()
proj_root = temp_dir
eXH_dir = os.path.join(proj_root, 'experiments', 'phase8_exhaustive_tracing')
os.makedirs(eXH_dir, exist_ok=True)
# Set the environment variable
os.environ['SAE_PROJ_ROOT'] = proj_root
# Create sample feature JSON files
feature_data_1 = {
'feature_idx': 0,
'total_significant_edges': 5,
'label': 'test_label_1',
'activation_freq': 0.75,
'downstream_edges': {
'layer_1': {'n_significant': 3},
'layer_2': {'n_significant': 2}
}
}
feature_data_2 = {
'feature_idx': 1,
'total_significant_edges': 8,
'label': 'unannotated',
'activation_freq': 0.45,
'downstream_edges': {
'layer_1': {'n_significant': 4},
'layer_2': {'n_significant': 4}
}
}
feature_data_3 = {
'feature_idx': 2,
'total_significant_edges': 3,
'label': 'test_label_2',
'activation_freq': 0.92,
'downstream_edges': {
'layer_1': {'n_significant': 1},
'layer_2': {'n_significant': 2}
}
}
# Write feature files
with open(os.path.join(eXH_dir, 'feature_0.json'), 'w') as f:
json.dump(feature_data_1, f)
with open(os.path.join(eXH_dir, 'feature_1.json'), 'w') as f:
json.dump(feature_data_2, f)
with open(os.path.join(eXH_dir, 'feature_2.json'), 'w') as f:
json.dump(feature_data_3, f)
# Define arguments for the load_features function
ARGS = {
'edge_override': None
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| load_sparse_row |
Ran ran, honoured the contract we drafted |
Biodyn-AI/sae-biological-map/src/trajectory_steering.py code served (permissive licence) · get_code("559b022277f2b71e") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (5,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
from unittest.mock import MagicMock
# Create a mock f_group object that behaves like an HDF5 group
f_group = MagicMock()
# Set up sparse matrix data in CSR (Compressed Sparse Row) format
# For a sparse matrix with 3 rows and 5 columns
n_rows = 3
n_cols = 5
# indptr: row pointers (4 elements for 3 rows)
indptr = np.array([0, 2, 3, 5], dtype=np.int32)
# indices: column indices for non-zero elements
indices = np.array([0, 3, 1, 2, 4], dtype=np.int32)
# data: non-zero values
data = np.array([1.5, 2.3, 4.1, 3.2, 5.0], dtype=np.float32)
# Configure the mock to return these arrays when indexed
f_group.__getitem__ = MagicMock(side_effect=lambda key: {
'indptr': indptr,
'indices': indices,
'data': data
}[key])
# Also support direct attribute access
f_group.indptr = indptr
f_group.indices = indices
f_group.data = data
row_idx = 1
n_cols = 5
ARGS = {
'f_group': f_group,
'row_idx': row_idx,
'n_cols': n_cols
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 1, dtype family float, shape (5,) — shape (5,) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| maybe |
Ran ran; our contract draft was wrong, not the code |
Biodyn-AI/sae-biological-map/src/revision/make_figures.py code served (permissive licence) · get_code("351f56a11eaf34fa") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import json
import os
import tempfile
# Create a temporary directory and a test JSON file
temp_dir = tempfile.mkdtemp()
test_json_path = os.path.join(temp_dir, "test.json")
# Write a valid JSON file
test_data = {"key": "value", "number": 42, "list": [1, 2, 3]}
with open(test_json_path, "w") as f:
json.dump(test_data, f)
# Define ARGS with the path parameter
ARGS = {
"p": test_json_path
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| mean_pool |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
Biodyn-AI/sae-biological-map/src/revision/p2_steering.py code served (permissive licence) · get_code("e39b2842a3fb120c") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (4,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
torch.manual_seed(0)
# hidden: tensor that will be indexed by gene_positions
# The function does hidden[gene_positions].mean(dim=0)
# So hidden needs to be indexable and support mean(dim=0)
# gene_positions will be used as an index into hidden
hidden = torch.randn(5, 4) # 5 genes, 4 dimensions
# gene_positions: indices to select from hidden
# Should be a tensor or list of indices
gene_positions = torch.tensor([0, 2, 4]) # Select 3 genes out of 5
ARGS = {
"hidden": hidden,
"gene_positions": gene_positions,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 1, dtype family float, shape (4,) — shape (4,) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| pathway_of |
Ran ran; our contract draft was wrong, not the code |
Biodyn-AI/sae-biological-map/src/revision/p3_triplets_extended.py code served (permissive licence) · get_code("07fd78908105f548") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
ARGS = {
'label': 'DNA damage and repair mechanisms in double-strand breaks'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| perm_stats |
Ran ran, honoured the contract we drafted |
Biodyn-AI/sae-biological-map/src/revision/p1b_null_fdr_thresholds.py code served (permissive licence) · get_code("2b8bf9b0966d7a1e") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 3, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
# Construct valid arguments for perm_stats function
# mat: (n, T) array of values
# signs: (B, n) array in {-1, +1}
np.random.seed(0)
n = 4 # number of samples
T = 3 # number of features/tasks
B = 2 # batch size
# Create mat as (n, T) numpy array with random values
mat = np.random.randn(n, T)
# Create signs as (B, n) array with values in {-1, +1}
signs = np.random.choice([-1, 1], size=(B, n)).astype(np.float64)
ARGS = {
"mat": mat,
"signs": signs,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple, ndim 3, dtype family float — a tuple output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| pl_cdf |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
Biodyn-AI/sae-biological-map/src/revision/p4_tail_fitting.py code served (permissive licence) · get_code("5f6c3504b3a44c1b") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (5,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
# Analyze the function:
# - vals: array-like, used with .max() and passed to np.searchsorted
# - alpha: numeric scalar, used in exponentiation
# - xmin: numeric scalar, used as start of arange
# Create valid test arguments
vals = np.array([1, 2, 3, 5, 8], dtype=float)
alpha = 2.5
xmin = 1
ARGS = {
"vals": vals,
"alpha": alpha,
"xmin": xmin,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 1, dtype family float, shape (5,) — shape (5,) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| pl_logpmf |
Ran ran, honoured the contract we drafted |
Biodyn-AI/sae-biological-map/src/revision/p4_tail_fitting.py code served (permissive licence) · get_code("76e4898286b59af6") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
# Analyzing the function:
# - pl_logpmf takes parameters: x, alpha, xmin
# - x: used with np.log(), so should be a numeric value or array
# - alpha: used with multiplication and passed to _zeta_tail
# - xmin: passed to _zeta_tail as starting point for np.arange
# All parameters are numeric (int or float)
ARGS = {
"x": 5,
"alpha": 1.5,
"xmin": 1
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py could not observe it (no_result)
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| precompute_clean |
Ran ran; our contract draft was wrong, not the code |
Biodyn-AI/sae-biological-map/src/revision/p1a_retrace_with_deltas.py code served (permissive licence) · get_code("af97fac5a8f58bde") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
from torch import nn
torch.manual_seed(0)
# Mock SAE (Sparse Autoencoder) class
class MockSAE(nn.Module):
def __init__(self, input_dim, latent_dim):
super().__init__()
self.input_dim = input_dim
self.latent_dim = latent_dim
self.encoder = nn.Linear(input_dim, latent_dim)
def encode(self, x):
# Returns sparse encoding and topk indices
encoded = self.encoder(x)
# Simulate topk selection
topk_vals, topk_indices = torch.topk(torch.abs(encoded), k=min(2, encoded.shape[-1]), dim=-1)
return encoded, topk_indices
def to(self, device):
return super().to(device)
# Mock Model with hidden_states output
class MockModel(nn.Module):
def __init__(self):
super().__init__()
self.hidden_dim = 4
self.num_layers = 18
# Create embeddings and layers
self.embedding = nn.Embedding(1024, self.hidden_dim)
self.layers = nn.ModuleList([nn.Linear(self.hidden_dim, self.hidden_dim) for _ in range(self.num_layers)])
def forward(self, input_ids, attention_mask):
# input_ids: (batch, seq_len)
x = self.embedding(input_ids) # (batch, seq_len, hidden_dim)
hidden_states = [x]
for layer in self.layers:
x = layer(x)
hidden_states.append(x)
# Create a mock output object
class Output:
pass
output = Output()
output.hidden_states = hidden_states
return output
# Mock SAE cache
class MockSAECache:
def __init__(self):
self.hidden_dim = 4
self.latent_dim = 8
self.saes = {}
self.means = {}
# Create SAEs and means for all needed layers
for layer_idx in [5, 6, 11, 17]:
self.saes[layer_idx] = MockSAE(self.hidden_dim, self.latent_dim)
self.means[layer_idx] = np.zeros(self.hidden_dim, dtype=np.float32)
def get(self, layer_idx):
return self.saes[layer_idx], self.means[layer_idx]
# Create test data
model = MockModel()
device = torch.device('cpu')
sae_cache = MockSAECache()
# Create token sequences with some valid tokens (not 2 or 3)
all_tokens = [
np.array([0, 1, 4, 5, 6], dtype=np.int64), # sequence 1 with valid tokens
np.array([2, 3, 2, 3], dtype=np.int64), # sequence 2 with all masked tokens
np.array([1, 4, 5], dtype=np.int64), # sequence 3 with valid tokens
]
ARGS = {
'all_tokens': all_tokens,
'model': model,
'device': device,
'sae_cache': sae_cache,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple — a tuple output has no array shape of its own; none is stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| select_triplets |
Ran ran; our contract draft was wrong, not the code |
Biodyn-AI/sae-biological-map/src/revision/p3_triplets_extended.py code served (permissive licence) · get_code("66af41ef506b2dcc") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
# Build the pool structure that the function expects
# pool[L] is a dict where keys are feature IDs and values are dicts with 'pathway' and 'freq'
pool = {}
# Define feature data for each layer
feature_data = {
0: {
'f0': {'pathway': 'mitosis', 'freq': 100, 'label': 'mitosis_feature_0'},
'f1': {'pathway': 'vesicle', 'freq': 90, 'label': 'vesicle_feature_1'},
'f2': {'pathway': 'translation', 'freq': 80, 'label': 'translation_feature_2'},
'f3': {'pathway': 'chromatin', 'freq': 70, 'label': 'chromatin_feature_3'},
'f4': {'pathway': 'rna', 'freq': 60, 'label': 'rna_feature_4'},
'f5': {'pathway': 'metabolism', 'freq': 50, 'label': 'metabolism_feature_5'},
'f6': {'pathway': 'ddr', 'freq': 40, 'label': 'ddr_feature_6'},
},
5: {
'f10': {'pathway': 'mitosis', 'freq': 95, 'label': 'mitosis_feature_10'},
'f11': {'pathway': 'vesicle', 'freq': 85, 'label': 'vesicle_feature_11'},
'f12': {'pathway': 'translation', 'freq': 75, 'label': 'translation_feature_12'},
'f13': {'pathway': 'chromatin', 'freq': 65, 'label': 'chromatin_feature_13'},
'f14': {'pathway': 'rna', 'freq': 55, 'label': 'rna_feature_14'},
'f15': {'pathway': 'metabolism', 'freq': 45, 'label': 'metabolism_feature_15'},
'f16': {'pathway': 'ddr', 'freq': 35, 'label': 'ddr_feature_16'},
},
11: {
'f20': {'pathway': 'mitosis', 'freq': 98, 'label': 'mitosis_feature_20'},
'f21': {'pathway': 'vesicle', 'freq': 88, 'label': 'vesicle_feature_21'},
'f22': {'pathway': 'translation', 'freq': 78, 'label': 'translation_feature_22'},
'f23': {'pathway': 'chromatin', 'freq': 68, 'label': 'chromatin_feature_23'},
'f24': {'pathway': 'rna', 'freq': 58, 'label': 'rna_feature_24'},
'f25': {'pathway': 'metabolism', 'freq': 48, 'label': 'metabolism_feature_25'},
'f26': {'pathway': 'ddr', 'freq': 38, 'label': 'ddr_feature_26'},
},
}
for layer_id, features in feature_data.items():
pool[layer_id] = features
ARGS = {
'pool': pool,
'n_same': 4,
'n_cross': 6,
'n_random': 4,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| stats_from |
Ran ran, honoured the contract we drafted |
Biodyn-AI/sae-biological-map/src/revision/p1b_null_fdr_thresholds.py code served (permissive licence) · get_code("664f812244c7bac5") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
# Create a small numpy matrix with shape (n_samples, n_features)
# Using distinct sizes: 5 samples, 3 features
mat = np.array([
[1.0, 2.0, 3.0],
[2.0, 4.0, 6.0],
[3.0, 6.0, 9.0],
[-1.0, 0.0, 2.0],
[0.0, 1.0, -1.0]
], dtype=np.float32)
ARGS = {
"mat": mat
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| stats_from |
Ran ran, honoured the contract we drafted |
Biodyn-AI/sae-biological-map/src/revision/p1c_normmatched_control.py code served (permissive licence) · get_code("d4f1a29c33f25447") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
# The function stats_from takes a single parameter 'mat' which should be a numpy array
# Looking at the function body:
# - mat.shape[0] is accessed (number of rows)
# - mat.mean(0) is called (mean along axis 0)
# - mat.std(0, ddof=1) is called (standard deviation along axis 0)
# - mat > 0 is used (element-wise comparison)
# - (mat > 0).sum(0) is called (sum along axis 0)
# - N_FEATURES = 4608, so the second dimension should be 4608
# Create a small test matrix with shape (n_samples, N_FEATURES)
# We'll use a batch of 5 samples with 4608 features
N_FEATURES = 4608
np.random.seed(0)
# Create a matrix with some variation to test the statistics calculation
mat = np.random.randn(5, N_FEATURES) * 10 + np.random.randn(1, N_FEATURES)
ARGS = {
"mat": mat
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| build_model |
Not yet run unverified (harvested, no recorded run) |
Biodyn-AI/sae-biological-map/src/revision/p1a_retrace_with_deltas.py code served (permissive licence) · get_code("9242b130d7b1594b") How it ran |
| fit_powerlaw_discrete |
Not yet run unverified (harvested, no recorded run) |
Biodyn-AI/sae-biological-map/src/revision/p4_tail_fitting.py code served (permissive licence) · get_code("fc105b6a966ef35a") How it ran |
| load_and_tokenize_cells |
Not yet run unverified (harvested, no recorded run) |
Biodyn-AI/sae-biological-map/src/exhaustive_feature_tracing.py code served (permissive licence) · get_code("03d7d79f35178aba") How it ran |
| n_edges |
Not yet run unverified (harvested, no recorded run) |
Biodyn-AI/sae-biological-map/src/revision/p1c_normmatched_control.py code served (permissive licence) · get_code("b76ae80605127006") How it ran |
| run_tail |
Not yet run unverified (harvested, no recorded run) |
Biodyn-AI/sae-biological-map/src/revision/p1a_retrace_with_deltas.py code served (permissive licence) · get_code("695d0d66410f71ee") How it ran |
| tokenize_cell |
Not yet run unverified (harvested, no recorded run) |
Biodyn-AI/sae-biological-map/src/exhaustive_feature_tracing.py code served (permissive licence) · get_code("5e5d73ae58cd79fd") How it ran |