SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2602.17975 · 2026

Generating adversarial inputs for a graph neural network model of AC power flow

Robert Parker

arXiv · PDF · Open in the Atlas

Code that ran

10 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 10 failures of our instrument; 1 no recorded run), measured 2026-11-22; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2602.17975.json · badge: /api/ran/2602.17975.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
Robbybp/pfdelta canonical (classifier label)
classifier basis: census
10 ran · 1 no recorded run
FunctionStatusWhere it lives
build_bus_frame Ran
ran; our contract draft was wrong, not the code
Robbybp/pfdelta/plot_max_min_bars.py
code served (permissive licence) · get_code("6058324f0cd7a9fe")
How it ran

Ran 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 DataFrame. 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 pandas as pd
import numpy as np

# Create a sample DataFrame with the required columns
data = {
    'bus': ['bus_1', 'bus_2', 'bus_1', 'bus_2'],
    'bustype': [1, 2, 1, 2],
    'sense': ['min', 'max', 'min', 'max'],
    'objective': [10.5, -20.3, 15.2, np.nan]
}

df = pd.DataFrame(data)

ARGS = {
    'df': df
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
empty_record Ran
ran; our contract draft was wrong, not the code
Robbybp/pfdelta/check_training_adversarial_errors.py
code served (permissive licence) · get_code("33414f7a2533cb8a")
How it ran

Ran 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

torch.manual_seed(0)

ARGS = {
    'name': 'test_record'
}
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
flatten_training_point Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Robbybp/pfdelta/con_error_summary.py
code served (permissive licence) · get_code("2ea41e85f4880f43")
How it ran

Ran 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 (8,) 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 torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Create a mock flatten_input function since vectorcanos is external
class MockVectorcanos:
    @staticmethod
    def flatten_input(sample):
        # Simulate flattening: convert sample to a tensor and flatten it
        if isinstance(sample, dict):
            # Flatten dict values
            values = torch.cat([v.flatten() if isinstance(v, torch.Tensor) else torch.tensor(v).flatten() for v in sample.values()])
            return values
        elif isinstance(sample, torch.Tensor):
            return sample.flatten()
        elif isinstance(sample, (list, tuple)):
            return torch.cat([v.flatten() if isinstance(v, torch.Tensor) else torch.tensor(v).flatten() for v in sample])
        else:
            return torch.tensor(sample).flatten()

# Patch the import
import sys
mock_vectorcanos = type(sys)('vectorcanos')
mock_vectorcanos.flatten_input = MockVectorcanos.flatten_input
sys.modules['vectorcanos'] = mock_vectorcanos

# Create a sample input - a small tensor (batch of 2, features of 4)
sample = torch.randn(2, 4)

ARGS = {
    'sample': sample
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, vectorcanos — 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 (8,) — shape (8,) 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
largest_bar Ran
ran; our contract draft was wrong, not the code
Robbybp/pfdelta/plot_max_min_bars.py
code served (permissive licence) · get_code("44ab491f63799bde")
How it ran

Ran 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 pandas as pd
import numpy as np

# Create a sample DataFrame with 'min' and 'max' columns
group = pd.DataFrame({
    'min': [1.5, 2.3, np.nan],
    'max': [5.2, 4.1, 3.7]
})

ARGS = {
    'group': group
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — 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
loss_stats Ran
ran; our contract draft was wrong, not the code
Robbybp/pfdelta/evaluate_adversarial_loss.py
code served (permissive licence) · get_code("19f4e0b2c9e1f9bd")
How it ran

Ran 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

torch.manual_seed(0)

# The function takes a list of float values and computes statistics on them
# It converts the list to a tensor and computes mean, std, and max
values = [1.5, 2.3, 0.8, 3.1, 1.2, 2.9]

ARGS = {
    'values': values
}
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
parse_args Ran
ran; our contract draft was wrong, not the code
Robbybp/pfdelta/check_training_adversarial_errors.py
code served (permissive licence) · get_code("00007d6fd39c5a97")
How it ran

Ran 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 Namespace. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 argparse
from pathlib import Path
import torch
import tempfile

torch.manual_seed(0)

# Create a temporary .pt file with minimal weights
with tempfile.NamedTemporaryFile(suffix='.pt', delete=False) as tmp:
    model_weights = {'layer1': torch.randn(4, 3)}
    torch.save(model_weights, tmp.name)
    model_file_path = Path(tmp.name)

ARGS = {
    'argv': [str(model_file_path), '--batch-size', '32', '--device', 'cpu']
}
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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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
parse_args Ran
ran; our contract draft was wrong, not the code
Robbybp/pfdelta/plot_max_min_bars.py
code served (permissive licence) · get_code("6ea126244d134ae9")
How it ran

Ran 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 Namespace. 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 argparse
from pathlib import Path
from typing import Iterable
import tempfile
import os

# Create a temporary directory to act as results_dir
temp_dir = tempfile.mkdtemp()

# Create a dummy max-error-sweep.csv file in the temp directory
csv_path = os.path.join(temp_dir, 'max-error-sweep.csv')
with open(csv_path, 'w') as f:
    f.write('bus,max_error\n')
    f.write('bus_1,0.5\n')
    f.write('bus_2,0.3\n')

results_dir_path = Path(temp_dir)

ARGS = {
    'argv': ['--help'] if False else [str(results_dir_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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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
parse_args Ran
ran; our contract draft was wrong, not the code
Robbybp/pfdelta/sanity_check_single_perturbation.py
code served (permissive licence) · get_code("a459ac3fae54a668")
How it ran

Ran 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 Namespace. 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 argparse
from pathlib import Path
from typing import Iterable

# The function parse_args takes one parameter: argv
# It's an Iterable[str] that gets parsed as command-line arguments

# Looking at the function body:
# - It creates an ArgumentParser
# - Defines one positional argument 'model_file' that is optional (nargs='?')
# - The argument expects a Path type
# - It has a default value of DEFAULT_MODEL
# - It returns the parsed namespace

# To construct valid arguments for parse_args, we need to provide argv
# which is an Iterable[str] representing command-line arguments

# We can test with various argument combinations:
# 1. Empty list (uses default)
# 2. A path string (overrides default)

ARGS = {
    'argv': []  # Empty argv - will use DEFAULT_MODEL as default
}
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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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
summarize Ran
ran; our contract draft was wrong, not the code
Robbybp/pfdelta/evaluate_adversarial_loss.py
code served (permissive licence) · get_code("e4056ac646c29277")
How it ran

Ran 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

torch.manual_seed(0)

# Analyze the function signature and body:
# - summarize(name: str, values: List[float])
# - name is used as a format string parameter
# - values is passed to loss_stats which converts it to a tensor and computes mean, std, max

ARGS = {
    'name': 'loss_batch_1',
    'values': [0.5, 1.2, 0.8, 2.1, 1.5]
}
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
zero_norm_histogram_path Ran
ran; our contract draft was wrong, not the code
Robbybp/pfdelta/con_error_summary.py
code served (permissive licence) · get_code("a35d79ebe4cc206f")
How it ran

Ran 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.

from pathlib import Path

ARGS = {
    "outfile": Path("/tmp/histogram.txt"),
}
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
compute_distances Not yet run
unverified (harvested, no recorded run)
Robbybp/pfdelta/con_error_summary.py
code served (permissive licence) · get_code("dc8b6b364f653085")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 11 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

This work formulates and solves optimization problems to generate input points that yield high errors between a neural network's predicted AC power flow solution and solutions to the AC power flow equations. We demonstrate this capability on an instance of the CANOS-PF graph neural network model, as implemented by the PF∆ benchmark library, operating on a 14-bus test grid. Generated adversarial points yield errors as large as 3.7 per-unit in reactive power and 0.08 per-unit in voltage magnitude. When minimizing the perturbation from a training point necessary to satisfy adversarial constraints, we find that the constraints can be met with as little as an 0.04 per-unit perturbation in voltage magnitude on a single bus. This work motivates the development of rigorous verification and robust training methods for neural network surrogate models of AC power flow.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2602.17975")
get_code_for_paper("2602.17975")
have("2602.17975")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2602.17975.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2602.17975.svg)](https://syntology.ai/paper/2602.17975)

Connect an agent — have() is free.