SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2608.25598 · 2026

M-Fibration Theory with Applications to Neural Network Compression

Paolo Boldi

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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 4 no recorded run), measured 2026-11-24; 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/2608.25598.json · badge: /api/ran/2608.25598.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
boldip/mfib canonical (classifier label)
classifier basis: census
7 ran · 4 no recorded run
FunctionStatusWhere it lives
abs_diff Ran
ran, honoured the contract we drafted
boldip/mfib/mfib/approx.py
code served (permissive licence) · get_code("18c0d124dc92ea7e")
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 float, 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
import numpy as np

torch.manual_seed(0)

# The function abs_diff takes two arguments u and v and returns the absolute difference
# It performs a simple arithmetic operation: abs(u - v)
# The arguments can be numbers, arrays, or tensors that support subtraction

u = 5.0
v = 3.2

ARGS = {
    "u": u,
    "v": v
}
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 float, 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
additive Ran
ran; our contract draft was wrong, not the code
boldip/mfib/mfib/monoid.py
code served (permissive licence) · get_code("66b5010df818b46d")
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 Monoid. 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 operator
from dataclasses import dataclass, field
from typing import Any, Callable, Hashable, Iterable

@dataclass(frozen=True)
class Monoid:
    zero: Any
    add: Callable[[Any, Any], Any]
    key: Callable[[Any], Hashable] = field(default=lambda a: a)
    name: str = ''

    def sum(self, xs: Iterable[Any]) -> Any:
        acc = self.zero
        for x in xs:
            acc = self.add(acc, x)
        return acc

    def eq(self, a: Any, b: Any) -> bool:
        return self.key(a) == self.key(b)

    def is_zero(self, a: Any) -> bool:
        return self.key(a) == self.key(self.zero)

    def __repr__(self) -> str:
        return f"Monoid({self.name or 'anonymous'})"

def additive(ndigits: int | None=9) -> Monoid:
    """(numbers, +, 0). ``ndigits=None`` means exact comparison (use for ints,
    Fractions, sympy expressions); otherwise sums are compared after rounding
    to ``ndigits`` decimals, so ``0.1 + 0.2`` and ``0.3`` coincide."""
    if ndigits is None:
        return Monoid(0, operator.add, name='(numbers,+,0) exact')
    return Monoid(0, operator.add, key=lambda a: round(a, ndigits), name=f'(numbers,+,0) rounded to {ndigits} digits')


# Setup code: test cases for additive function
ARGS = {
    'ndigits': 9
}
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 Monoid — a Monoid output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Monoid 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
circular_metric Ran
ran; our contract draft was wrong, not the code
boldip/mfib/mfib/approx.py
code served (permissive licence) · get_code("8a70712fd5d01f5a")
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 function. 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

# The circular_metric function takes one parameter: k (an integer)
# It returns a distance function d(a, b) that computes the Lee metric on Z_k
# The function uses k in modulo arithmetic operations
# No complex objects needed - just a simple integer

ARGS = {
    "k": 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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
cyclic Ran
ran; our contract draft was wrong, not the code
boldip/mfib/mfib/monoid.py
code served (permissive licence) · get_code("ee3469093e905286")
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 Monoid. 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
from dataclasses import dataclass, field
from typing import Any, Callable, Hashable, Iterable

torch.manual_seed(0)

ARGS = {
    "k": 5
}
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 Monoid — a Monoid output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Monoid 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
l1 Ran
ran, honoured the contract we drafted
boldip/mfib/mfib/approx.py
code served (permissive licence) · get_code("a98126d1848b64fd")
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 float, 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 numpy as np
import torch

# Simple scalar test
u_scalar = 5.0
v_scalar = 3.0

# Numpy array test
u_array = np.array([1.0, 2.0, 3.0, 4.0])
v_array = np.array([1.5, 2.5, 3.5, 4.5])

# Test with 0 broadcast
u_broadcast = 0
v_broadcast = np.array([1.0, 2.0, 3.0])

# Test with lists (will be converted to arrays)
u_list = [1.0, 2.0]
v_list = [3.0, 4.0]

ARGS = {
    "u": u_scalar,
    "v": v_scalar
}
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 float, 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
layer_scales Ran
ran; our contract draft was wrong, not the code
boldip/mfib/mfibnn/netgraph.py
code served (permissive licence) · get_code("47dd099bdc4df0f5")
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
import networkx as nx

# Create a simple directed graph G with edges that have 'weight' attributes
G = nx.DiGraph()

# Add nodes for 3 layers
# Layer 0: input node
G.add_node('input')
# Layer 1: nodes that receive from layer 0
G.add_node('h1_0')
G.add_node('h1_1')
# Layer 2: nodes that receive from layer 1
G.add_node('h2_0')
G.add_node('h2_1')

# Add edges with weight data
# Layer 1 receives from layer 0
G.add_edge('input', 'h1_0', weight=np.array([0.5, 0.2, 0.1, 0.3]))
G.add_edge('input', 'h1_1', weight=np.array([0.1, 0.4, 0.2, 0.1]))

# Layer 2 receives from layer 1
G.add_edge('h1_0', 'h2_0', weight=np.array([0.3, 0.5]))
G.add_edge('h1_0', 'h2_1', weight=np.array([0.2, 0.1]))
G.add_edge('h1_1', 'h2_0', weight=np.array([0.4, 0.3]))
G.add_edge('h1_1', 'h2_1', weight=np.array([0.6, 0.2]))

# Create meta dict with layer names
meta = {
    'names': {
        0: ['input'],
        1: ['h1_0', 'h1_1'],
        2: ['h2_0', 'h2_1']
    }
}

ARGS = {
    'G': G,
    'meta': meta,
    'weight': 'weight',
    'sample': 400,
    'seed': 0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx, 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 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
resolve Ran
ran; our contract draft was wrong, not the code
boldip/mfib/mfib/monoid.py
code served (permissive licence) · get_code("6d0368263b2d3c01")
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 Monoid. 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 operator
from dataclasses import dataclass, field
from typing import Any, Callable, Hashable, Iterable

@dataclass(frozen=True)
class Monoid:
    zero: Any
    add: Callable[[Any, Any], Any]
    key: Callable[[Any], Hashable] = field(default=lambda a: a)
    name: str = ''

    def sum(self, xs: Iterable[Any]) -> Any:
        acc = self.zero
        for x in xs:
            acc = self.add(acc, x)
        return acc

    def eq(self, a: Any, b: Any) -> bool:
        return self.key(a) == self.key(b)

    def is_zero(self, a: Any) -> bool:
        return self.key(a) == self.key(self.zero)

    def __repr__(self) -> str:
        return f"Monoid({self.name or 'anonymous'})"

def additive(ndigits: int | None=9) -> Monoid:
    if ndigits is None:
        return Monoid(0, operator.add, name='(numbers,+,0) exact')
    return Monoid(0, operator.add, key=lambda a: round(a, ndigits), name=f'(numbers,+,0) rounded to {ndigits} digits')

ADDITIVE = additive(9)
NAT = additive(None)
MAX = Monoid(0, max, name='(numbers>=0,max,0)')
MIN = Monoid(float('inf'), min, name='(R∪{+inf},min,+inf)')
BOOL = Monoid(False, lambda a, b: bool(a) or bool(b), key=bool, name='({0,1},or,0)')

def _vec_key(a, ndigits=9):
    import numpy as np
    if np.ndim(a) == 0:
        return round(float(a), ndigits)
    return np.round(np.asarray(a, dtype=float), ndigits).tobytes()

VECTOR = Monoid(0, lambda a, b: a + b, key=_vec_key, name='(R^k,+,0) arrays, rounded')
FREE = Monoid((), lambda a, b: tuple(sorted(a + b)), key=lambda a: tuple(sorted(a)), name='free commutative monoid (multisets)')

_BY_NAME = {'n': NAT, 'nat': NAT, 'exact': NAT, 'additive': ADDITIVE, 'r': ADDITIVE, 'real': ADDITIVE, 'sum': ADDITIVE, 'max': MAX, 'min': MIN, 'bool': BOOL, 'or': BOOL, 'free': FREE, 'multiset': FREE, 'vector': VECTOR, 'vec': VECTOR, 'kernel': VECTOR}

def resolve(spec: Monoid | str | None) -> Monoid:
    if spec is None:
        return ADDITIVE
    if isinstance(spec, Monoid):
        return spec
    if isinstance(spec, str):
        try:
            return _BY_NAME[spec.strip().lower()]
        except KeyError:
            raise ValueError(f'unknown monoid name {spec!r}; known: {sorted(_BY_NAME)}') from None
    raise TypeError(f'cannot interpret {spec!r} as a monoid')

ARGS = {
    'spec': 'additive'
}
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 Monoid — a Monoid output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Monoid 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
chain_to_graph Not yet run
unverified (harvested, no recorded run)
boldip/mfib/mfibnn/netgraph.py
code served (permissive licence) · get_code("d7a449e237eb5c6c")
How it ran

no invocation recorded.

graph_to_chain Not yet run
unverified (harvested, no recorded run)
boldip/mfib/mfibnn/netgraph.py
code served (permissive licence) · get_code("ad576d67c1ea0da5")
How it ran

no invocation recorded.

in_weights Not yet run
unverified (harvested, no recorded run)
boldip/mfib/mfib/core.py
code served (permissive licence) · get_code("54c4b5bd261d011a")
How it ran

no invocation recorded.

is_equitable Not yet run
unverified (harvested, no recorded run)
boldip/mfib/mfib/core.py
code served (permissive licence) · get_code("0228f6d79345ac18")
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, 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 11 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-24.

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 purpose of this paper is to provide a general, comprehensive, theoretical framework that allows one to deal with fibrations on graphs labelled on a commutative monoid. This is a genuine extension of the theory of graph fibrations (as introduced in [1]), that makes it possible to deal with weighted graphs, and also graphs labelled with other algebraic structures. The derived theory also lends itself naturally to consider approximate fibrations. As an example, we show how this framework can be applied to the compression of arbitrary neural networks (including CNNs), providing a strong theoretical underpinning to the recent results in [2].

For agents

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

get_harvested_code_for_paper("2608.25598")
get_code_for_paper("2608.25598")
have("2608.25598")

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

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

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

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

Connect an agent — have() is free.