oneapi-src / oneapi-src/oneAPI-samples

For DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/decompress failed to decompress .gz file

Open
#1,514 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
1.2k
Forks
745
PR merge metrics
No merged PRs in 30d

Description

Summary

I build the decompressor for gzip, but it can only decompress the file offer in the repo. Most files I compressed using cpu version gzip is not able to be decompressed.

Version

I currently using oneAPI 2022.1 and the Code Sample v0.0.51 extension for VScode to pull the code.

Environment

Ubuntu 20.04

Steps to reproduce

Use linux built-in gzip to compress a file. The compression ratio should around 4, and the size of output file should over 50MB.
Then the executable we compile with this repo to decompress the file created by linux built-in version gzip.

Observed behavior

The decompression will stuck in a while loop and will never terminate. I print out some information to help me debug the issue, and found out the bug should locate in the huffman decoding kernel.

Here is some debug log I print:
Using GZIP decompression

Decompressing '../data/gzip/log-test.log.gz' 2 times
Input file size : 677.904KB
expected output size :2706127
Launching kernels for run 0
literals_per_cycle for producer is : 1
in_count = 677904
Iteration count = 677904
literals per cycle is : 4
literal per cycle from consumer = 4
huffman shifting = 1098876287
huffman shifting = 1098876287
huffman shifting = 1098876287
huffman shifting = 1098876287
huffman shifting = 1098876287

Expected behavior

I expected the decompressor can decompress all the file I compressed with CPU version gzip

I attached 3 files I used to debug.
log-test.log.gz
txt-test2.txt.gz
pdf-test.pdf.gz

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in DirectProgramming/C++SYCL_FPGA/ReferenceDesigns/decompress and reproduce the hang with a Linux gzip-created file, using the attached inputs if available. Inspect the huffman decoding kernel and its loop around the reported shifting value. Done means the built executable terminates and correctly decompresses files produced by the Linux gzip utility, not only the repository sample.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux, ubuntu
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.