Skip to content

ldpc: Add version 2.4.1 - #4770

Merged
luhenry merged 7 commits into
mainfrom
ldpc
Nov 10, 2026
Merged

luhenry merged 7 commits into
mainfrom
ldpc

Conversation

@luhenry

@luhenry luhenry commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Compiles 8 Cython/C++20 extension modules (BP, BP+OSD, BP+LSD, belief-find and union-find decoders) against a vendored tessil/robin-map header-only map. Upstream publishes no riscv64 wheel.

Mirrors the Linux leg of upstream's build.yml; adds a test step upstream's own CI omits.

Differs from upstream

  • Builds from the release commit, not the sdist - upstream pushes no git tag, and the sdist's MANIFEST.in never grafts include/robin_map, which two headers #include.

Matrix: cp312-cp314 only - stim and pymatching, both hard runtime dependencies, have no riscv64 wheel on the registry below cp312.

Testing

  • Runs upstream's own python_test/ against the installed wheel (no test job exists upstream).
  • Deselects two test_soft_info_decoder.py cases that fail identically on a plain x86_64 build - a pre-existing upstream bug, not riscv64-specific.

License: Wheel compiles against vendored tessil/robin-map (MIT), whose licence is embedded only in header comments and reaches no ldpc wheel on any architecture; the build adds it.

Patches

  • 0001-Package-the-vendored-robin-map-licence.patch - To upstream [not yet submitted; the same gap exists in every ldpc wheel on PyPI regardless of architecture]. Without it the wheel carries no licence text for robin-map. Not riscv64-specific.

Validated locally on cp313 x86_64 (same checkout, same test command): 126 passed, 2 deselected.

luhenry added a commit that referenced this pull request Nov 9, 2026
sinter (an ldpc install_requires) pulls in matplotlib, which hard-depends
on pillow; pillow has no riscv64 wheel on PyPI newer than our registry's
and its sdist build fails outright for lack of libjpeg headers in the
manylinux image. Pin matplotlib/contourpy/kiwisolver/pillow to our
registry's wheels for the cibuildwheel test install, mirroring the same
fix already applied in build-lightgbm.yml and build-wordcloud.yml.
bp_decoder's Cython extension compiles and packages into the wheel fine
(confirmed from the full build log: _bp_decoder.cpython-313-riscv64-linux-gnu.so
is built and added, same as union_find_decoder's). The CI failure is purely in
our own CIBW_TEST_COMMAND sanity check.

ldpc/__init__.py's "Legacy syntax" section does
`from ldpc.bp_decoder import bp_decoder`, which rebinds the `ldpc` package's
own `bp_decoder` attribute (set by the import machinery to the submodule
object) to the legacy `bp_decoder` callable that
ldpc/bp_decoder/__init__.py also exports under that same name. After
`import ldpc` runs, `ldpc.bp_decoder` is that callable, not the submodule, so
a later `ldpc.bp_decoder._bp_decoder` attribute access raises
"ImportError: cannot import name '_bp_decoder' from 'bp_decoder' (unknown
location)" on any install, on any architecture -- reproduced locally with a
minimal stand-in package. union_find_decoder has no such legacy-name
collision, which is why it alone appeared to "work" in the same test command.

Resolve the compiled submodule by name with importlib.import_module instead,
which looks it up in sys.modules directly and is unaffected by the shadowed
attribute.
build-ldpc.yml's setup job excludes cp39/cp310/cp311 from the build
matrix (stim and pymatching, both hard runtime dependencies, ship no
riscv64 wheel below cp312), but docs/packages/ldpc.yaml still listed
3.10:manylinux and 3.11:manylinux as files the release must contain.
That made ci_scripts/update_doc.py's release-completeness check fail
on every run with "release is incomplete; no wheel was built for:
3.10:manylinux, 3.11:manylinux", since those targets can never be
built. Match the files list to the matrix actually built, same as
cyhunspell's docs/packages/cyhunspell.yaml does for its own exclusions.
_publish-wheel.yml now requires a matrix input (main's "publish:
Validate effective wheel targets"), but this PR branch forked before
that landed and ldpc has never been merged to main, so build-ldpc.yml
never picked up the matching one-line update every already-published
package's workflow got. The merge ref combines the new required-input
_publish-wheel.yml with this branch's old build-ldpc.yml, so every run
has failed startup with "Input matrix is required, but not provided".

Pass it the same way the mass-update commit did for every other
package's publish job.
@luhenry
luhenry merged commit 4689f1a into main Nov 10, 2026
8 checks passed
@luhenry
luhenry deleted the ldpc branch November 10, 2026 02:06
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