8000 modules/zstd: Add literals decoding by rw1nkler · Pull Request #1430 · google/xls · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

modules/zstd: Add literals decoding #1430

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 49 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
bccd3d3
modules/zstd: Add buffer library
rw1nkler Oct 24, 2023
04bf3e8
modules/zstd: Add Buffer use-case example
rw1nkler Oct 31, 2023
a43fa9c
modules/zstd: Add library for parsing magic number
rw1nkler Oct 24, 2023
d3048bf
modules/zstd: Add library for parsing frame header
rw1nkler Oct 24, 2023
86de6a7
dependency_support/libzstd: Make zstd_errors.h public
lpawelcz Jan 10, 2024
3208de7
dependency_support: Add decodecorpus binary
rw1nkler Nov 9, 2023
9375be5
modules/zstd: Add data generator library
rw1nkler Nov 14, 2023
c65b32c
modules/zstd: Add zstd frame header tests
rw1nkler Nov 7, 2023
236d96e
modules/zstd: Add common zstd definitions
rw1nkler Nov 22, 2023
4fecaca
modules/zstd: Add raw block decoder
rw1nkler Nov 22, 2023
6f2d89b
modules/zstd: Add rle block decoder
lpawelcz Nov 20, 2023
4bd9c40
modules/zstd: Add block header parsing library
rw1nkler Nov 14, 2023
3de695e
modules/zstd: Add SequenceExecutorPacket to common definitions
lpawelcz Jan 4, 2024
1c525a6
modules/zstd: Add block data muxer library
rw1nkler Nov 22, 2023
27573e2
modules/zstd: Add block demuxer library
mtdudek Nov 27, 2023
323214e
modules/zstd: Add block decoder module
lpawelcz Nov 28, 2023
4f19952
modules/zstd/common: Specify decoder output format
lpawelcz Jan 2, 2024
410d78c
examples/ram: Export internal RAM API to other modules
rw1nkler Jan 12, 2024
0b613d2
modules/zstd: Add Offset type to common zstd definitions
rw1nkler Feb 8, 2024
0ca18c4
modules/zstd: Add RamPrinter Proc
rw1nkler Feb 8, 2024
02fc78c
modules/zstd: Add SequenceExecutor Proc
rw1nkler Feb 8, 2024
43a637d
modules/zstd: Add repacketizer
lpawelcz Jan 2, 2024
96b6efd
modules/zstd: Add ZSTD decoder
rw1nkler Oct 24, 2023
4c3b07c
modules/zstd: Add ZSTD Decoder documentation
lpawelcz Feb 29, 2024
57afc0f
examples/ram: use assert!() instead of assert_eq() in RamModel
lpawelcz Apr 24, 2024
ab5fb05
CI: Add custom ZSTD module workflow
lpawelcz Jun 6, 2024
495353d
[FIXUP] Update copyrights notice and add missing license header
lpawelcz Jul 2, 2024
593e40c
[FIXUP] Update README
lpawelcz Jul 2, 2024
dc6cb3c
[FIXUP] Add manual tags to test rules
lpawelcz Jul 2, 2024
d7463ba
[FIXUP] restore original main CI workflow
lpawelcz Jul 2, 2024
b46ee8c
[FIXUP] Explicitly run test targets in ZSTD CI workflow
lpawelcz Jul 2, 2024
9ddd7ce
[FIXUP] document the usage of libzstd dependency
lpawelcz Jul 2, 2024
9483420
[FIXUP] return reference to the data vector
lpawelcz Jul 2, 2024
a16c27a
[FIXUP] fix RLE block handling in decodecorpus
lpawelcz Jul 2, 2024
8c350b5
[FIXUP] fix generating data when we don't force the block type
lpawelcz Jul 2, 2024
5c5011c
modules/zstd/frame_header_test: Reproduce bugs
lpawelcz Jul 2, 2024
cc33b0b
[FIXUP] return expect empty buffer on the unsupported windows size error
lpawelcz Jul 3, 2024
2aef289
[FIXUP] Handle special case of difference between libzstd and ZSTD de…
lpawelcz Jul 3, 2024
14fe3f0
[FIXUP] Add DSLX test case for unsupported FCS
lpawelcz Jul 3, 2024
e3804ff
[FIXUP] fix max_window_size calculation types
lpawelcz Jul 3, 2024
cdeff69
[FIXUP] dependencies cleanup
lpawelcz Jul 17, 2024
210e322
[FIXUP] shorten test case names in frame_header tests
lpawelcz Jul 17, 2024
ba7eda4
[FIXUP] Update to zstd-top
mtdudek Jul 19, 2024
7a56110
modules/zstd: Add literals dispatcher
m-torhan May 10, 2024
dbb2f04
modules/zstd: Add RLE literals decoder implementation
m-torhan May 9, 2024
9ec4ee3
modules/zstd: Add RawLiteralsDecoder
RRozak May 14, 2024
d880116
modules/zstd: Add LiteralsBuffer proc, add literals synchronization
m-torhan Jun 5, 2024
7143a28
modules/zstd: Add LiteralsDecoder implementation
m-torhan Jun 27, 2024
6d31c72
Fix tests inside literals_buffer.x
mtdudek Jul 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/modules-zstd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Modules (ZSTD)
on:
# Avoid triggering on pushes to /all/ open PR branches.
push:
branches:
- main
paths:
- 'xls/modules/zstd/**'
pull_request:
branches:
- main
paths:
- 'xls/modules/zstd/**'
# This lets us trigger manually from the UI.
workflow_dispatch:

jobs:
test:
name: Test ZSTD module (opt)
runs-on:
labels: ubuntu-22.04-64core
timeout-minutes: 600
continue-on-error: true
steps:
- uses: actions/checkout@v2

- name: Restore Nightly Bazel Cache
uses: actions/cache/restore@v4
with:
path: "~/.cache/bazel"
key: bazel-cache-nightly-${{ runner.os }}-${{ github.sha }}
restore-keys: bazel-cache-nightly-${{ runner.os }}-

- name: Install dependencies via apt
run: sudo apt-get install python3-distutils python3-dev python-is-python3 libtinfo5 build-essential liblapack-dev libblas-dev gfortran

- name: Bazel Build Tools (opt)
run: |
bazel build -c opt --test_output=errors -- //xls/dslx:interpreter_main //xls/dslx/ir_convert:ir_converter_main //xls/tools:opt_main //xls/tools:codegen_main

- name: Build ZSTD Module (opt)
run: |
bazel build -c opt --test_output=errors -- //xls/modules/zstd:all

- name: Test ZSTD Module - DSLX Tests (opt)
if: ${{ !cancelled() }}
run: |
bazel test -c opt --test_output=errors -- $(bazel query 'filter(".*_dslx_test", kind(rule, //xls/modules/zstd/...))')

- name: Test ZSTD Module - CC Tests (opt)
if: ${{ !cancelled() }}
run: |
bazel test -c opt --test_output=errors -- $(bazel query 'filter(".*_cc_test", kind(rule, //xls/modules/zstd/...))')

- name: Build ZSTD verilog targets (opt)
if: ${{ !cancelled() }}
run: |
bazel build -c opt -- $(bazel query 'filter(".*_verilog", kind(rule, //xls/modules/zstd/...))')

- name: Build and run ZSTD IR benchmark rules (opt)
if: ${{ !cancelled() }}
run: |
bazel run -c opt -- $(bazel query 'filter(".*_ir_benchmark", kind(rule, //xls/modules/zstd/...))')

- name: Build and run synthesis benchmarks of the ZSTD module (opt)
if: ${{ !cancelled() }}
run: |
bazel run -c opt -- $(bazel query 'filter(".*_benchmark_synth", kind(rule, //xls/modules/zstd/...))')

- name: Build ZSTD place and route targets (opt)
if: ${{ !cancelled() }}
run: |
bazel build -c opt -- $(bazel query 'filter(".*_place_and_route", kind(rule, //xls/modules/zstd/...))')
205 changes: 185 additions & 20 deletions dependency_support/com_github_facebook_zstd/bundled.BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 The XLS Authors
# Copyright 2024 The XLS Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -12,38 +12,203 @@
# See the License for the specific language governing permissions and
# limitations under the License.

package(default_visibility = ["//visibility:public"])
""" Builds zstd.
"""

licenses(["notice"])
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")

# Builds everything together similarly to the zstd cmake file:
# https://github.com/facebook/zstd/blob/dev/build/cmake/lib/CMakeLists.txt
# but with legacy support and defines as in the zstd BUCK file:
# https://github.com/facebook/zstd/blob/dev/lib/BUCK
package(default_visibility = ["//visibility:public"])

cc_library(
name = "zstd",
filegroup(
name = "common_sources",
srcs = glob([
"lib/common/*.h",
"lib/common/*.c",
"lib/compress/*.h",
"lib/common/*.h",
]),
)

filegroup(
name = "compress_sources",
srcs = glob([
"lib/compress/*.c",
"lib/decompress/*.h",
"lib/compress/*.h",
]),
)

filegroup(
name = "decompress_sources",
srcs = glob([
"lib/decompress/*.c",
"lib/decompress/*.S",
"lib/deprecated/*.h",
"lib/deprecated/*.c",
"lib/dictBuilder/*.h",
"lib/decompress/*.h",
]) + select({
"@platforms//os:windows": [],
"//conditions:default": glob(["lib/decompress/*.S"]),
}),
)

filegroup(
name = "dictbuilder_sources",
srcs = glob([
"lib/dictBuilder/*.c",
"lib/legacy/*.h",
"lib/legacy/*.c",
"lib/dictBuilder/*.h",
]),
)

cc_library(
name = "zstd",
srcs = [
":common_sources",
":compress_sources",
":decompress_sources",
":dictbuilder_sources",
],
hdrs = [
"lib/zdict.h",
"lib/zstd.h",
"lib/zstd_errors.h",
],
includes = ["lib"],
linkopts = ["-pthread"],
linkstatic = True,
local_defines = [
"XXH_NAMESPACE=ZSTD_",
"ZSTD_MULTITHREAD",
"ZSTD_BUILD_SHARED=OFF",
"ZSTD_BUILD_STATIC=ON",
] + select({
"@platforms//os:windows": ["ZSTD_DISABLE_ASM"],
"//conditions:default": [],
}),
)

cc_binary(
name = "zstd_cli",
srcs = glob(
include = [
"programs/*.c",
"programs/*.h",
],
exclude = [
"programs/datagen.c",
"programs/datagen.h",
"programs/platform.h",
"programs/util.h",
],
),
deps = [
":datagen",
":util",
":zstd",
],
)

cc_library(
name = "util",
srcs = [
"programs/platform.h",
"programs/util.c",
],
hdrs = [
"lib/common/compiler.h",
"lib/common/debug.h",
"lib/common/mem.h",
"lib/common/portability_macros.h",
"lib/common/zstd_deps.h",
"programs/util.h",
],
)

cc_library(
name = "datagen",
srcs = [
"programs/datagen.c",
"programs/platform.h",
],
hdrs = ["programs/datagen.h"],
deps = [":util"],
)

cc_binary(
name = "datagen_cli",
srcs = [
"programs/lorem.c",
"programs/lorem.h",
"tests/datagencli.c",
"tests/loremOut.c",
"tests/loremOut.h",
],
includes = [
"programs",
"tests",
],
deps = [":datagen"],
)

cc_test(
name = "fullbench",
srcs = [
"lib/decompress/zstd_decompress_internal.h",
"programs/benchfn.c",
"programs/benchfn.h",
"programs/benchzstd.c",
"programs/benchzstd.h",
"programs/lorem.c",
"programs/lorem.h",
"programs/timefn.c",
"programs/timefn.h",
"tests/fullbench.c",
"tests/loremOut.c",
"tests/loremOut.h",
],
copts = select({
"@platforms//os:windows": [],
"//conditions:default": ["-Wno-deprecated-declarations"],
}),
includes = [
"lib/common",
"programs",
"tests",
],
deps = [
":datagen",
":zstd",
],
)

# NOTE: Required because of direct zstd_compress.c include in decodecorpus sources
cc_library(
name = "decodecorpus_includes",
hdrs = [
"lib/compress/zstd_compress.c",
],
)

cc_binary(
name = "decodecorpus",
srcs = [
"tests/decodecorpus.c",
] + glob(
[
"programs/*.c",
"programs/*.h",
],
exclude = [
"programs/zstdcli.c",
],
),
deps = [
":zstd",
":decodecorpus_includes",
],
includes = [
"lib/",
"lib/common/",
"lib/compress/",
"lib/dictBuilder/",
"lib/deprecated/",
"programs/",
],
strip_include_prefix = "lib",
local_defines = [
"ZSTD_LEGACY_SUPPORT=4",
"XXH_NAMESPACE=ZSTD_",
],
visibility = ["//visibility:public"],
Expand Down
Loading
0