SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2309.00860 · 2023

Towards Code Watermarking with Dual-Channel Transformations

arXiv · PDF · Open in the Atlas

Code that ran

7 of 9 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, 1 violated it and 0 have no contract verdict; 6 failures of our instrument; 2 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/2309.00860.json · badge: /api/ran/2309.00860.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
ybrua/srcmarker canonical (classifier label)
classifier basis: census
7 ran · 2 no recorded run
FunctionStatusWhere it lives
compare_tokens Ran
ran, violated the contract we drafted
ybrua/srcmarker/dataset_filter.py
code served (permissive licence) · get_code("ee286a0244788a4d")
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 bool, 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

# Construct valid arguments for compare_tokens function
old_tokens = ["hello", "world", "test"]
new_tokens = ["hello", "world", "test"]

ARGS = {
    "old_tokens": old_tokens,
    "new_tokens": new_tokens,
}
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 bool, 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
compose_function Ran
ran; our contract draft was wrong, not the code
ybrua/srcmarker/benchmark_mbxp.py
code served (permissive licence) · get_code("d01e3bad784f5a12")
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 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)

sample = {
    'prompt': 'def hello_world():\n    ',
    'canonical_solution': 'return "Hello, World!"'
}

ARGS = {
    'sample': sample
}
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
fix_single_quotes Ran
ran; our contract draft was wrong, not the code
ybrua/srcmarker/code_tokenizer.py
code served (permissive licence) · get_code("cc058164d4cea87f")
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 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

def fix_single_quotes(input_str: str):
    return re.sub("\\s+(?=(?:(?:[^']*'){2})*[^']*'[^']*$)", '', input_str)

# The function takes a single parameter: input_str (a string)
# It uses re.sub to remove whitespace based on a regex pattern
# The pattern looks for whitespace followed by a specific lookahead condition
# related to single quotes

ARGS = {
    "input_str": "hello  world  'test  string'  with   spaces"
}
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
join_lines_default Ran
ran; our contract draft was wrong, not the code
ybrua/srcmarker/dewatermark_attack.py
code served (permissive licence) · get_code("7e883314e36cf0ee")
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 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.

# Define ARGS for join_lines_default function

ARGS = {
    'tokens': ['def', 'foo', '(', 'x', ')', ':', 'return', 'x', '.', 'bar', '<', 'unk', '>', '*'],
    'keywords': {'def', 'return', 'if', 'else', 'for', 'while', 'class', 'import'}
}
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
join_lines_java_heuristic Ran
ran; our contract draft was wrong, not the code
ybrua/srcmarker/dewatermark_attack.py
code served (permissive licence) · get_code("fe333998b485d649")
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 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.

# Setup code for join_lines_java_heuristic

ARGS = {
    'tokens': [
        'public',
        'static',
        'void',
        'main',
        '(',
        'String',
        '[',
        ']',
        'args',
        ')',
        '{',
        'System',
        '.',
        'out',
        '.',
        'println',
        '(',
        '<unk>',
        ')',
        ';',
        '}',
        'import',
        'java',
        '.',
        'util',
        '.',
        '*',
        ';',
        '@',
        'Override',
        'private',
        '_member',
        'PUBLIC_CONST',
        '<',
        'String',
        '>',
    ],
    'keywords': {
        'public',
        'static',
        'void',
        'main',
        'String',
        'System',
        'import',
        'private',
        'class',
        'interface',
        'extends',
        'implements',
    }
}
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
load_samples_with_sol Ran
ran; our contract draft was wrong, not the code
ybrua/srcmarker/benchmark_mbxp.py
code served (permissive licence) · get_code("837bc3a2b30ca8af")
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, 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 json
import tempfile
import os

# Create a temporary file with sample data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.jsonl')

# Write sample data with some having canonical_solution and some without
sample_data = [
    {'canonical_solution': 'def foo(): pass', 'other_field': 'value1'},
    {'canonical_solution': None, 'other_field': 'value2'},
    {'canonical_solution': 'def bar(): return 42', 'other_field': 'value3'},
    {'canonical_solution': None, 'other_field': 'value4'},
]

for sample in sample_data:
    temp_file.write(json.dumps(sample) + '\n')

temp_file.close()
dataset_path = temp_file.name

ARGS = {
    'dataset_path': dataset_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 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
pprint_res_dict Ran
ran; our contract draft was wrong, not the code
ybrua/srcmarker/dewatermark_gru.py
code served (permissive licence) · get_code("34ea0d851b876d27")
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 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 typing import Dict

def pprint_res_dict(res: Dict, prefix: str=None) -> str:
    res_str = '|'
    for k, v in res.items():
        if isinstance(v, float):
            res_str += f' {k}: {v:.4f} |'
        elif isinstance(v, int):
            res_str += f' {k}: {v:3d} |'
        else:
            res_str += f' {k}: {v} |'
    if prefix is not None:
        assert isinstance(prefix, str), 'prefix must be a string'
        res_str = prefix + res_str
    return res_str


ARGS = {
    'res': {
        'loss': 0.5432,
        'accuracy': 0.9876,
        'epoch': 42,
        'model_name': 'test_model'
    },
    'prefix': 'RESULTS: '
}
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
fix_join_artifacts Not yet run
unverified (harvested, no recorded run)
ybrua/srcmarker/code_tokenizer.py
code served (permissive licence) · get_code("1d1817089d7c3465")
How it ran

no invocation recorded.

remove_comments Not yet run
unverified (harvested, no recorded run)
ybrua/srcmarker/dataset_filter.py
code served (permissive licence) · get_code("c3e24749c04318fb")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 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 9 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

The expansion of the open source community and the rise of large language models have raised ethical and security concerns on the distribution of source code, such as misconduct on copyrighted code, distributions without proper licenses, or misuse of the code for malicious purposes. Hence it is important to track the ownership of source code, in which watermarking is a major technique. Yet, drastically different from natural languages, source code watermarking requires far stricter and more complicated rules to ensure the readability as well as the functionality of the source code. Hence we introduce SrcMarker, a watermarking system to unobtrusively encode ID bitstrings into source code, without affecting the usage and semantics of the code. To this end, SrcMarker performs transformations on an AST-based intermediate representation that enables unified transformations across different programming languages. The core of the system utilizes learning-based embedding and extraction modules to select rule-based transformations for watermarking. In addition, a novel feature-approximation technique is designed to tackle the inherent non-differentiability of rule selection, thus seamlessly integrating the rule-based transformations and learning-based networks into an interconnected system to enable end-to-end training. Extensive experiments demonstrate the superiority of SrcMarker over existing methods in various watermarking requirements.

For agents

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

get_harvested_code_for_paper("2309.00860")
get_code_for_paper("2309.00860")
have("2309.00860")

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

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

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

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

Connect an agent — have() is free.