| copy_if_exists |
Ran ran; our contract draft was wrong, not the code |
snuhcs/snn_signgd/src/packages/snn_signgd/core/layer.py code served (permissive licence) · get_code("b9c21ece96a51e25") 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 Parameter, 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 torch
from torch.nn.parameter import Parameter
torch.manual_seed(0)
# The function copy_if_exists takes a param argument.
# It checks if param is not None, and if so:
# - calls param.clone() to clone the parameter
# - wraps it in Parameter()
# Otherwise returns None
# We need to test both cases: with a Parameter and with None
# Case 1: Create a valid Parameter with a small tensor
param_tensor = torch.randn(2, 4)
param_with_value = Parameter(param_tensor)
# Case 2: None case
param_none = None
# Build ARGS dict with the parameter argument
ARGS = {
"param": param_with_value
}
- 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 Parameter, ndim 2, dtype family float — no output shape is stated: observe_signature.py recorded Tensor ndim 2, which disagrees with the fixture run
- 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_inputs_and_outputs |
Ran ran; our contract draft was wrong, not the code |
snuhcs/snn_signgd/src/packages/snn_signgd/graph_functional/utils.py code served (permissive licence) · get_code("84111747a4743f85") 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 torch
import torch.nn as nn
from torch import fx
torch.manual_seed(0)
# Create a simple model to trace
class SimpleModel(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(4, 3)
def forward(self, x):
return self.linear(x)
# Create a model instance and trace it
model = SimpleModel()
example_input = torch.randn(2, 4)
traced = fx.symbolic_trace(model)
# Get the graph from the traced module
graph = traced.graph
ARGS = {
"graph": graph
}
- 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 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
|
| get_parent_name |
Ran ran; our contract draft was wrong, not the code |
snuhcs/snn_signgd/src/packages/snn_signgd/graph_functional/utils.py code served (permissive licence) · get_code("28353e985d866fe1") 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
# Analyze the function:
# - get_parent_name takes a single parameter `target` which is a string
# - It splits the string using rsplit('.', 1) to separate parent path from last atom
# - Returns a tuple of (parent_path, name)
# - Examples: "foo.bar.baz" -> ("foo.bar", "baz")
ARGS = {
"target": "foo.bar.baz"
}
- 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
|
| import_module_from_path |
Ran ran; our contract draft was wrong, not the code |
snuhcs/snn_signgd/src/packages/snn_signgd/utils.py code served (permissive licence) · get_code("f5954937d705ef0a") 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 type. 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 sys
import tempfile
from pathlib import Path
# Create a temporary directory structure for testing
temp_dir = tempfile.mkdtemp()
module_dir = os.path.join(temp_dir, "test_module")
os.makedirs(module_dir, exist_ok=True)
# Create a minimal __init__.py file with a class/object named "test_module"
init_content = """
class test_module:
def __init__(self):
self.value = "test"
def method(self):
return "executed"
"""
with open(os.path.join(module_dir, "__init__.py"), "w") as f:
f.write(init_content)
# Define ARGS dictionary with valid arguments for the function
ARGS = {
"path": module_dir,
"module_name": "test_module"
}
- 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 type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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
|
| multiply_inverse_of_square_root |
Ran ran; our contract draft was wrong, not the code |
snuhcs/snn_signgd/src/packages/snn_signgd/core/layer.py code served (permissive licence) · get_code("a2295cefbeb3475a") 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 2, dtype family float, shape (2, 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)
x = torch.randn(2, 4)
y = torch.randn(2, 4) + 1.0 # Add 1.0 to ensure positive values for sqrt
ARGS = {
"x": x,
"y": y,
}
- 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 2, dtype family float, shape (2, 4) — shape (2, 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
|
| reduce_duplicates |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
snuhcs/snn_signgd/src/packages/snn_signgd/system_optimizations.py code served (permissive licence) · get_code("a4ea239e37558106") 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)
class TensorPair:
def __init__(self, x, y):
self.x = x
self.y = y
# Create a small tensor with duplicates along dimension 0
tensor_with_dupes = torch.tensor([[1.0, 2.0, 3.0, 4.0],
[1.0, 2.0, 3.0, 4.0]], dtype=torch.float32)
ARGS = {
"tensor": tensor_with_dupes
}
- 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
|
| repeat_shape_base |
Ran ran, honoured the contract we drafted |
snuhcs/snn_signgd/src/packages/snn_signgd/utils.py code served (permissive licence) · get_code("3bf7592ec2efc27c") 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 int; 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
torch.manual_seed(0)
# Create a small tensor with distinct dimensions for shape testing
x = torch.randn(2, 4, 3, 5)
ARGS = {
"x": x
}
- 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 list, ndim 1, dtype family int — 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
|
| replace_node_module |
Ran ran; our contract draft was wrong, not the code |
snuhcs/snn_signgd/src/packages/snn_signgd/graph_functional/utils.py code served (permissive licence) · get_code("728ef6b02e252dd8") 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 torch
import torch.nn as nn
from torch import fx
from typing import Dict, Any
torch.manual_seed(0)
# Create a simple module hierarchy to work with
class SimpleModule(nn.Module):
def __init__(self):
super().__init__()
self.child = nn.Linear(4, 3)
def forward(self, x):
return self.child(x)
class ParentModule(nn.Module):
def __init__(self):
super().__init__()
self.foo = nn.Module()
self.foo.bar = nn.Linear(4, 3)
def forward(self, x):
return self.foo.bar(x)
# Create the parent module instance
parent_module = ParentModule()
# Create a traced FX graph to get a valid Node
def dummy_forward(x):
return parent_module.foo.bar(x)
try:
traced = fx.symbolic_trace(parent_module)
# Get a node from the traced graph
nodes = list(traced.graph.nodes)
# Find a call_module node
node = None
for n in nodes:
if n.op == 'call_module':
node = n
break
if node is None:
# Create a mock node if symbolic trace doesn't work as expected
node = fx.Node(traced.graph, 'call_module', 'call_module', 'foo.bar', (), {})
node.name = 'foo_bar'
node.target = 'foo.bar'
except:
# Fallback: create a minimal mock node
class MockNode:
def __init__(self):
self.target = 'foo.bar'
self.name = 'foo_bar'
node = MockNode()
# Create modules dict that mirrors the structure
modules = {
'': parent_module,
'foo': parent_module.foo,
'foo_bar': nn.Identity() # placeholder
}
# Create a new module to replace with
new_module = nn.Linear(4, 2)
ARGS = {
'node': node,
'modules': modules,
'new_module': new_module
}
- 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 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
|
| running_average |
Ran ran, honoured the contract we drafted |
snuhcs/snn_signgd/src/packages/snn_signgd/core/hook.py code served (permissive licence) · get_code("62209dabe65cb4da") 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 2, dtype family float, shape (2, 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
import numpy as np
torch.manual_seed(0)
# Analyze the function:
# running_average(state, input, timestep)
# - state: used in arithmetic operations (multiplication, addition)
# - input: used in arithmetic operations (multiplication, addition)
# - timestep: used in arithmetic operations (division, addition)
# All three parameters appear to be numeric types that support standard operations
# Create small tensors for state and input
state = torch.randn(2, 4)
input_tensor = torch.randn(2, 4)
timestep = torch.tensor(5.0)
ARGS = {
"state": state,
"input": input_tensor,
"timestep": timestep
}
- 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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 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
|
| save_and_reimport_nn_module |
Ran ran; our contract draft was wrong, not the code |
snuhcs/snn_signgd/src/packages/snn_signgd/utils.py code served (permissive licence) · get_code("b6e46dc0b37a272f") 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 type. 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
from torch import nn, fx
import tempfile
import os
torch.manual_seed(0)
# Create a simple nn.Module to trace
class SimpleModel(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(4, 3)
def forward(self, x):
return self.linear(x)
# Create an instance and trace it to get a GraphModule
simple_model = SimpleModel()
example_input = torch.randn(2, 4)
traced_model = fx.symbolic_trace(simple_model)
# Create a temporary directory for the test
temp_dir = tempfile.mkdtemp()
ARGS = {
'model': traced_model,
'temporary_directory': temp_dir
}
- 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 type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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
|
| traversal_pre |
Ran ran; our contract draft was wrong, not the code |
snuhcs/snn_signgd/src/packages/snn_signgd/graph_functional/pattern_matching.py code served (permissive licence) · get_code("45bc1a945c9346c6") 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 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 torch
from torch import nn, fx
from typing import List, Tuple
torch.manual_seed(0)
# Create a simple model to trace
class SimpleModel(nn.Module):
def __init__(self):
super().__init__()
self.linear1 = nn.Linear(4, 3)
self.linear2 = nn.Linear(3, 2)
def forward(self, x):
x = self.linear1(x)
x = self.linear2(x)
return x
# Create a model and trace it
model = SimpleModel()
example_input = torch.randn(2, 4)
traced = fx.symbolic_trace(model)
# Get a node from the traced graph that has arguments
# We need to find a node with fx.Node arguments
node_with_args = None
for node in traced.graph.nodes:
if len(node.args) > 0:
# Check if any args are fx.Node instances
has_node_arg = any(isinstance(arg, fx.Node) for arg in node.args)
if has_node_arg:
node_with_args = node
break
# If no node with args found, create a simple scenario
if node_with_args is None:
# Get any node that has args
for node in traced.graph.nodes:
if len(node.args) > 0:
node_with_args = node
break
# Fallback: use the first non-placeholder node
if node_with_args is None:
for node in traced.graph.nodes:
if node.op != 'placeholder':
node_with_args = node
break
ARGS = {
'node': node_with_args,
'depth': 0,
'max_depth': 3
}
- 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 list, ndim 2, 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
|
| walk_backward |
Ran ran, honoured the contract we drafted |
snuhcs/snn_signgd/src/packages/snn_signgd/graph_functional/pattern_matching.py code served (permissive licence) · get_code("987da864ece2cd79") 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 torch
from torch import nn, fx
torch.manual_seed(0)
# Create a simple model to trace
class SimpleModel(nn.Module):
def __init__(self):
super().__init__()
self.linear1 = nn.Linear(4, 8)
self.linear2 = nn.Linear(8, 3)
def forward(self, x):
x = self.linear1(x)
x = self.linear2(x)
return x
# Create and trace the model to get an fx.GraphModule
model = SimpleModel()
example_input = torch.randn(2, 4)
traced_model = fx.symbolic_trace(model)
# Get a node from the traced graph
# We need to find a node that has args (not a placeholder or parameter)
target_node = None
for node in traced_model.graph.nodes:
if node.op == 'call_module' or node.op == 'call_function':
if len(node.args) > 0:
target_node = node
break
# If we couldn't find a suitable node, create one manually
if target_node is None:
# Get any non-placeholder node with arguments
for node in traced_model.graph.nodes:
if node.op != 'placeholder':
target_node = node
break
# Fallback: use the first call_module or call_function node
if target_node is None:
for node in traced_model.graph.nodes:
if node.op in ['call_module', 'call_function']:
target_node = node
break
# Final fallback: create a simple graph with nodes that have arguments
if target_node is None:
# Build a minimal graph manually
graph = fx.GraphModule(nn.Module(), fx.GraphModule(nn.Module(), fx.Graph()).graph)
with graph.graph.inserting_before(None):
placeholder = graph.graph.placeholder('x')
call_node = graph.graph.call_function(torch.relu, args=(placeholder,))
graph.graph.output(call_node)
target_node = call_node
ARGS = {
'node': target_node,
'length': 3
}
- 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 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
|
| porting |
Not yet run unverified (harvested, no recorded run) |
snuhcs/snn_signgd/src/packages/snn_signgd/port_ann.py code served (permissive licence) · get_code("fe922121061b3d44") How it ran |