Astro~/0.4
** Conformance
** Astro * Conformance
** /conformance/ldc

Lossless Data Compression

PICS proforma: what this package implements, clause by clause.

Conformance Statement for pkg/ldc, CCSDS 121.0-B-3


A2.1 GENERAL INFORMATION

A2.1.1 Identification of PICS

FieldValue
Date of Statement (DD/MM/YYYY)23/08/2026
PICS Serial NumberASTRO-LDC-PICS-001
System Conformance Statement Cross-ReferenceThis document

A2.1.2 Identification of Implementation Under Test (IUT)

FieldValue
Implementation Nameastro/pkg/ldc
Implementation VersionSee go.mod / latest commit on main
Special ConfigurationNone
Other InformationGo library implementing the Rice adaptive entropy coder and its preprocessor, encoder and decoder both. Integer arithmetic throughout; no floating point appears anywhere in the package. Byte-slice in, byte-slice out, packetization is the caller's.

A2.1.3 Identification of Supplier

FieldValue
SupplierRavi Suhag
Contact Point for QueriesGitHub, github.com/ravisuhag/astro
Implementation Name(s) and Version(s)astro/pkg/ldc (Go package)
System Name(s)Astro

A2.1.4 Identification of Specification

FieldValue
SpecificationCCSDS 121.0-B-3 (Lossless Data Compression, Blue Book, Issue 3, August 2020)
Companion reportCCSDS 120.0-G-4 (Lossless Data Compression, Green Book, Issue 4, November 2021)
Have any exceptions been required?Yes [X] No [ ]

NOTE, Non-supported capabilities are identified in section A2.3. All of them are options the standard leaves to the application or defines for transport layers this package does not touch.

NOTE. This implementation is validated against the official CCSDS 121.0-B-2 test vectors published by the SLS Data Compression working group (as mirrored in libaec's data/121B2TestData). All 72 AllOptions and LowEntropyOptions vectors (36 in each set, covering resolutions 1 through 32) encode byte-identically and decode back to the exact samples; they are vendored in vectors/ldc/corpus/ and every one runs as TestVectors_* in vectors_test.go. The ExtendedParameters set is excluded for the reason given in section A2.3.


A2.2 REQUIREMENTS LIST

Table A-1: Adaptive entropy coder, parameters

ItemDescriptionReferenceStatusValues AllowedSupportNotes
LDC-1Block size J3.1.6M8, 16, 32, 64Yes
LDC-2Sample resolution n3.1.6M1 to 32 bitsYes
LDC-3Unsigned sample range3.1.6, 4.4M0 to 2^n-1Yes
LDC-4Signed sample range3.1.6, 4.4M-2^(n-1) to 2^(n-1)-1Yes
LDC-5Option identifier attached to every coded data set3.1.1, 5.2.1.3M-Yes

Table A-2: Code options

ItemDescriptionReferenceStatusSupportNotes
LDC-6Fundamental sequence option3.2MYes
LDC-7Split-sample options3.3MYes
LDC-8Split-sample field order3.3.3MYes
LDC-9Second-extension option3.4MYes
LDC-10Second-extension overflow3.4.2MYes
LDC-11Zero-block option3.5MYes
LDC-12Zero-block run codewords3.5.3, table 3-2MYes
LDC-13Zero-block spans multiple blocks3.1.4, 3.5.1MYes
LDC-14All-zeros with a reference sample3.5.1, 3.7.2MYes
LDC-15No-compression option3.6MYes

Table A-3: Code selection

ItemDescriptionReferenceStatusSupportNotes
LDC-16Select the option minimizing encoded bits, identifier included3.7.1, 3.7.3MYes
LDC-17Zero-block always selected for all-zeros runs3.7.2MYes
LDC-18Tie-breaking order3.7.4MYes

Table A-4: Preprocessor

ItemDescriptionReferenceStatusSupportNotes
LDC-19Preprocessor may be omitted4.1OYes
LDC-20Unit-delay predictor4.2.5MYes
LDC-21First sample of a reference interval predicts itself4.2.5MYes
LDC-22Bypass predictor4.2.3OYes
LDC-23Application-specific predictor4.2.4ONo
LDC-24Reference samples required only for previous-sample predictors4.2.6MYes
LDC-25Reference sample is the first of a block, uncoded, leading the CDS4.2.6, 5.2.2MYes
LDC-26Reference sample interval r4.3MYes
LDC-27Prediction error mapper4.4MYes
LDC-28Mapper is a bijection4.4MYes

Table A-5: Coded data set formats

ItemDescriptionReferenceStatusSupportNotes
LDC-29Option identification key5.2.1, table 5-1MYes
LDC-30Basic code option set5.2.1.1MYes
LDC-31Restricted code option set5.2.1.1OYes
LDC-32CDS format, FS and split-sample5.2.3MYes
LDC-33CDS format, no compression5.2.4MYes
LDC-34CDS format, zero block5.2.5MYes
LDC-35CDS format, second extension5.2.6MYes
LDC-36Bit order MSB first1.5.2MYes

Table A-6: File format

ItemDescriptionReferenceStatusSupportNotes
LDC-37File header, 12 octets7.2.2, table 7-1OYes
LDC-38Output word size B7.2.1.2OYes
LDC-39Reserved fields are zerotable 7-1MYes
LDC-40Data Sensetable 7-1MYes
LDC-41Application-specific mappertable 7-1ONo
LDC-42File body is concatenated CDSes7.2.3.1OYes
LDC-43Zero fill to the word boundary7.2.3.2OYes

Table A-7: Packet formats

ItemDescriptionReferenceStatusSupportNotes
LDC-44CDSes inserted into space packets5.3ONoOut of scope by design: this package emits coded data sets and the caller packetizes, with pkg/spp.
LDC-45Compression identification packet6ONoThe standard marks section 6 optional. The file header of section 7 covers the same need and is implemented instead.

A2.3 EXCEPTIONS AND LIMITATIONS

Non-Supported Items

ItemDescriptionReason
LDC-23Application-specific predictor
LDC-41Application-specific mapper
LDC-44Insertion into space packets
LDC-45Compression identification packet
-Reference-interval byte alignment

Interpretations

Two places where the standard's text admits more than one reading, and the reading taken here:

WhereReading taken
Signed samples and the predictor (table 7-1, Data Sense)Table 7-1 makes the positive Data Sense "mandatory if preprocessor is bypassed or preprocessor absent". Read narrowly, that constrains only a section-7 file header field; read broadly, it says signed samples are meaningful only under the unit-delay predictor. This implementation takes the broad, conservative reading and enforces it in Params.Validate everywhere, not just in the file path: Signed with any predictor other than unit delay is refused with ErrUnsupportedPredictor. The narrow reading would let signed samples through with the bypass predictor outside the file format, and would then produce parameter sets a section-7 header cannot describe. Refusing keeps every compressible stream expressible as a file.
Second-extension CDS symbol count (clause 5.2.6)The prose says "2J transformed pairs", which contradicts clause 3.4.1 and figure 5-4 (J/2 symbols). Read as a typo; J/2 is implemented. Also recorded at LDC-35.

Implementation-Defined Limits

None of these limits are in the standard. The first two exist because a decoder must not be able to be told to exhaust memory; the third is a documented limitation of the one entry point that decodes without a sample count.

LimitValueWhy
Decodable sample count2^28 samples
FS codeword lengthBounded by the resolution
Fill skipped by the unbounded Decompress7 bits

Fully Supported Mandatory Items

Every mandatory item is supported. All five code options are implemented in both directions, along with both specified predictors, the mapper, the coded data set formats, and the option selection rule including its tie-breaks.

AreaItemsImplementation
ParametersLDC-1-5params.go
Bit packingLDC-36bits.go
Code optionsLDC-6-15options.go
SelectionLDC-16-18encoder.go
PreprocessorLDC-19-28preprocessor.go
CDS formatsLDC-29-35encoder.go, decoder.go
File formatLDC-37-43file.go

Verification

SourceWhat it pins
Blue Book table 3-1Fundamental sequence codewords
Blue Book table 3-2Zero-block run codewords, including ROS
Blue Book table 5-1Every option identifier at every resolution
Blue Book table 7-1File header, field by field
Blue Book clause 3.4.1The second-extension transform
Blue Book clause 3.7.4The tie-breaking order
Green Book clause 3.3.3The preprocessor and mapper, as a worked table
Green Book figure 3-4Zero-block segmentation and ROS

Annex A of the Green Book names a fuller vector set at cwe.ccsds.org/sls/docs/sls-dc/BB121B3TestData. That location requires a CCSDS login and returned HTTP 403, so it has not been run against this implementation. Anyone with access is encouraged to.


Wire test vectors

The octets backing this statement live in the vector corpus — 107 published corpus files. Each vector names the clause it comes from and carries the derivation that produced it.

File
ldc/corpus.json107 corpus files

These are data files, so any implementation can check itself against the same octets. See CONTRACT.md for how, and how this is verified for what rests on a published vector versus a reading of the clause.