SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2606.09278 · 2026

Internalizing Geometric Law: Learning from Solver Residuals for Precision-Critical Generation

Ziyi Shou, Shen Xin, Rafael Cabral, Pang Zixi

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, 0 violated it and 0 have no contract verdict; 7 failures of our instrument; 2 no recorded run), measured 2026-11-23; 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/2606.09278.json · badge: /api/ran/2606.09278.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
Huawei-AI4Math/PyGeoX canonical (classifier label)
classifier basis: census
7 ran · 2 no recorded run
FunctionStatusWhere it lives
create_user_prompt Ran
ran; our contract draft was wrong, not the code
Huawei-AI4Math/PyGeoX/model_testing/PyGeoX-Wild/generate.py
code served (permissive licence) · get_code("ff16753faee15ece")
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
import torch.nn as nn

# The function create_user_prompt takes a question_text parameter
# which is a string describing a diagram.
# The function simply formats it into a prompt template.

question_text = "A circle at coordinates (5, 10) with radius 3, and another circle at (15, 20) with radius 7"

ARGS = {
    "question_text": question_text
}
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
execute_code_and_check Ran
ran; our contract draft was wrong, not the code
Huawei-AI4Math/PyGeoX/model_testing/PyGeoX-Wild/generate.py
code served (permissive licence) · get_code("dd79b87bb42441c6")
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, 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 traceback
import matplotlib.pyplot as plt

# Create minimal valid arguments for execute_code_and_check

code = """
points = {'point1': (0, 0), 'point2': (1, 1)}
circles = {'circle1': {'center': (0.5, 0.5), 'radius': 1.0}}
"""

problem_id = "test_problem_001"

ARGS = {
    'code': code,
    'problem_id': problem_id
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib — 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
extract_python_code Ran
ran; our contract draft was wrong, not the code
Huawei-AI4Math/PyGeoX/model_testing/PyGeoX-Wild/image.py
code served (permissive licence) · get_code("a9b5bac7fe4d7d84")
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 extract_python_code(text):
    """
    从 LLM 的回复中提取 python 代码块。
    """
    pattern = '```python\\s*(.*?)\\s*```'
    matches = re.findall(pattern, text, re.DOTALL)
    if matches:
        return matches[0].strip()
    return text.strip()


# Test case 1: text with python code block
text_with_code = """
Here is some explanation.

print("Hello, World!")
x = 42

More explanation.
"""

# Test case 2: text without code block
text_without_code = "This is just plain text with no code blocks."

# Test case 3: text with multiple code blocks (only first is extracted)
text_with_multiple = """
First block:

def foo():
    return 1

Second block:

def bar():
    return 2

"""

ARGS = {
    "text": text_with_code
}
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
image_to_base64_data_url Ran
ran; our contract draft was wrong, not the code
Huawei-AI4Math/PyGeoX/model_testing/PyGeoX-Wild/evaluate.py
code served (permissive licence) · get_code("060eb6f4478c228b")
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 base64
from pathlib import Path
import tempfile
import os

# Create a temporary PNG file for testing
temp_dir = tempfile.mkdtemp()
temp_image_path = Path(temp_dir) / "test_image.png"

# Create a minimal valid PNG file (1x1 pixel)
# This is the smallest valid PNG: a 1x1 transparent pixel
png_bytes = bytes([
    0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A,  # PNG signature
    0x00, 0x00, 0x00, 0x0D,                          # IHDR chunk length
    0x49, 0x48, 0x44, 0x52,                          # IHDR
    0x00, 0x00, 0x00, 0x01,                          # width: 1
    0x00, 0x00, 0x00, 0x01,                          # height: 1
    0x08, 0x06, 0x00, 0x00, 0x00,                    # bit depth, color type, compression, filter, interlace
    0x1F, 0x15, 0xC4, 0x89,                          # CRC
    0x00, 0x00, 0x00, 0x0A,                          # IDAT chunk length
    0x49, 0x44, 0x41, 0x54,                          # IDAT
    0x78, 0x9C, 0x63, 0x00, 0x01, 0x00, 0x00, 0x05, 0x00, 0x01,  # compressed data
    0x0D, 0x0A, 0x2D, 0xB4,                          # CRC
    0x00, 0x00, 0x00, 0x00,                          # IEND chunk length
    0x49, 0x45, 0x4E, 0x44,                          # IEND
    0xAE, 0x42, 0x60, 0x82                           # CRC
])

with open(temp_image_path, 'wb') as f:
    f.write(png_bytes)

ARGS = {
    'path': temp_image_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
list_problems_with_images Ran
ran; our contract draft was wrong, not the code
Huawei-AI4Math/PyGeoX/model_testing/PyGeoX-Wild/evaluate.py
code served (permissive licence) · get_code("04282cb4c2bc11f5")
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 2, 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 tempfile
import json
from pathlib import Path

# Create a temporary directory structure for testing
temp_dir = tempfile.TemporaryDirectory()
model_dir = Path(temp_dir.name)

# Create answer-output directory
answer_output_dir = model_dir / 'answer-output'
answer_output_dir.mkdir(parents=True, exist_ok=True)

# Create image directory
image_dir = model_dir / 'image'
image_dir.mkdir(parents=True, exist_ok=True)

# Create sample JSON files in answer-output
problem_data_1 = {
    'problem_id': '1',
    'question': 'What is 2 + 2?',
    'completion': 'The answer is 4'
}
with open(answer_output_dir / 'problem_1.json', 'w', encoding='utf-8') as f:
    json.dump(problem_data_1, f)

problem_data_2 = {
    'problem_id': '2',
    'Diagram description': 'A triangle with sides 3, 4, 5',
    'completion': 'This is a right triangle'
}
with open(answer_output_dir / 'problem_2.json', 'w', encoding='utf-8') as f:
    json.dump(problem_data_2, f)

problem_data_3_error = {
    'problem_id': '3',
    'question': 'Error problem',
    'error': 'Some error occurred'
}
with open(answer_output_dir / 'problem_3_error.json', 'w', encoding='utf-8') as f:
    json.dump(problem_data_3_error, f)

# Create placeholder image files for problems 1 and 2
(image_dir / 'problem_1.png').touch()
(image_dir / 'problem_2.png').touch()

# Create a placeholder image for problem 3 (error case)
(image_dir / 'problem_3.png').touch()

ARGS = {
    'model_dir': model_dir
}
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 2, 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
load_answer_output Ran
ran; our contract draft was wrong, not the code
Huawei-AI4Math/PyGeoX/model_testing/PyGeoX-Wild/evaluate.py
code served (permissive licence) · get_code("851d62034ffdfc5a")
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 tempfile
import json
from pathlib import Path

# Create a temporary directory structure with answer-output files
temp_dir = tempfile.TemporaryDirectory()
model_dir = Path(temp_dir.name)

# Create answer-output subdirectory
answer_output_dir = model_dir / 'answer-output'
answer_output_dir.mkdir(parents=True, exist_ok=True)

# Create sample problem JSON files
problem_1_data = {
    'question': 'What is 2 + 2?',
    'problem_id': '1',
    'completion': 'The answer is 4'
}
with open(answer_output_dir / 'problem_1.json', 'w', encoding='utf-8') as f:
    json.dump(problem_1_data, f)

# Create another problem file
problem_2_data = {
    'Diagram description': 'A triangle with sides 3, 4, 5',
    'problem_id': '2'
}
with open(answer_output_dir / 'problem_2.json', 'w', encoding='utf-8') as f:
    json.dump(problem_2_data, f)

# Create an error version of problem 1
problem_1_error_data = {
    'question': 'Error in processing',
    'problem_id': '1',
    'error': 'Invalid input'
}
with open(answer_output_dir / 'problem_1_error.json', 'w', encoding='utf-8') as f:
    json.dump(problem_1_error_data, f)

# Create a malformed JSON file (should be skipped)
with open(answer_output_dir / 'problem_3.json', 'w', encoding='utf-8') as f:
    f.write('{invalid json')

# Create a file with non-numeric problem ID (should be skipped)
with open(answer_output_dir / 'problem_abc.json', 'w', encoding='utf-8') as f:
    json.dump({'question': 'test'}, f)

# Create a non-JSON file (should be skipped)
with open(answer_output_dir / 'problem_4.txt', 'w', encoding='utf-8') as f:
    f.write('not json')

ARGS = {
    'model_dir': model_dir
}
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 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
run_python_and_get_image Ran
ran; our contract draft was wrong, not the code
Huawei-AI4Math/PyGeoX/model_testing/PyGeoX-Wild/image.py
code served (permissive licence) · get_code("41d45ff2bc66f254")
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, 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 os
import tempfile

# Create a simple Python code string that generates a plot and saves it as result.png
code = """
import matplotlib.pyplot as plt
import numpy as np

# Generate some simple data
x = np.linspace(0, 10, 100)
y = np.sin(x)

# Create a simple plot
plt.figure(figsize=(8, 6))
plt.plot(x, y)
plt.xlabel('X')
plt.ylabel('Y')
plt.title('Simple Sine Wave')
plt.grid(True)
plt.savefig('result.png')
plt.close()
"""

# Create a temporary file path for the output image
with tempfile.TemporaryDirectory() as tmpdir:
    target_image_path = os.path.join(tmpdir, 'output_result.png')
    
    ARGS = {
        'code': code,
        'target_image_path': target_image_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 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
call_chat_api Not yet run
unverified (harvested, no recorded run)
Huawei-AI4Math/PyGeoX/model_testing/PyGeoX-Wild/generate_openrouter.py
code served (permissive licence) · get_code("d002d92e74366291")
How it ran

no invocation recorded.

extract_python_code Not yet run
unverified (harvested, no recorded run)
Huawei-AI4Math/PyGeoX/model_testing/PyGeoX-Wild/generate.py
code served (permissive licence) · get_code("10b22e52ac7138d8")
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-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

Large Language Models frequently hallucinate in precision-critical domains such as technical diagramming and mechanical design, where outputs must satisfy strict geometric constraints. We study open-ended geometric synthesis from natural language: translating free-form descriptions into precise constructions whose entities must simultaneously satisfy dozens of interacting constraints. To make this tractable, we release PyGeoX, a programmable geometric DSL that compiles declarative constraints into a differentiable loss, and PyGeoX-Bench, a stratified suite of 300 problems with per-constraint verifiable rewards. Using PyGeoX as a verifier, we identify a failure mode we call Outlier Gradient Masking: under globalnorm rewards (any scheme that aggregates residuals through a single norm, for example, exp(-MSE)), a single outlier constraint can nullify the learning signal across all others. To address this, we propose Saturating Additive Rewards (SAR), which decompose the reward into bounded per-constraint terms, preserving partial progress and ensuring consistent gradients even under severe violations. Against MSE-based rewards, the natural baseline for geometry solvers, SAR improves the hard-tier solving rate by 2.3×, and the resulting 8B model is competitive with much larger frontier systems on this benchmark. We release the engine, benchmark, and data at https://github.com/Huawei-AI4Math/PyGeoX.

For agents

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

get_harvested_code_for_paper("2606.09278")
get_code_for_paper("2606.09278")
have("2606.09278")

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

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

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

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

Connect an agent — have() is free.