Fix the generalized Reed-Solomon interpolation decoder - #129
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #129 +/- ##
==========================================
- Coverage 47.27% 47.25% -0.03%
==========================================
Files 44 44
Lines 14328 14335 +7
Branches 203 203
==========================================
Hits 6774 6774
- Misses 7554 7561 +7
🚀 New features to boost your workflow:
|
The interpolation step produces Q(x,y) = Q0(x) + Q1(x)*y vanishing at every (P[i],v[i]), so the message polynomial is f = -Q0/Q1. GeneralizedReedSolomonDecoder computed -Q1/Q0 instead and returned the evaluations of that unrelated rational function. It also now returns an information word. Decode passes a special decoder's result through verbatim and is documented to return an information word, so returning a codeword made Decode fail outright (the reported symptom). That in turn exposed Decodeword re-encoding via c0*C, which for a cyclic code multiplies by the generator polynomial while InformationWord inverts the generator matrix; for a GRS code that happens to be cyclic the two disagree. Fixes #12 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Member
Author
fingolfin
force-pushed
the
fix-grs-interpolation-decoder
branch
from
August 16, 2026 20:31
dd40a94 to
a1db600
Compare
This was referenced Aug 16, 2026
Collaborator
|
This will likely fix a lot of the failed tests from the .tst files pulled from the manual. Thanks! |
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.
The interpolation step produces
Q(x,y) = Q0(x) + Q1(x)*yvanishing at every(P[i],v[i]), so the message polynomial isf = -Q0/Q1.GeneralizedReedSolomonDecodercomputed-Q1/Q0instead and returned the evaluations of that unrelated rational function.It also now returns an information word.
Decodepasses a special decoder's result through verbatim and is documented to return an information word, so returning a codeword madeDecodefail outright (the reported symptom). That in turn exposedDecodewordre-encoding viac0*C, which for a cyclic code multiplies by the generator polynomial while InformationWord inverts the generator matrix; for a GRS code that happens to be cyclic the two disagree.That second part is the last outstanding item of #126:
GeneralizedReedSolomonDecoderwas the only special decoder still returning a codeword rather than an information word. Checking both halves of the contract (Decodereturns the information vector,Decodewordthe nearest codeword) on words carrying errors, for every decoder that is actually installed viaSetSpecialDecoder:HammingDecoder(GF(2), GF(3))BCHDecoder(RS/GF(11), BCH/GF(2), BCH/GF(3))CyclicDecoder(binary cyclic [7,4,3])GeneralizedReedSolomonDecoder(GF(11), GF(5))Hamming, BCH and cyclic were already put right by fc0434c, 6547003 and 94a9c9d.
Fixes #12
Fixes #126
Co-Authored-By: Claude Opus 5 noreply@anthropic.com