SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2412.08160 · 2024

DG-Mamba: Robust and Efficient Dynamic Graph Structure Learning with Selective State Space Models

arXiv · PDF · Open in the Atlas

Code that ran

7 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 4 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2412.08160.json · badge: /api/ran/2412.08160.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
RingBDStack/DG-Mamba canonical (classifier label)
classifier basis: census
7 ran · 4 no recorded run
FunctionStatusWhere it lives
all_gather_raw Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
RingBDStack/DG-Mamba/selective_modeling/distributed/distributed_utils.py
code served (permissive licence) · get_code("0f2196b3902caf16")
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 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
from torch.distributed import ProcessGroup
from unittest.mock import MagicMock

torch.manual_seed(0)

# Create a mock ProcessGroup
mock_process_group = MagicMock(spec=ProcessGroup)

# Create a small input tensor
input_tensor = torch.randn(2, 4, dtype=torch.float32)

# Mock torch.distributed functions to make this work without actual distributed setup
original_get_world_size = torch.distributed.get_world_size
original_all_gather_into_tensor = torch.distributed.all_gather_into_tensor

def mock_get_world_size(group=None):
    return 2

def mock_all_gather_into_tensor(output, input_, group=None, async_op=False):
    # Simulate gathering by repeating the input
    output[:input_.shape[0]] = input_
    output[input_.shape[0]:] = input_
    mock_handle = MagicMock()
    mock_handle.wait = MagicMock()
    return mock_handle

torch.distributed.get_world_size = mock_get_world_size
torch.distributed.all_gather_into_tensor = mock_all_gather_into_tensor

ARGS = {
    'input_': input_tensor,
    'process_group': mock_process_group,
    'async_op': False
}
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
create_projection_matrix Ran
ran, honoured the contract we drafted
RingBDStack/DG-Mamba/REDGSL.py
pointer only (licence: MIT); the stored copy get_code serves, from qitianwu/NodeFormer, is pointer only (licence: NONE) · get_code("44fbc869db4685a6")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from qitianwu/NodeFormer, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_link_prediction_metrics Ran
ran; our contract draft was wrong, not the code
RingBDStack/DG-Mamba/metrics.py
code served (permissive licence) · get_code("43ee72fc86c6a54e")
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
from sklearn.metrics import average_precision_score, roc_auc_score

torch.manual_seed(0)

# Create small tensors for link prediction task
# predicts: model predictions (scores) for link existence, shape (num_samples,)
# labels: binary labels indicating whether link exists, shape (num_samples,)

num_samples = 8

# Predictions: continuous scores between 0 and 1
predicts = torch.rand(num_samples)

# Labels: binary values (0 or 1)
labels = torch.randint(0, 2, (num_samples,)).float()

ARGS = {
    'predicts': predicts,
    'labels': labels,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
sklearn, 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
get_matrix Ran
ran; our contract draft was wrong, not the code
RingBDStack/DG-Mamba/data_util.py
code served (permissive licence) · get_code("720cbfb1298fd6cf")
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 list. 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_geometric.data import Data

torch.manual_seed(0)

# num_nodes: number of nodes in the graph
num_nodes = 5

# edges: list of edge_index tensors (edge lists)
# Each edge_index is a 2D tensor of shape [2, num_edges]
edge_index_1 = torch.tensor([
    [0, 1, 2, 3, 0],
    [1, 2, 3, 4, 0]
], dtype=torch.long)

edge_index_2 = torch.tensor([
    [1, 2, 4],
    [2, 3, 0]
], dtype=torch.long)

edges = [edge_index_1, edge_index_2]

ARGS = {
    "num_nodes": num_nodes,
    "edges": edges
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torch_geometric — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list 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
kl_divergence Ran
ran; our contract draft was wrong, not the code
RingBDStack/DG-Mamba/REDGSL.py
code served (permissive licence) · get_code("fd7d71e5939fb04a")
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 Tensor, ndim 1, dtype family float, shape (2,) 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 torch.nn.functional as F

torch.manual_seed(0)

# Create two small tensors for x and y
# The function expects:
# - x: input logits (will be log_softmax'd)
# - y: target distribution (will be softmax'd)
# Both should have shape (batch_size, num_classes)
batch_size = 2
num_classes = 4

x = torch.randn(batch_size, num_classes)
y = torch.randn(batch_size, num_classes)

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 1, dtype family float, shape (2,) — shape (2,) 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_scatter_raw Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
RingBDStack/DG-Mamba/selective_modeling/distributed/distributed_utils.py
code served (permissive licence) · get_code("2d002bb9a87211b8")
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 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
from torch.distributed import ProcessGroup
from unittest.mock import MagicMock

torch.manual_seed(0)

# Create a mock ProcessGroup since we can't actually initialize distributed training
# The function only calls torch.distributed.get_world_size() and passes it to reduce_scatter_tensor
mock_process_group = MagicMock(spec=ProcessGroup)

# Create input tensor: batch dimension must be divisible by world_size
# Using world_size=2 for simplicity, so batch size = 4
input_tensor = torch.randn(4, 3, dtype=torch.float32, device='cpu')

# Mock torch.distributed functions to work without actual distributed setup
def mock_get_world_size(process_group):
    return 2

def mock_reduce_scatter_tensor(output, input_tensor, group, async_op=False):
    # Return a mock handle
    mock_handle = MagicMock()
    return mock_handle

# Patch the distributed functions
torch.distributed.get_world_size = mock_get_world_size
torch.distributed.reduce_scatter_tensor = mock_reduce_scatter_tensor

ARGS = {
    'input_': input_tensor,
    'process_group': mock_process_group,
    'async_op': False
}
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
shannon_entropy Ran
ran; our contract draft was wrong, not the code
RingBDStack/DG-Mamba/REDGSL.py
code served (permissive licence) · get_code("2ae1ba362d8227fc")
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 Tensor, ndim 1, dtype family float, shape (2,) 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.functional as F

torch.manual_seed(0)

# The function takes a matrix and applies softmax, log, and computes entropy
# It expects a 2D tensor (batch_size, num_features)
# Let's create a small batch of logits/scores

matrix = torch.randn(2, 4)  # batch_size=2, num_features=4

ARGS = {
    "matrix": matrix
}
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 (2,) — shape (2,) 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
all_reduce_raw Not yet run
unverified (harvested, no recorded run)
RingBDStack/DG-Mamba/selective_modeling/distributed/distributed_utils.py
code served (permissive licence) · get_code("a06d70b09eb46b60")
How it ran

no invocation recorded.

evaluate_link_prediction_linear Not yet run
unverified (harvested, no recorded run)
RingBDStack/DG-Mamba/metrics.py
code served (permissive licence) · get_code("6986b70953e783f9")
How it ran

no invocation recorded.

load_attack_data Not yet run
unverified (harvested, no recorded run)
RingBDStack/DG-Mamba/data_util.py
code served (permissive licence) · get_code("a56ff7781806f4b6")
How it ran

no invocation recorded.

load_data Not yet run
unverified (harvested, no recorded run)
RingBDStack/DG-Mamba/data_util.py
code served (permissive licence) · get_code("b3c8e77c7200ce2a")
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, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 3 later) and 7 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.

FunctionAlso present inEarliest-datedOthers named
all_gather_raw 2 other papers
1 dated earlier, 1 later
2405.21060 (2024-05)
Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
2502.18886 (2025-02)
On Pruning State-Space LLMs
all_reduce_raw 2 other papers
1 dated earlier, 1 later
2405.21060 (2024-05)
Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
2502.18886 (2025-02)
On Pruning State-Space LLMs
create_projection_matrix 2 other papers
2 dated earlier
2210.13148 (2022-10)
Transformers over Directed Acyclic Graphs
2306.08385 (2023-06)
NodeFormer: A Scalable Graph Structure Learning Transformer for Node Classification
reduce_scatter_raw 2 other papers
1 dated earlier, 1 later
2405.21060 (2024-05)
Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality
2502.18886 (2025-02)
On Pruning State-Space LLMs

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

Repositories linked to this paper

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

Abstract

Dynamic graphs exhibit intertwined spatio-temporal evolutionary patterns, widely existing in the real world. Nevertheless, the structure incompleteness, noise, and redundancy result in poor robustness for Dynamic Graph Neural Networks (DGNNs). Dynamic Graph Structure Learning (DGSL) offers a promising way to optimize graph structures. However, aside from encountering unacceptable quadratic complexity, it overly relies on heuristic priors, making it hard to discover underlying predictive patterns. How to efficiently refine the dynamic structures, capture intrinsic dependencies, and learn robust representations, remains under-explored. In this work, we propose the novel DG-Mamba, a robust and efficient Dynamic Graph structure learning framework with the Selective State Space Models (Mamba). To accelerate the spatio-temporal structure learning, we propose a kernelized dynamic message-passing operator that reduces the quadratic time complexity to linear. To capture global intrinsic dynamics, we establish the dynamic graph as a self-contained system with State Space Model. By discretizing the system states with the cross-snapshot graph adjacency, we enable the long-distance dependencies capturing with the selective snapshot scan. To endow learned dynamic structures more expressive with informativeness, we propose the self-supervised Principle of Relevant Information for DGSL to regularize the most relevant yet least redundant information, enhancing global robustness. Extensive experiments demonstrate the superiority of the robustness and efficiency of our DG-Mamba compared with the state-of-the-art baselines against adversarial attacks.

For agents

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

get_harvested_code_for_paper("2412.08160")
get_code_for_paper("2412.08160")
have("2412.08160")

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

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

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

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

Connect an agent — have() is free.