SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2110.02793 · 2021

Multi-Agent Constrained Policy Optimisation

arXiv · PDF · Open in the Atlas

Code that ran

4 of 7 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 2 have no contract verdict; 2 failures of our instrument; 3 no recorded run), measured 2026-11-22; 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/2110.02793.json · badge: /api/ran/2110.02793.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
chauncygu/multi-agent-constrained-policy-optimisation canonical (classifier label)
classifier basis: classifier_2025
0 ran · 1 no recorded run
chauncygu/safe-multi-agent-mujoco community (classifier label)
classifier basis not recorded on the link
3 ran · 2 no recorded run
chauncygu/safe-multi-agent-robosuite extension (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
convert Ran
ran; our contract draft was wrong, not the code
chauncygu/safe-multi-agent-robosuite/robosuite/multi_agent/manyrobot_env.py
code served (permissive licence) · get_code("9d0e7c23576a092f")
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) and returned GenericDict. 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 collections import namedtuple

torch.manual_seed(0)

# The function convert() takes a dictionary and converts it to a namedtuple
# It calls dictionary.keys() and uses **dictionary to unpack it
# So we need a valid dictionary with string keys

test_dict = {
    'name': 'test_model',
    'value': 42,
    'tensor': torch.randn(2, 4),
    'list': [1, 2, 3],
    'nested': {'key': 'value'}
}

ARGS = {
    'dictionary': test_dict
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type GenericDict — a GenericDict 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
convert_observation_to_space Ran
ran; our contract draft was wrong, not the code
chauncygu/safe-multi-agent-mujoco/safety_multi_agent_mujoco/safety_ma_mujoco/safety_multiagent_mujoco/mujoco_env.py
code served (permissive licence) · get_code("c81e179f5e2f405f")
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 numpy as np
from collections import OrderedDict
from gym import spaces

# Test case 1: numpy array observation
observation_array = np.random.randn(2, 4).astype(np.float32)

# Test case 2: dict observation with nested structure
observation_dict = {
    'position': np.array([1.0, 2.0, 3.0], dtype=np.float32),
    'velocity': np.array([0.1, 0.2], dtype=np.float32),
}

# Test case 3: nested dict observation
observation_nested_dict = {
    'state': np.array([1.0, 2.0], dtype=np.float32),
    'info': {
        'image': np.random.randn(3, 4, 4).astype(np.float32),
    }
}

ARGS = {
    'observation': observation_dict
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
gym, numpy — 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 1 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_joints_at_kdist Ran
ran on a synthesized input
chauncygu/safe-multi-agent-mujoco/safety_multi_agent_mujoco/safety_ma_mujoco/safety_multiagent_mujoco/obsk.py
code served (permissive licence) · get_code("b740cb6f99054211")
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
import numpy as np

class Joint:
    def __init__(self, label, joint_id):
        self.label = label
        self.id = joint_id
    
    def __hash__(self):
        return hash(self.id)
    
    def __eq__(self, other):
        return self.id == other.id
    
    def __repr__(self):
        return f"Joint({self.label})"

class Hyperedge:
    def __init__(self, edges_set):
        self.edges = edges_set
    
    def __contains__(self, item):
        return item in self.edges

# Create some Joint objects
joint_0 = Joint("joint_0", 0)
joint_1 = Joint("joint_1", 1)
joint_2 = Joint("joint_2", 2)
joint_3 = Joint("joint_3", 3)
joint_4 = Joint("joint_4", 4)
joint_5 = Joint("joint_5", 5)

# Create agent_partitions: list of joint tuples in order of agent ids
# agent_id 0 has joints [joint_0, joint_1]
# agent_id 1 has joints [joint_2, joint_3]
agent_partitions = [
    [joint_0, joint_1],
    [joint_2, joint_3]
]

# Create hyperedges: list of hyperedge objects with edges attribute
# Each hyperedge connects joints together
hyperedges = [
    Hyperedge({joint_0, joint_2}),
    Hyperedge({joint_2, joint_4}),
    Hyperedge({joint_1, joint_3}),
    Hyperedge({joint_3, joint_5})
]

ARGS = {
    "agent_id": 0,
    "agent_partitions": agent_partitions,
    "hyperedges": hyperedges,
    "k": 2,
    "kagents": False
}
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 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
mass_center Ran
ran on a synthesized input
chauncygu/safe-multi-agent-mujoco/safety_multi_agent_mujoco/safety_ma_mujoco/safety_multiagent_mujoco/humanoid.py
code served (permissive licence) · get_code("46bd205700c42f20")
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 float64, ndim 0, 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 numpy as np

class MockModel:
    def __init__(self):
        # body_mass should be a 1D array of masses for each body
        # Using 4 bodies with distinct masses
        self.body_mass = np.array([1.0, 2.0, 3.0, 4.0])

class MockSimData:
    def __init__(self):
        # xipos should be shape (n_bodies, 3) for 3D positions
        # 4 bodies, 3 spatial dimensions
        self.xipos = np.array([
            [1.0, 2.0, 3.0],
            [4.0, 5.0, 6.0],
            [7.0, 8.0, 9.0],
            [10.0, 11.0, 12.0]
        ])

class MockSim:
    def __init__(self):
        self.data = MockSimData()

model = MockModel()
sim = MockSim()

ARGS = {
    "model": model,
    "sim": sim
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, 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
build_obs Not yet run
unverified (harvested, no recorded run)
chauncygu/safe-multi-agent-mujoco/safety_multi_agent_mujoco/safety_ma_mujoco/safety_multiagent_mujoco/obsk.py
code served (permissive licence) · get_code("7b68f30bd920cce1")
How it ran

no invocation recorded.

get_parts_and_edges Not yet run
unverified (harvested, no recorded run)
chauncygu/safe-multi-agent-mujoco/safety_multi_agent_mujoco/safety_ma_mujoco/safety_multiagent_mujoco/obsk.py
code served (permissive licence) · get_code("0e771fe439b0e7f9")
How it ran

no invocation recorded.

parse_args Not yet run
unverified (harvested, no recorded run)
chauncygu/multi-agent-constrained-policy-optimisation/MACPO/macpo/scripts/train/train_mujoco.py
pointer only (licence: NOASSERTION) · get_code("5c01d0fdf71a654e")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, chauncygu/multi-agent-constrained-policy-optimisation (NOASSERTION). 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. No invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 2 later) and 2 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
mass_center 4 other papers
3 dated earlier, 1 later
2006.13916 (2020-06)
Off-Dynamics Reinforcement Learning: Training for Transfer with Domain Classifiers
2103.13842 (2021-03)
Model Predictive Actor-Critic: Accelerating Robot Skill Acquisition with Deep Reinforcement Learning
2104.06922 (2021-04)
Safe Continuous Control with Constrained Model-Based Policy Optimization
and 1 more not named here
convert 2 other papers
2 dated earlier
2003.06709 (2020-03)
FACMAC: Factored Multi-Agent Centralised Policy Gradients
2009.12293 (2020-09)
robosuite: A Modular Simulation Framework and Benchmark for Robot Learning
convert_observation_to_space 2 other papers
1 dated earlier, 1 later
2104.06922 (2021-04)
Safe Continuous Control with Constrained Model-Based Policy Optimization
2602.10793 (2026-02)
Semi-Supervised Cross-Domain Imitation Learning
build_obs 1 other paper
1 dated earlier
2003.06709 (2020-03)
FACMAC: Factored Multi-Agent Centralised Policy Gradients
get_joints_at_kdist 1 other paper
1 dated earlier
2003.06709 (2020-03)
FACMAC: Factored Multi-Agent Centralised Policy Gradients

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

Developing reinforcement learning algorithms that satisfy safety constraints is becoming increasingly important in real-world applications. In multi-agent reinforcement learning (MARL) settings, policy optimisation with safety awareness is particularly challenging because each individual agent has to not only meet its own safety constraints, but also consider those of others so that their joint behaviour can be guaranteed safe. Despite its importance, the problem of safe multi-agent learning has not been rigorously studied; very few solutions have been proposed, nor a sharable testing environment or benchmarks. To fill these gaps, in this work, we formulate the safe MARL problem as a constrained Markov game and solve it with policy optimisation methods. Our solutions -- Multi-Agent Constrained Policy Optimisation (MACPO) and MAPPO-Lagrangian -- leverage the theories from both constrained policy optimisation and multi-agent trust region learning. Crucially, our methods enjoy theoretical guarantees of both monotonic improvement in reward and satisfaction of safety constraints at every iteration. To examine the effectiveness of our methods, we develop the benchmark suite of Safe Multi-Agent MuJoCo that involves a variety of MARL baselines. Experimental results justify that MACPO/MAPPO-Lagrangian can consistently satisfy safety constraints, meanwhile achieving comparable performance to strong baselines.

For agents

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

get_harvested_code_for_paper("2110.02793")
get_code_for_paper("2110.02793")
have("2110.02793")

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

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

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

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

Connect an agent — have() is free.