| compute_all_logit_adjusted_loss |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
Liyht/def-fsm/training/loss.py code served (permissive licence) · get_code("44234c75f64635b8") 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 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 torch
import torch.nn as nn
torch.manual_seed(0)
# Define a minimal model output class that has a logits attribute
class ModelOutput:
def __init__(self, logits):
self.logits = logits
# Create tiny tensors for testing
batch_size = 2
seq_len = 5
vocab_size = 8
num_datasets = 3
# batch dict with required keys
batch = {
'input_ids': torch.randint(0, vocab_size, (batch_size, seq_len)),
'mask': torch.tensor([[1, 1, 2, 2, 0], [1, 2, 2, 0, 0]], dtype=torch.long),
'dataset_id': torch.tensor([0, 1], dtype=torch.long),
}
# model_outputs with logits of shape [batch_size, seq_len, vocab_size]
logits = torch.randn(batch_size, seq_len, vocab_size)
model_outputs = ModelOutput(logits)
# weight_lookup: [num_datasets, 2] where columns are [response_weight, transition_weight]
weight_lookup = torch.tensor([
[0.5, 1.5],
[0.8, 1.2],
[0.6, 1.4],
], dtype=torch.float32)
# logit_adjustments: [vocab_size] adjustment terms
logit_adjustments = torch.randn(vocab_size)
ARGS = {
'batch': batch,
'model_outputs': model_outputs,
'weight_lookup': weight_lookup,
'logit_adjustments': logit_adjustments,
}
- 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 tuple, ndim 1, 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
|
| compute_balanced_loss |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
Liyht/def-fsm/training/loss.py code served (permissive licence) · get_code("1955754de56f44ac") 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 torch.nn as nn
torch.manual_seed(0)
# Create a minimal model with logits output
class MinimalModel(nn.Module):
def __init__(self, vocab_size=10, hidden_dim=4):
super().__init__()
self.linear = nn.Linear(hidden_dim, vocab_size)
def forward(self, input_ids):
# Return object with logits attribute
batch_size, seq_len = input_ids.shape
logits = self.linear(torch.randn(batch_size, seq_len, 4))
class Output:
pass
output = Output()
output.logits = logits
return output
# Create batch data
batch = {
'input_ids': torch.randint(0, 10, (2, 5)), # batch_size=2, seq_len=5
'mask': torch.tensor([
[0, 1, 2, 2, 3],
[0, 1, 1, 2, 2]
], dtype=torch.long), # 0=padding, 1=response, 2+=transition
'dataset_id': torch.tensor([0, 1], dtype=torch.long) # 2 datasets
}
# Create model and get outputs
model = MinimalModel(vocab_size=10, hidden_dim=4)
model_outputs = model(batch['input_ids'])
# Create weight lookup: [Num_Datasets=2, 2] for response and transition weights
weight_lookup = torch.tensor([
[0.5, 0.5], # dataset 0 weights
[0.3, 0.7] # dataset 1 weights
], dtype=torch.float32)
ARGS = {
'batch': batch,
'model_outputs': model_outputs,
'weight_lookup': weight_lookup,
'normalize_by_count': True
}
- 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 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
|
| compute_logit_adjusted_loss |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
Liyht/def-fsm/training/loss.py code served (permissive licence) · get_code("f5950f968ee6250f") 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 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 torch
import torch.nn as nn
torch.manual_seed(0)
# Define a minimal model_outputs object that has a logits attribute
class ModelOutputs:
def __init__(self, logits):
self.logits = logits
# Set up dimensions
batch_size = 2
seq_len = 5
vocab_size = 8
num_datasets = 3
# Create batch dictionary
batch = {
'input_ids': torch.randint(0, vocab_size, (batch_size, seq_len)),
'mask': torch.tensor([[1, 1, 2, 2, 1], [1, 2, 1, 2, 2]], dtype=torch.long),
'dataset_id': torch.tensor([0, 1], dtype=torch.long)
}
# Create model outputs with logits
# Shape: (batch_size, seq_len, vocab_size)
logits = torch.randn(batch_size, seq_len, vocab_size)
model_outputs = ModelOutputs(logits)
# Create weight_lookup tensor
# Shape: (num_datasets, 2) where 2 = [response_weight, transition_weight]
weight_lookup = torch.tensor([
[1.0, 2.0],
[1.5, 1.5],
[2.0, 1.0]
], dtype=torch.float32)
# Create logit_adjustments tensor
# Shape: (vocab_size,) containing tau * log(prior) values
logit_adjustments = torch.randn(vocab_size)
ARGS = {
'batch': batch,
'model_outputs': model_outputs,
'weight_lookup': weight_lookup,
'logit_adjustments': logit_adjustments
}
- 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 tuple, ndim 1, 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
|
| get_completed_ids |
Ran ran; our contract draft was wrong, not the code |
Liyht/def-fsm/data_transformation/fsm_data_generation.py code served (permissive licence) · get_code("cc1587aac1e6e488") 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 set. 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 os
import json
import tempfile
# Create a temporary file with sample JSONL data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.jsonl', encoding='utf-8')
temp_file.write('{"task_id": "task_001", "data": "sample"}\n')
temp_file.write('{"task_id": "task_002", "data": "sample"}\n')
temp_file.write('{"other_field": "no_task_id"}\n')
temp_file.write('invalid json line\n')
temp_file.write('{"task_id": "task_003", "data": "sample"}\n')
temp_file.close()
ARGS = {
'filepath': temp_file.name
}
- 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 set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set 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
|
| is_meaningful_text |
Ran ran, violated the contract we drafted |
Liyht/def-fsm/def_fsm/utils.py code served (permissive licence) · get_code("8a8a67a6dc12c6a9") 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 bool, 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 string
def is_meaningful_text(text):
"""Whether any real content remains once punctuation and whitespace are stripped."""
translator = str.maketrans('', '', string.punctuation)
if text.translate(translator).strip():
return True
return False
ARGS = {
"text": "Hello, world! This is a test."
}
- 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 bool, 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
|
| is_punctuation |
Ran ran, violated the contract we drafted |
Liyht/def-fsm/def_fsm/utils.py code served (permissive licence) · get_code("5fb0be001574d39f") 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 bool, 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 string
def is_punctuation(text):
"""Whether the text is nothing but punctuation once whitespace is stripped."""
text = text.strip().replace(' ', '')
if all((char in string.punctuation for char in text)):
return True
return False
# Setup code
ARGS = {
"text": "!!!"
}
- 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 bool, 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
|
| load_paths |
Ran ran; our contract draft was wrong, not the code |
Liyht/def-fsm/def_fsm/paths.py code served (permissive licence) · get_code("c552b2f96be5c4f0") 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 os
import tempfile
from pathlib import Path
import yaml
# Create a minimal temporary project structure
temp_dir = tempfile.mkdtemp()
project_root = Path(temp_dir)
configs_dir = project_root / 'configs'
configs_dir.mkdir(exist_ok=True)
# Create paths.example.yaml with some documented keys
example_paths = {
'DATA_DIR': '/data',
'MODEL_DIR': '/models',
'OUTPUT_DIR': '/output'
}
example_paths_file = configs_dir / 'paths.example.yaml'
with open(example_paths_file, 'w') as f:
yaml.dump(example_paths, f)
# Create paths.yaml with some values
paths_values = {
'DATA_DIR': '/tmp/data',
'MODEL_DIR': '/tmp/models'
}
paths_file = configs_dir / 'paths.yaml'
with open(paths_file, 'w') as f:
yaml.dump(paths_values, f)
# Create .env file with environment variables
env_file = project_root / '.env'
with open(env_file, 'w') as f:
f.write('OUTPUT_DIR=/tmp/output\n')
f.write('CUSTOM_VAR=custom_value\n')
# Patch the module-level variables to use our temp structure
import sys
from types import ModuleType
# Create a mock module with the patched paths
mock_module = ModuleType('test_module')
mock_module.PROJECT_ROOT = project_root
mock_module.PATHS_FILE = paths_file
mock_module.EXAMPLE_PATHS_FILE = example_paths_file
mock_module.ENV_FILE = env_file
mock_module._cache = None
# Import the function and patch its globals
from pathlib import Path as PathedPath
import yaml as yaml_lib
from dotenv import load_dotenv as dotenv_load
def load_paths(refresh=False):
"""Return the mapping used to expand ``${NAME}`` placeholders."""
global _cache
PROJECT_ROOT = mock_module.PROJECT_ROOT
PATHS_FILE = mock_module.PATHS_FILE
EXAMPLE_PATHS_FILE = mock_module.EXAMPLE_PATHS_FILE
ENV_FILE = mock_module.ENV_FILE
def _known_names():
"""Names documented in paths.example.yaml, so the environment alone suffices."""
if not EXAMPLE_PATHS_FILE.exists():
return []
with open(EXAMPLE_PATHS_FILE, 'r') as f:
return list((yaml_lib.safe_load(f) or {}).keys())
if mock_module._cache is not None and (not refresh):
return mock_module._cache
if ENV_FILE.exists():
dotenv_load(ENV_FILE)
values = {}
if PATHS_FILE.exists():
with open(PATHS_FILE, 'r') as f:
values.update({k: str(v) for k, v in (yaml_lib.safe_load(f) or {}).items()})
for key in list(values) + _known_names():
if os.environ.get(key):
values[key] = os.environ[key]
values['PROJECT_ROOT'] = str(PROJECT_ROOT)
mock_module._cache = values
return mock_module._cache
ARGS = {
'refresh': False
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- dotenv, yaml — 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_tape_data |
Ran ran; our contract draft was wrong, not the code |
Liyht/def-fsm/evaluation/fsm_bench/fsm_bench.py code served (permissive licence) · get_code("ad89c9c7c45ef22d") 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 json
import os
import tempfile
# Create temporary JSON files with test data
temp_dir = tempfile.mkdtemp()
# Create first test file
file_path_1 = os.path.join(temp_dir, "tape_test_1.json")
data_1 = [
{"id": 1, "text": "sample text 1", "label": "A"},
{"id": 2, "text": "sample text 2", "label": "B"},
]
with open(file_path_1, 'w', encoding='utf-8') as f:
json.dump(data_1, f)
# Create second test file
file_path_2 = os.path.join(temp_dir, "tape_test_2.json")
data_2 = [
{"id": 3, "text": "sample text 3", "label": "C"},
]
with open(file_path_2, 'w', encoding='utf-8') as f:
json.dump(data_2, f)
ARGS = {
"file_paths": [file_path_1, file_path_2]
}
- 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
|
| system_prompt_fillin |
Ran ran; our contract draft was wrong, not the code |
Liyht/def-fsm/def_fsm/utils.py code served (permissive licence) · get_code("6bc11bb73cfc2665") 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.
import tempfile
import os
# Create a temporary system prompt template file
temp_dir = tempfile.mkdtemp()
system_prompt_path = os.path.join(temp_dir, "system_prompt.txt")
# Write a template with placeholders
template_content = """You are an AI assistant.
Interlocutor: {{INTERLOCUTOR_PREFIX}}
Use this silence token: {{SILENCE_TOKEN}}
Silence duration: {{SILENCE_TOKEN_DUR}} seconds
End of prompt."""
with open(system_prompt_path, 'w') as f:
f.write(template_content)
# Define arguments
ARGS = {
'system_prompt_path': system_prompt_path,
'interlocutor_prefix': 'USER'
}
- 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
|
| expand |
Not yet run unverified (harvested, no recorded run) |
Liyht/def-fsm/def_fsm/paths.py code served (permissive licence) · get_code("2c1d9a607d1536e2") How it ran |
| expand_config |
Not yet run unverified (harvested, no recorded run) |
Liyht/def-fsm/def_fsm/paths.py code served (permissive licence) · get_code("112090c3efa02c66") How it ran |