Skip to content

modules/zstd: add BlockDecoder #1214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 26 commits into from

Conversation

lpawelcz
Copy link
Contributor

@lpawelcz lpawelcz commented Nov 30, 2023

This PR adds:

  • Block Header parsing functions
  • DecoderMux Proc, which collects data from specialized Raw, RLE, and Compressed Block decoders and re-sends them in the correct order
  • DecoderDemux Proc, which is responsible for parsing Block Header and sending the obtained data to the Raw, RLE or Compressed Block decoders
  • BlockDecoder Proc, which aggregates the created Decoders together with Muxer and Demuxer. The block is responsible for decoding complete ZSTD Blocks. Currently, it supports RAW and RLE Block types.

NOTE: this is based on #1213 , please ignore commits from that branch when reviewing.

This is part of #1211

CC @proppy

@lpawelcz lpawelcz force-pushed the 51873-block-decoder-top branch 2 times, most recently from 51e9672 to 141e325 Compare December 12, 2023 13:02
@lpawelcz lpawelcz force-pushed the 51873-block-decoder-top branch 4 times, most recently from 9c99c3d to 611162a Compare December 19, 2023 11:39
@lpawelcz lpawelcz force-pushed the 51873-block-decoder-top branch 2 times, most recently from be431b3 to 5291294 Compare December 27, 2023 15:49
@lpawelcz lpawelcz force-pushed the 51873-block-decoder-top branch 2 times, most recently from b0f7013 to 82d430e Compare January 4, 2024 14:28
@lpawelcz lpawelcz force-pushed the 51873-block-decoder-top branch 3 times, most recently from 8ef2e9c to 3b1da80 Compare January 15, 2024 14:54
@lpawelcz lpawelcz force-pushed the 51873-block-decoder-top branch from 3b1da80 to 07ecf8f Compare February 15, 2024 11:45
rw1nkler and others added 13 commits February 21, 2024 14:57
This commit adds a DSLX Buffer library that provides the Buffer struct,
and helper functions that can be used to operate on it. The Buffer
is meant to be a storage for data coming from the channel. It acts like
a FIFO, allowing data of any length to be put in or popped out of it.
Provided DSLX tests verify the correct behaviour of the library.

Internal-tag: [#50221]
Signed-off-by: Robert Winkler <[email protected]>
This commit adds a simple test that shows, how one can use the Buffer
struct inside a Proc.

Internal-tag: [#50221]
Signed-off-by: Robert Winkler <[email protected]>
This commit adds the library with functions for parsing a magic number and
tests that verify its correctness.

Internal-tag: [#50221]
Signed-off-by: Robert Winkler <[email protected]>
This commit adds the library with functions for parsing a frame header.
The provided tests verify the correcness of the library.

Internal-tag: [#49967]
Co-authored-by: Roman Dobrodii <[email protected]>
Co-authored-by: Pawel Czarnecki <[email protected]>
Signed-off-by: Robert Winkler <[email protected]>
Signed-off-by: Pawel Czarnecki <[email protected]>
Internal-tag: [#53329]
Signed-off-by: Pawel Czarnecki <[email protected]>
Required for expected_status inference in C++ tests for ZSTD decoder
components

Internal-tag: [#53465]
Signed-off-by: Pawel Czarnecki <[email protected]>
Internal-tag: [#50967]
Signed-off-by: Robert Winkler <[email protected]>
This commit adds a binary that calls decoding to generate data and loads
it into a vector of bytes.

Internal-tag: [#50967]
Signed-off-by: Robert Winkler <[email protected]>
Internal-tag: [#50967]
Co-authored-by: Pawel Czarnecki <[email protected]>
Signed-off-by: Robert Winkler <[email protected]>
Signed-off-by: Pawel Czarnecki <[email protected]>
Internal-tag: [#51343]
Signed-off-by: Robert Winkler <[email protected]>
Internal-tag: [#51343]
Signed-off-by: Robert Winkler <[email protected]>
Internal-tag: [#53329]
Signed-off-by: Pawel Czarnecki <[email protected]>
lpawelcz and others added 13 commits February 21, 2024 14:57
Adds RleBlockDecoder responsible for decoding Blocks
of RLE_Block Block_Type as specified in RFC 8878, paragraph 3.1.1.2.2.
https://datatracker.ietf.org/doc/html/rfc8878#section-3.1.1.2.2

RleBlockDecoder communicates through BlockDataPacket channels.
It reuses existing RunLengthDecoder block which is interfaced through
two seprate procs:

 * RleDataPacker
 * BatchPacker

Which are responsible for converting input data into format accepted by
RLE decoder and for gathering RLE decoder output symbols into batches
which are then send out through BlockDataPacket.

Internal-tag: [#51473]
Signed-off-by: Pawel Czarnecki <[email protected]>
Internal-tag: [#53329]
Signed-off-by: Pawel Czarnecki <[email protected]>
Internal-tag: [#51343]
Signed-off-by: Robert Winkler <[email protected]>
This commit adds DecoderMux Proc, which collects data from specialized
Raw, RLE, and Compressed Block decoders and re-sends them in the correct order.

Internal-tag: [#51343]
Signed-off-by: Robert Winkler <[email protected]>
Internal-tag: [#53329]
Signed-off-by: Pawel Czarnecki <[email protected]>
This DSLX proc responsibility is to dispatch encoded blocks to a correct
decoder: RAW, RLE, COMPRESSED.

It tracks and assigns block IDs.
The ID counter is reset on the frame's last block on the last data packet.

Internal-tag: [#51736]
Co-authored-by: Robert Winkler <[email protected]>
Signed-off-by: Maciej Dudek <[email protected]>
Internal-tag: [#53329]
Signed-off-by: Pawel Czarnecki <[email protected]>
Internal-tag: [#53329]
Signed-off-by: Pawel Czarnecki <[email protected]>
This adds a decoder of block data. It decodes block header and
demuxes remaining input data into one of specific block decoders
depending on the type of the parsed block. Then it muxes outputs
from those decoders into single output channel.

Internal-tag: [#51873]
Signed-off-by: Pawel Czarnecki <[email protected]>
Internal-tag: [#53329]
Signed-off-by: Pawel Czarnecki <[email protected]>
Internal-tag: [#53329]
Signed-off-by: Pawel Czarnecki <[email protected]>
@lpawelcz lpawelcz force-pushed the 51873-block-decoder-top branch from 07ecf8f to caf2b7c Compare February 21, 2024 14:07
lpawelcz pushed a commit to antmicro/xls that referenced this pull request Feb 21, 2024
google#1214

modules/zstd: Add block header parsing library

Internal-tag: [#51343]
Signed-off-by: Robert Winkler <[email protected]>

modules/zstd: Add SequenceExecutorPacket to common definitions

Signed-off-by: Pawel Czarnecki <[email protected]>

modules/zstd: Add block data muxer library

This commit adds DecoderMux Proc, which collects data from specialized
Raw, RLE, and Compressed Block decoders and re-sends them in the correct order.

Internal-tag: [#51343]
Signed-off-by: Robert Winkler <[email protected]>

modules/zstd/dec_mux: Add benchmarking rules

Internal-tag: [#53329]
Signed-off-by: Pawel Czarnecki <[email protected]>

modules/zstd: Add block demuxer library

This DSLX proc responsibility is to dispatch encoded blocks to a correct
decoder: RAW, RLE, COMPRESSED.

It tracks and assigns block IDs.
The ID counter is reset on the frame's last block on the last data packet.

Internal-tag: [#51736]
Co-authored-by: Robert Winkler <[email protected]>
Signed-off-by: Maciej Dudek <[email protected]>

modules/zstd/dec_demux: Specify fifo depths for internal channels

Internal-tag: [#53329]
Signed-off-by: Pawel Czarnecki <[email protected]>

modules/zstd/dec_demux: Add benchmarking rules

Internal-tag: [#53329]
Signed-off-by: Pawel Czarnecki <[email protected]>

modules/zstd: Add block decoder module

This adds a decoder of block data. It decodes block header and
demuxes remaining input data into one of specific block decoders
depending on the type of the parsed block. Then it muxes outputs
from those decoders into single output channel.

Internal-tag: [#51873]
Signed-off-by: Pawel Czarnecki <[email protected]>

modules/zstd/block_dec: Specify fifo depths for internal channels

Internal-tag: [#53329]
Signed-off-by: Pawel Czarnecki <[email protected]>

modules/zstd/block_dec: Add benchmarking rules

Internal-tag: [#53329]
Signed-off-by: Pawel Czarnecki <[email protected]>
@proppy proppy self-assigned this Feb 22, 2024
lpawelcz pushed a commit to antmicro/xls that referenced this pull request Mar 7, 2024
google#1214

modules/zstd: Add block header parsing library

Internal-tag: [#51343]
Signed-off-by: Robert Winkler <[email protected]>

modules/zstd: Add SequenceExecutorPacket to common definitions

Signed-off-by: Pawel Czarnecki <[email protected]>

modules/zstd: Add block data muxer library

This commit adds DecoderMux Proc, which collects data from specialized
Raw, RLE, and Compressed Block decoders and re-sends them in the correct order.

Internal-tag: [#51343]
Signed-off-by: Robert Winkler <[email protected]>

modules/zstd/dec_mux: Add benchmarking rules

Internal-tag: [#53329]
Signed-off-by: Pawel Czarnecki <[email protected]>

modules/zstd: Add block demuxer library

This DSLX proc responsibility is to dispatch encoded blocks to a correct
decoder: RAW, RLE, COMPRESSED.

It tracks and assigns block IDs.
The ID counter is reset on the frame's last block on the last data packet.

Internal-tag: [#51736]
Co-authored-by: Robert Winkler <[email protected]>
Signed-off-by: Maciej Dudek <[email protected]>

modules/zstd/dec_demux: Specify fifo depths for internal channels

Internal-tag: [#53329]
Signed-off-by: Pawel Czarnecki <[email protected]>

modules/zstd/dec_demux: Add benchmarking rules

Internal-tag: [#53329]
Signed-off-by: Pawel Czarnecki <[email protected]>

modules/zstd: Add block decoder module

This adds a decoder of block data. It decodes block header and
demuxes remaining input data into one of specific block decoders
depending on the type of the parsed block. Then it muxes outputs
from those decoders into single output channel.

Internal-tag: [#51873]
Signed-off-by: Pawel Czarnecki <[email protected]>

modules/zstd/block_dec: Specify fifo depths for internal channels

Internal-tag: [#53329]
Signed-off-by: Pawel Czarnecki <[email protected]>

modules/zstd/block_dec: Add benchmarking rules

Internal-tag: [#53329]
Signed-off-by: Pawel Czarnecki <[email protected]>
@cdleary cdleary added the app Application level functionality (examples, uses of XLS stack) label Mar 27, 2024
@proppy
Copy link
Member

proppy commented Mar 29, 2024

should we close this and focus on reviewing #1315 ?

@lpawelcz
Copy link
Contributor Author

Closing. The review will take place in #1315

@lpawelcz lpawelcz closed this Mar 29, 2024
@tmichalak tmichalak deleted the 51873-block-decoder-top branch April 29, 2025 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app Application level functionality (examples, uses of XLS stack)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants