Skip to content

Update mrbind: table-driven Python bindings registration - #6574

Open
Fedr wants to merge 3 commits into
masterfrom
bindings-py-tables
Open

Update mrbind: table-driven Python bindings registration#6574
Fedr wants to merge 3 commits into
masterfrom
bindings-py-tables

Conversation

@Fedr

@Fedr Fedr commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Bumps the thirdparty/mrbind gitlink to pick up mrbind#44, which registers bound methods, fields and enum elements from constexpr data tables instead of one straight-line chain of template instantiations per entity. That long tail of near-duplicate instantiations is what dominates the size of mrmeshpy.

This replaces #6544, which was based on the withdrawn mrbind#42. That version replicated pybind11 internals; this one reimplements nothing from pybind11 and needs no change to our pybind11 fork.

Wheel A/B

Same MeshLib commit (4e5f11f), publish=dry, macOS and Windows disabled. Baseline run 31465130784, this branch 31465420437. Both fully green, including all 14 manylinux-pip-test legs (Python 3.8-3.14 x both arches).

x86_64 master this branch delta
mrmeshpy.so compressed (in wheel) 16,973,091 13,241,499 -22.0%
mrmeshpy.so .text 30.55 MB 23.14 MB -24.2%
mrmeshpy.so unpacked 56,797,097 51,311,249 -9.7%
meshlib-core wheel 55,768,483 52,021,381 -6.7%
aarch64 master this branch delta
mrmeshpy.so compressed (in wheel) 15,203,113 12,461,448 -18.0%
mrmeshpy.so .text 18.11 MB 14.55 MB -19.7%
mrmeshpy.so unpacked 41,932,721 40,100,513 -4.4%
meshlib-core wheel 52,360,860 49,605,999 -5.3%

mrmeshpy.pyi is byte-identical on both arches (107,927 / 107,924 lines), so nothing about the generated API changes. mrcudapy.so shrinks too (-6.0% / -5.1% compressed) since it's generated as well, and mrmeshnumpy.so is unchanged to the byte, as expected for hand-written bindings.

The only .pyi difference anywhere is one import line at a different position in mrcudapy.pyi. That's the known pre-existing registration-order nondeterminism (type_entries is pointer-hash ordered, so two builds of pure master differ the same way), not something this bump introduces.

The "Generate and build MRBind bindings" step also got a bit faster: 17m36s -> 15m35s on x86_64, 11m11s -> 10m14s on aarch64.

Re-point the gitlink at the squashed mrbind master commit before merging, and squash the fixup commits on this branch.

Picks up the mrbind change that registers bound methods, fields and enum
elements from constexpr data tables instead of per-entity template
instantiation chains, which shrinks mrmeshpy substantially.
Fedr added 2 commits August 11, 2026 09:26
The previous commit pointed at a commit that does not exist.
Static member functions no longer carry the class type into the registrar
shape, so they can share registrars with equally-shaped free functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant