Implement the new native qr encoder - #10
Merged
Merged
Conversation
Drop the qrcodegen dependency and encode every symbol family from scratch in pure Rust (edition 2024, MSRV 1.89). - Add the encoding pipeline: an MSB-first bit buffer, the mode and segment model, a dynamic-programming segment optimizer, a runtime GF(256) Reed-Solomon generator and remainder, block interleaving, matrix placement, and mask selection (lowest penalty for Model 2, highest dark-edge score for Micro QR, the fixed mask for rMQR). - Support Model 2 versions 1-40, Micro QR versions M1-M4 and all 32 rMQR (ISO/IEC 23941) rectangular versions, with the Numeric, Alphanumeric, Byte and Kanji modes, plus ECI, FNC1 and Structured Append, and an AutoEncoder that picks the smallest family. - Replace the free-function facade with an Encoder -> Symbol -> Renderer builder API exposed through the qr, micro and rmqr modules, and render a Symbol to grayscale, SVG and PNG. - Add the EncodeError and RenderError types, the examples and the docs.
- Make the crate no_std + alloc by default; gate std-only rendering, atomic file saving and async writers behind the std feature. - Add the url feature that implements ToQRText for url::Url with case and percent-escape normalization. - Tidy the example set and rename their output files, and refine the encoder and renderer public surface. - Adjust the feature layout and CI accordingly.
- Move correctness testing into a single integration binary that round-trips every family through the quircs and rxing decoders. - Verify the ISO capacity boundaries for every version and error correction level, and reproduce the Annex reference matrices module for module. - Drop the old golden PNG/SVG fixtures.
- Rewrite the byte-mode segmentation in both the byte and text optimizers from O(n^2) to O(n) with a monotonic queue keyed by candidate cost, preserving the exact segmentation (about 8.8x faster on large text, 2.4x on large binary). - Build the rMQR Reed-Solomon generator once per symbol instead of once per block, and precompute the rMQR version order by area at compile time. - Return a clearer error when a Micro QR byte input is not representable, and document that Symbol::size reports the width for the rectangular family. - Add a bencher-based benchmark suite for encoding and rendering.
magiclen
force-pushed
the
native-qr-encoder
branch
from
July 18, 2026 16:13
20aff7d to
adcc9cd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.