SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2108.11305 · ICCV · 2021

CSG-Stump: A Learning Friendly CSG-Like Representation for Interpretable Shape Parsing

Haiyu Zhao, Shuai Yi, Mingyuan Zhang, Jiatong Li, Liang Pan, Junzhe Zhang, Zhongang Cai, Jianfei Cai, Jianmin Zheng, Haiyong Jiang, Daxuan Ren

arXiv · PDF · Open in the Atlas

Code that ran

5 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (5 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 0 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/2108.11305.json · badge: /api/ran/2108.11305.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
kimren227/CSGStumpNet marked official in Papers with Code
Papers with Code archive
5 ran · 2 no recorded run
FunctionStatusWhere it lives
CSGStump Ran
ran on a synthesized input · constructed an object; no result was computed
kimren227/CSGStumpNet/model.py
code served (permissive licence) · get_code("fda44505c84cea67")
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 an instance of its own class, CSGStump: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

# Helper functions referenced in the forward pass
def sdfCylinder(params1, params2, params3, coords):
    B, K, _ = params1.shape
    M = coords.shape[1]
    return torch.randn(B, K, M, 1)

def sdfBox(params1, params2, params3, coords):
    B, K, _ = params1.shape
    M = coords.shape[1]
    return torch.randn(B, K, M, 1)

def sdfCone(params1, params2, params3, coords):
    B, K, _ = params1.shape
    M = coords.shape[1]
    return torch.randn(B, K, M, 1)

def sdfSphere(params1, params2, params3, coords):
    B, K, _ = params1.shape
    M = coords.shape[1]
    return torch.randn(B, K, M, 1)

# Build arguments
num_primitives = 4  # cylinder, box, cone, sphere
num_intersections = 2
sharpness = 1.0

# Create sample_point_coordinates: (B, M, 3) - B=2, M=5 sample points
sample_point_coordinates = torch.randn(2, 5, 3)

# Create primitive_parameters: (B, param_dim, K)
# param_dim = 10 (box) + 8 (cylinder) + 8 (sphere) + 8 (cone) = 34
# K = num_primitives = 4
primitive_parameters = torch.randn(2, 34, 4)

# Create intersection_layer_weights: (B, K, num_intersections)
# Used in einsum 'bkc,bmk->bmkc'
intersection_layer_weights = torch.randn(2, 4, 2)

# Create union_layer_weights: (B, num_intersections)
# Used in einsum 'bc,bmc->bmc'
union_layer_weights = torch.randn(2, 2)

is_training = False

ARGS = {
    'num_primitives': num_primitives,
    'num_intersections': num_intersections,
    'sharpness': sharpness,
}
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 CSGStump — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a CSGStump 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
CSGStumpConnectionHead Ran
ran on a synthesized input · constructed an object; no result was computed
kimren227/CSGStumpNet/model.py
code served (permissive licence) · get_code("cbbabd001411575f")
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 an instance of its own class, CSGStumpConnectionHead: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

class CSGStumpConnectionHead(nn.Module):

    def __init__(self, feature_dim, num_primitives, num_intersections):
        super(CSGStumpConnectionHead, self).__init__()
        self.num_primitives = num_primitives
        self.num_intersections = num_intersections
        self.feature_dim = feature_dim
        self.intersection_linear = nn.Linear(self.feature_dim * 8, self.num_primitives * self.num_intersections, bias=True)
        self.union_linear = nn.Linear(self.feature_dim * 8, self.num_intersections, bias=True)

    def forward(self, feature, is_training):
        intersection_layer_weights = self.intersection_linear(feature)
        intersection_layer_weights = intersection_layer_weights.view(-1, self.num_primitives, self.num_intersections)
        union_layer_weights = self.union_linear(feature)
        union_layer_weights = union_layer_weights.view(-1, self.num_intersections)
        if not is_training:
            intersection_layer_weights = (intersection_layer_weights > 0).type(torch.float32)
            union_layer_weights = (union_layer_weights > 0).type(torch.float32)
        else:
            intersection_layer_weights = torch.sigmoid(intersection_layer_weights)
            union_layer_weights = torch.sigmoid(union_layer_weights)
        return (intersection_layer_weights, union_layer_weights)


ARGS = {
    "feature_dim": 4,
    "num_primitives": 3,
    "num_intersections": 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 CSGStumpConnectionHead — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a CSGStumpConnectionHead 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
CSGStumpPrimitiveHead Ran
ran on a synthesized input · constructed an object; no result was computed
kimren227/CSGStumpNet/model.py
code served (permissive licence) · get_code("6c644233fbb5f417")
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 an instance of its own class, CSGStumpPrimitiveHead: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

# The CSGStumpPrimitiveHead constructor takes two parameters:
# - feature_dim: dimension of features
# - num_primitives: number of primitives

# Looking at the forward method:
# - feature comes in and is passed to primitive_linear
# - primitive_linear expects input of shape (..., feature_dim * 8)
# - So we need a feature tensor with last dimension = feature_dim * 8

# Let's set up small, distinct dimensions
feature_dim = 4
num_primitives = 8

# Create a small feature tensor
# The module expects feature to have shape (..., feature_dim * 8)
# Let's use batch_size=2 for a small batch
batch_size = 2
feature_input = torch.randn(batch_size, feature_dim * 8)

ARGS = {
    "feature_dim": feature_dim,
    "num_primitives": num_primitives,
}
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 CSGStumpPrimitiveHead — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a CSGStumpPrimitiveHead 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
DGCNNFeat Ran
ran on a synthesized input · constructed an object; no result was computed
kimren227/CSGStumpNet/model.py
code served (permissive licence) · get_code("d22eb1842799c8eb")
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 an instance of its own class, DGCNNFeat: the run constructed the object and did not call it, so no result was computed. 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 torch
import torch.nn as nn

torch.manual_seed(0)

# The get_graph_feature function expects input x of shape (batch_size, num_dims, num_points)
# Looking at the forward method, it starts with x and calls get_graph_feature(x, k=self.k, dim9=False)
# The first conv1 expects input with 6 channels (it takes Conv2d(6, ...))
# This means after get_graph_feature, we get (batch, 6, num_points, k)
# Working backwards: get_graph_feature takes (batch, num_dims, num_points) and produces (batch, 2*num_dims, num_points, k)
# So input num_dims should be 3 (since 2*3 = 6)

batch_size = 2
num_points = 4
num_dims = 3
k = 20

# Create input tensor: (batch_size, num_dims, num_points)
# This represents point cloud data with 3 coordinates per point
x = torch.randn(batch_size, num_dims, num_points)

ARGS = {
    'k': k,
    'emb_dims': 256,
    'dropout': 0.5,
    'global_feat': True
}
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 DGCNNFeat — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a DGCNNFeat 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
Decoder Ran
ran on a synthesized input · constructed an object; no result was computed
kimren227/CSGStumpNet/model.py
code served (permissive licence) · get_code("f0490200a5bf761f")
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 an instance of its own class, Decoder: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

class Decoder(nn.Module):

    def __init__(self, feature_dim):
        super(Decoder, self).__init__()
        self.feature_dim = feature_dim
        self.linear_1 = nn.Linear(self.feature_dim, self.feature_dim * 2, bias=True)
        self.linear_2 = nn.Linear(self.feature_dim * 2, self.feature_dim * 4, bias=True)
        self.linear_3 = nn.Linear(self.feature_dim * 4, self.feature_dim * 8, bias=True)
        nn.init.xavier_uniform_(self.linear_1.weight)
        nn.init.constant_(self.linear_1.bias, 0)
        nn.init.xavier_uniform_(self.linear_2.weight)
        nn.init.constant_(self.linear_2.bias, 0)
        nn.init.xavier_uniform_(self.linear_3.weight)
        nn.init.constant_(self.linear_3.bias, 0)

    def forward(self, inputs):
        import torch.nn.functional as F
        l1 = self.linear_1(inputs)
        l1 = F.leaky_relu(l1, negative_slope=0.01, inplace=True)
        l2 = self.linear_2(l1)
        l2 = F.leaky_relu(l2, negative_slope=0.01, inplace=True)
        l3 = self.linear_3(l2)
        l3 = F.leaky_relu(l3, negative_slope=0.01, inplace=True)
        return l3

feature_dim = 4

ARGS = {
    "feature_dim": feature_dim
}
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 Decoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Decoder 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
CSGStumpNet Not yet run
unverified (harvested, no recorded run)
kimren227/CSGStumpNet/model.py
code served (permissive licence) · get_code("81c9908257f1f070")
How it ran

no invocation recorded.

get_graph_feature Not yet run
unverified (harvested, no recorded run)
kimren227/CSGStumpNet/model.py
code served (permissive licence) · get_code("9019aa1bd21a7d63")
How it ran

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, 4 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 4 later) and 3 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
get_graph_feature
brick of this paper's assembly: helper
11 other papers
3 dated earlier, 8 later · 4 only as an assembly brick
1801.07829 (2018-01)
Dynamic Graph CNN for Learning on Point Clouds
2101.07296 (2021-01)
Using Shape to Categorize: Low-Shot Learning with an Explicit Shape Bias
2103.16397 (2021-03)
3D AffordanceNet: A Benchmark for Visual Object Affordance Understanding
and 8 more not named here
CSGStumpConnectionHead
brick of this paper's assembly: model
1 other paper
1 later · 1 only as an assembly brick
2209.15632 (2022-09)
ExtrudeNet: Unsupervised Inverse Sketch-and-Extrude for Shape Parsing
DGCNNFeat
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2209.15632 (2022-09)
ExtrudeNet: Unsupervised Inverse Sketch-and-Extrude for Shape Parsing
Decoder
brick of this paper's assembly: model
1 other paper
1 later · 1 only as an assembly brick
2209.15632 (2022-09)
ExtrudeNet: Unsupervised Inverse Sketch-and-Extrude for Shape Parsing

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

Generating an interpretable and compact representation of 3D shapes from point clouds is an important and challenging problem. This paper presents CSG-Stump Net, an unsupervised end-to-end network for learning shapes from point clouds and discovering the underlying constituent modeling primitives and operations as well. At the core is a three-level structure called CSG-Stump, consisting of a complement layer at the bottom, an intersection layer in the middle, and a union layer at the top. CSG-Stump is proven to be equivalent to CSG in terms of representation, therefore inheriting the interpretable, compact and editable nature of CSG while freeing from CSG's complex tree structures. Particularly, the CSG-Stump has a simple and regular structure, allowing neural networks to give outputs of a constant dimensionality, which makes itself deep-learning friendly. Due to these characteristics of CSG-Stump, CSG-Stump Net achieves superior results compared to previous CSG-based methods and generates much more appealing shapes, as confirmed by extensive experiments.

For agents

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

get_harvested_code_for_paper("2108.11305")
get_code_for_paper("2108.11305")
have("2108.11305")

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

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

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

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

Connect an agent — have() is free.