| append_results |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/reporting.py code served (permissive licence) · get_code("4a1f4e792a6ed7cd") 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 int, ndim 0, dtype family int, 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 csv
import os
from pathlib import Path
from typing import Any, Iterable
import tempfile
RESULT_IDENTITY_COLUMNS = ['attack', 'model', 'parser', 'prompt_scope', 'screen_scope', 'domain', 'example_id', 'patch_id', 'screen_id', 'temperature', 'sample_index']
RESULT_COLUMNS = RESULT_IDENTITY_COLUMNS + ['case_seed', 'target_match', 'geometric_mean_likelihood', 'arithmetic_mean_likelihood', 'output_text']
def append_results(path: Path, rows: Iterable[dict[str, Any]], completed: set[tuple[str, ...]]) -> int:
pending = []
for row in rows:
key = tuple((str(row[column]) for column in RESULT_IDENTITY_COLUMNS))
if key not in completed:
pending.append((row, key))
if not pending:
return 0
with path.open('a', encoding='utf-8', newline='') as handle:
writer = csv.DictWriter(handle, fieldnames=RESULT_COLUMNS)
writer.writerows((row for row, _ in pending))
handle.flush()
os.fsync(handle.fileno())
completed.update((key for _, key in pending))
return len(pending)
# Create a temporary file for testing
temp_dir = tempfile.mkdtemp()
test_file = Path(temp_dir) / "results.csv"
# Create initial CSV file with header
with test_file.open('w', encoding='utf-8', newline='') as f:
writer = csv.DictWriter(f, fieldnames=RESULT_COLUMNS)
writer.writeheader()
# Create sample rows to append
sample_rows = [
{
'attack': 'attack_1',
'model': 'model_a',
'parser': 'parser_1',
'prompt_scope': 'full',
'screen_scope': 'viewport',
'domain': 'example.com',
'example_id': '001',
'patch_id': 'patch_1',
'screen_id': 'screen_1',
'temperature': '0.5',
'sample_index': '0',
'case_seed': '42',
'target_match': 'true',
'geometric_mean_likelihood': '0.85',
'arithmetic_mean_likelihood': '0.87',
'output_text': 'test output 1'
},
{
'attack': 'attack_2',
'model': 'model_b',
'parser': 'parser_2',
'prompt_scope': 'partial',
'screen_scope': 'full',
'domain': 'test.org',
'example_id': '002',
'patch_id': 'patch_2',
'screen_id': 'screen_2',
'temperature': '0.7',
'sample_index': '1',
'case_seed': '43',
'target_match': 'false',
'geometric_mean_likelihood': '0.75',
'arithmetic_mean_likelihood': '0.76',
'output_text': 'test output 2'
}
]
# Create completed set to track which rows have been written
completed_set = set()
ARGS = {
'path': test_file,
'rows': sample_rows,
'completed': completed_set
}
- 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 int, ndim 0, dtype family int, 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
|
| backward_model_loss |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/optimization.py code served (permissive licence) · get_code("695a398a0fdd89e9") 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 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
torch.manual_seed(0)
# Create a small tensor that requires grad so backward() can be called on it
model_loss = torch.tensor(2.5, requires_grad=True)
# Set positive integers for model_count and settings_per_update
model_count = 3
settings_per_update = 2
ARGS = {
"model_loss": model_loss,
"model_count": model_count,
"settings_per_update": settings_per_update,
}
- 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 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
|
| best_patch_rank |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/optimization.py code served (permissive licence) · get_code("b9361dc2dda419da") 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 math
ARGS = {
'metrics': {
'evaluations': 10,
'loss': 0.5,
'targets_above_threshold': 10,
'argmax_matches': 10,
}
}
- 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 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
|
| build_user_msg_visual |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/prompts.py code served (permissive licence) · get_code("7f1dd1b398ed9382") 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
torch.manual_seed(0)
ARGS = {
"query": "Find the login button on the screen",
"window_title": "Mozilla Firefox - Login Page",
"window_names_str": "Firefox\nChrome\nVSCode\nTerminal",
"clipboard_content": "user@example.com",
"text_rendering": None,
"candidates": [
{"type": "button", "text": "Login", "bbox": [100, 200, 150, 230]},
{"type": "input", "text": "Username", "bbox": [50, 100, 200, 130]},
{"type": "input", "text": "Password", "bbox": [50, 140, 200, 170]}
],
"prev_actions": [
"click(100, 50)",
"type('admin')",
"click(100, 80)"
],
"textual_memory": "User logged in successfully. Navigation menu appeared."
}
- 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
|
| centered_patch_ranges |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/config.py code served (permissive licence) · get_code("d73031427f43ab3b") 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 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.
# Setup code for centered_patch_ranges function
ARGS = {
"x_area": [10, 100],
"y_area": [20, 80],
"patch_size": [30, 40],
}
- 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 tuple, ndim 2, dtype family int — 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
|
| ensure_results_file |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/reporting.py code served (permissive licence) · get_code("6ea9ca43cd05ac45") 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 tempfile
from pathlib import Path
ARGS = {
'path': Path(tempfile.gettempdir()) / 'test_results.csv'
}
- 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
|
| filter_entities_with_mask |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/a11y.py code served (permissive licence) · get_code("d690aada5f8669d2") 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
import numpy as np
torch.manual_seed(0)
# Create a small mask (binary array where values indicate coverage)
# The function checks if mask[y:y+h, x:x+w].sum() / area < th
mask = np.array([
[1, 1, 0, 0, 0],
[1, 1, 0, 0, 0],
[0, 0, 1, 1, 0],
[0, 0, 1, 1, 0],
[0, 0, 0, 0, 1]
], dtype=np.float32)
# Create entities with shape dictionaries
# Each entity has a 'shape' key with x, y, width, height
entities = [
{
'shape': {
'x': 0,
'y': 0,
'width': 2,
'height': 2
},
'id': 1
},
{
'shape': {
'x': 2,
'y': 2,
'width': 2,
'height': 2
},
'id': 2
},
{
'shape': {
'x': 3,
'y': 3,
'width': 2,
'height': 2
},
'id': 3
}
]
# Set threshold
th = 0.3
ARGS = {
'entities': entities,
'mask': mask,
'th': th
}
- 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 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
|
| filter_nonvis_and_oob_entities |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/a11y.py code served (permissive licence) · get_code("7cbc0ee1e93d5dec") 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
import numpy as np
# Construct valid arguments for filter_nonvis_and_oob_entities
entities = [
{
'id': 1,
'shape': {'x': 10, 'y': 20, 'width': 50, 'height': 30},
'label': 'object1'
},
{
'id': 2,
'shape': {'x': -5, 'y': 15, 'width': 40, 'height': 25},
'label': 'object2'
},
{
'id': 3,
'shape': {'x': 200, 'y': 200, 'width': 100, 'height': 100},
'label': 'object3'
},
{
'id': 4,
'shape': {'x': 80, 'y': 90, 'width': 2, 'height': 2},
'label': 'tiny_object'
}
]
width = 150
height = 120
ARGS = {
'entities': entities,
'width': width,
'height': height
}
- 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 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
|
| get_mask_from_entities |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/a11y.py code served (permissive licence) · get_code("023a841443ebee6c") 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 2, dtype family float, shape (80, 100) 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
# Construct valid arguments for get_mask_from_entities
entities = [
{
'shape': {
'x': 10,
'y': 5,
'width': 20,
'height': 15
}
},
{
'shape': {
'x': 50,
'y': 30,
'width': 25,
'height': 20
}
}
]
width = 100
height = 80
ARGS = {
'entities': entities,
'width': width,
'height': height
}
- 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 2, dtype family float, shape (80, 100) — shape (80, 100) 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
|
| normalize_image |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/model.py code served (permissive licence) · get_code("0d40f28ae88b0be6") 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 3, dtype family float, shape (4, 3, 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 torch
import numpy as np
torch.manual_seed(0)
# Construct arguments for normalize_image function
# The function expects:
# - image: a tensor with shape (C, H, W) where C is channels
# - image_mean: a 1D tensor of shape (C,) for channel means
# - image_std: a 1D tensor of shape (C,) for channel standard deviations
# Create a small image tensor: (4, 3, 5) = (channels, height, width)
image = torch.randn(4, 3, 5)
# Create mean and std tensors with 4 channels to match image
image_mean = torch.tensor([0.5, 0.3, 0.4, 0.2])
image_std = torch.tensor([0.1, 0.15, 0.12, 0.08])
ARGS = {
"image": image,
"image_mean": image_mean,
"image_std": image_std,
}
- 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 3, dtype family float, shape (4, 3, 5) — shape (4, 3, 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
|
| paper_conditions |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/protocol.py code served (permissive licence) · get_code("fa74fb20ad5c6635") 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 dataclasses import dataclass
@dataclass(frozen=True)
class EvaluationCondition:
prompt_scope: str
screen_scope: str
def paper_conditions(attack: str) -> list[EvaluationCondition]:
if attack == 'targeted':
return [EvaluationCondition('selected', 'selected'), EvaluationCondition('evaluation', 'selected'), EvaluationCondition('selected', 'evaluation')]
if attack == 'universal':
return [EvaluationCondition(prompt_scope, screen_scope) for prompt_scope in ('training', 'evaluation') for screen_scope in ('training', 'evaluation')]
raise ValueError(f'Unsupported attack: {attack}')
ARGS = {
'attack': 'targeted'
}
- 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
|
| place_png_patch |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/agent.py code served (permissive licence) · get_code("b8f593e790ff6e89") 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 Image. 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
from PIL import Image
# Create temporary directory for test images
temp_dir = tempfile.mkdtemp()
# Create a base image (100x100 RGB)
base_image = Image.new('RGB', (100, 100), color='red')
# Create a patch image (50x50 RGB)
patch_image = Image.new('RGB', (50, 50), color='blue')
# Save patch image to a temporary file
patch_path = os.path.join(temp_dir, 'patch.png')
patch_image.save(patch_path)
# Define arguments for place_png_patch
ARGS = {
'image': base_image,
'patch_path': patch_path,
'x_range': (10, 60), # width range: 60 - 10 = 50
'y_range': (20, 70), # height range: 70 - 20 = 50
'crop_from_full_image': False
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- PIL — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int 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
|
| previous_actions_text |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/agent.py code served (permissive licence) · get_code("8df7273a1174a5b9") 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
torch.manual_seed(0)
# The function takes previous_actions (iterable of action strings) and limit (int)
# It reverses the last 'limit' actions and formats them with offsets
previous_actions = [
"Action 1: Move forward",
"Action 2: Turn left",
"Action 3: Jump",
"Action 4: Duck",
"Action 5: Attack"
]
limit = 3
ARGS = {
"previous_actions": previous_actions,
"limit": limit
}
- 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
|
| read_target |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/config.py code served (permissive licence) · get_code("812af51bcfcfea5c") 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
from pathlib import Path
# Create a temporary file with some text content
with tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt', encoding='utf-8') as f:
f.write("Hello, World!\n")
temp_path = Path(f.name)
ARGS = {
'path': temp_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 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
|
| relative_artifact_path |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/artifacts.py code served (permissive licence) · get_code("a2421fdbc5dc7073") 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.
from pathlib import Path
import tempfile
import os
# Create temporary directories to use as paths
with tempfile.TemporaryDirectory() as tmpdir:
run_root = Path(tmpdir) / "run_root"
run_root.mkdir(parents=True, exist_ok=True)
artifact_dir = run_root / "artifacts"
artifact_dir.mkdir(parents=True, exist_ok=True)
artifact_file = artifact_dir / "model.pth"
artifact_file.touch()
# Define ARGS with valid Path objects
ARGS = {
"path": artifact_file,
"run_root": run_root,
}
- 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
|
| resolve_path |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/config.py code served (permissive licence) · get_code("ff0604a9ed196593") 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 PosixPath. 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
from pathlib import Path
# Create a temporary directory to use as the config directory
temp_dir = tempfile.mkdtemp()
# Define config dict with _config_dir key
config = {
'_config_dir': temp_dir
}
# Test with a relative path string
value = "subdir/file.txt"
# Construct ARGS
ARGS = {
'config': config,
'value': value
}
- 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 PosixPath — a PosixPath output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PosixPath 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
|
| retain_best_patch |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/optimization.py code served (permissive licence) · get_code("6d4d608b0d69807f") 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 math
torch.manual_seed(0)
# Create small candidate and best patch tensors
candidate_patch = torch.randn(2, 4)
best_patch = torch.randn(2, 4)
# Create candidate metrics dictionary
candidate_metrics = {
'evaluations': 10,
'loss': 0.5,
'targets_above_threshold': 10,
'argmax_matches': 10
}
# Create best metrics dictionary
best_metrics = {
'evaluations': 10,
'loss': 0.7,
'targets_above_threshold': 9,
'argmax_matches': 9
}
ARGS = {
'candidate_patch': candidate_patch,
'candidate_metrics': candidate_metrics,
'best_patch': best_patch,
'best_metrics': best_metrics
}
- 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
|
| select_targeted_pair |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/protocol.py code served (permissive licence) · get_code("00eed04c6bc6f9c9") 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 random
from typing import Sequence, TypeVar
T = TypeVar('T')
def select_targeted_pair(prompts: Sequence[T], screen_ids: Sequence[int], seed: int) -> tuple[T, int]:
"""Uniformly and reproducibly select one element of prompts × screens."""
if not prompts or not screen_ids:
raise ValueError('Targeted selection requires prompts and screens')
pair_index = random.Random(seed).randrange(len(prompts) * len(screen_ids))
prompt_index, screen_index = divmod(pair_index, len(screen_ids))
return (prompts[prompt_index], screen_ids[screen_index])
# Setup
prompts = [
"What is the weather today?",
"Tell me a story",
"Explain quantum mechanics"
]
screen_ids = [101, 202, 303, 404]
seed = 42
ARGS = {
"prompts": prompts,
"screen_ids": screen_ids,
"seed": seed
}
- 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 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
|
| tile_image |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/model.py code served (permissive licence) · get_code("237d78c2b5521450") 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 4, dtype family float, shape (4, 3, 2, 3) 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)
# Create a small image tensor with shape (channels, height, width)
# The function expects a 3D tensor and divides height and width by 2
# So we need dimensions divisible by 2
pixel_values = torch.randn(3, 4, 6) # 3 channels, 4 height, 6 width
ARGS = {
"pixel_values": pixel_values,
"num_tiles": 4
}
- 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 4, dtype family float, shape (4, 3, 2, 3) — shape (4, 3, 2, 3) 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
|
| torch_load |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/artifacts.py code served (permissive licence) · get_code("4cf99e43d4302ec0") 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
from pathlib import Path
import tempfile
torch.manual_seed(0)
# Create a temporary file with a saved torch object
with tempfile.NamedTemporaryFile(suffix='.pt', delete=False) as tmp:
tmp_path = tmp.name
# Save a simple dict with some tensors
test_data = {
'tensor': torch.randn(2, 4),
'nested': {
'value': torch.tensor([1.0, 2.0, 3.0])
},
'scalar': 42
}
torch.save(test_data, tmp_path)
path = Path(tmp_path)
ARGS = {
'path': path
}
- 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 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
|
| unnormalize_image |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/model.py code served (permissive licence) · get_code("be561a8361863fa7") 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 4, dtype family float, shape (2, 4, 3, 3) 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)
# Create a small image tensor: shape (batch=2, channels=4, height=3, width=3)
image = torch.randn(2, 4, 3, 3)
# Create image_mean and image_std tensors with shape (channels=4,)
image_mean = torch.randn(4)
image_std = torch.randn(4).abs() + 0.1 # ensure positive values for std
ARGS = {
"image": image,
"image_mean": image_mean,
"image_std": image_std,
}
- 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 4, dtype family float, shape (2, 4, 3, 3) — shape (2, 4, 3, 3) 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
|
| validate_id |
Ran ran on a synthesized input |
AIchberger/mip-against-agent/src/mip_attack/artifacts.py code served (permissive licence) · get_code("5b1a5a43a05c36df") 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 re
_SAFE_ID = re.compile('^[A-Za-z0-9._-]+$')
def validate_id(value: str, name: str) -> str:
if not value or not _SAFE_ID.fullmatch(value) or value in {'.', '..'}:
raise ValueError(f"{name} must contain only letters, numbers, '.', '_', or '-'")
return value
ARGS = {
'value': 'valid_id_123',
'name': 'identifier'
}
- 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
|