Repository navigation
test: Reed-Solomon cannot see that the derandomiser was skipped - #4
Merged
Merged
Conversation
The pipeline is sync, derandomise, Reed-Solomon, and the ordering has been wrong in this repository's own prose once already. The reason it matters is not obvious and is now a test rather than a sentence. RS(255,223) is linear over GF(2^8), so the sum of two codewords is a codeword, and over GF(2) that sum is XOR. The 255-octet randomiser sequence of CCSDS 131.0-B-5 10.4 is itself a codeword. A randomised frame is therefore `codeword XOR sequence` — a codeword, exactly, with zero syndromes. So a block that has not been derandomised decodes clean, reports zero corrections, and disagrees with the frame it came from in all 255 of its 255 symbols. The error-correcting code is blind to the one mistake somebody reordering this pipeline would make. The test asserts all three: the sequence decodes as a codeword, arbitrary bytes of the same length do not, and a randomised real frame comes back Ok(0) and wrong everywhere.
E=16 and E=32 take consecutive roots from the same generator, so RS(255,223) is a subcode of RS(255,239) and the trap holds for both. Asserted rather than reasoned about, and the frame length now comes from the code instead of being 223 twice.
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 pipeline is
synchronise → derandomise → Reed-Solomon, and this repository's ownARCHITECTURE.md had that order backwards once already. Why it matters is not obvious, so it
is a test now instead of a sentence.
RS(255,223) is linear over GF(2⁸): the sum of two codewords is a codeword, and over GF(2) that
sum is XOR. The 255-octet randomiser sequence of CCSDS 131.0-B-5 §10.4 turns out to be a
codeword itself. A randomised frame is therefore
codeword XOR sequence— which is acodeword, exactly, with zero syndromes.
So a block nobody derandomised decodes clean:
The error-correcting code is blind to the one mistake somebody reordering this pipeline would
make. There is no diagnostic to add; the order is the whole defence.
The test asserts all three legs: the sequence decodes as a codeword, arbitrary bytes of the
same length do not (so the first leg is not vacuous), and a real encoded frame that was
randomised comes back
Ok(0)and wrong in every symbol.532 tests, fmt and clippy clean.