Skip to content

IBM Z: Adjust compressBound() for DFLTCC (and several other fixes)#1049

Merged
Dead2 merged 5 commits intozlib-ng:developfrom
iii-i:ibm-z-compress-bound
Oct 13, 2021
Merged

IBM Z: Adjust compressBound() for DFLTCC (and several other fixes)#1049
Dead2 merged 5 commits intozlib-ng:developfrom
iii-i:ibm-z-compress-bound

Conversation

@iii-i
Copy link
Copy Markdown
Member

@iii-i iii-i commented Oct 11, 2021

Hi,

a bug with compressBound() + DFLTCC was discovered in zlib. While porting the fix to zlib-ng, I also stumbled upon several other problems. This PR fixes them all.

Best regards,
Ilya

iii-i added 2 commits October 11, 2021 13:15
Do not use relative includes, since they are valid only within the
source directory. Rely on the build system to pass the necessary
include flags instead.
This fixes link failures when using CFLAGS=-m31 on IBM Z. All the
other tests are already linked this way.
@codecov
Copy link
Copy Markdown

codecov bot commented Oct 11, 2021

Codecov Report

Merging #1049 (75d2140) into develop (b418e9c) will decrease coverage by 0.02%.
The diff coverage is 50.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1049      +/-   ##
===========================================
- Coverage    79.48%   79.46%   -0.03%     
===========================================
  Files           85       85              
  Lines         8658     8663       +5     
  Branches      1398     1401       +3     
===========================================
+ Hits          6882     6884       +2     
- Misses        1228     1230       +2     
- Partials       548      549       +1     
Flag Coverage Δ
macos_clang 69.88% <33.33%> (-0.03%) ⬇️
macos_gcc 68.53% <ø> (ø)
ubuntu_clang 75.45% <33.33%> (-0.03%) ⬇️
ubuntu_clang_debug 75.57% <33.33%> (-0.02%) ⬇️
ubuntu_clang_inflate_allow_invalid_dist 75.19% <33.33%> (-0.03%) ⬇️
ubuntu_clang_inflate_strict 75.39% <33.33%> (-0.03%) ⬇️
ubuntu_clang_mmap 75.42% <33.33%> (-0.03%) ⬇️
ubuntu_clang_msan 75.45% <33.33%> (-0.03%) ⬇️
ubuntu_clang_pigz 36.16% <0.00%> (-0.02%) ⬇️
ubuntu_clang_pigz_no_optim 40.92% <0.00%> (-0.03%) ⬇️
ubuntu_clang_pigz_no_threads 35.66% <0.00%> (-0.02%) ⬇️
ubuntu_clang_reduced_mem 75.71% <33.33%> (-0.03%) ⬇️
ubuntu_gcc 74.88% <100.00%> (ø)
ubuntu_gcc_aarch64 76.77% <100.00%> (ø)
ubuntu_gcc_aarch64_compat_no_opt 74.55% <ø> (ø)
ubuntu_gcc_aarch64_no_acle 76.23% <ø> (ø)
ubuntu_gcc_aarch64_no_neon 76.54% <ø> (ø)
ubuntu_gcc_armhf 76.77% <100.00%> (ø)
ubuntu_gcc_armhf_compat_no_opt 74.52% <ø> (ø)
ubuntu_gcc_armhf_no_acle 77.05% <100.00%> (ø)
ubuntu_gcc_armhf_no_neon 77.33% <100.00%> (ø)
ubuntu_gcc_armsf 76.78% <100.00%> (ø)
ubuntu_gcc_armsf_compat_no_opt 74.52% <ø> (ø)
ubuntu_gcc_compat_no_opt 75.51% <100.00%> (ø)
ubuntu_gcc_compat_sprefix 74.79% <ø> (ø)
ubuntu_gcc_mingw_i686 0.00% <ø> (ø)
ubuntu_gcc_mingw_x86_64 0.00% <ø> (ø)
ubuntu_gcc_no_avx2 76.84% <ø> (ø)
ubuntu_gcc_no_ctz 77.74% <ø> (ø)
ubuntu_gcc_no_ctzll 77.41% <ø> (ø)
ubuntu_gcc_no_pclmulqdq 73.62% <ø> (ø)
ubuntu_gcc_no_sse2 76.10% <ø> (ø)
ubuntu_gcc_no_sse4 73.97% <ø> (ø)
ubuntu_gcc_o3 74.09% <ø> (ø)
ubuntu_gcc_osb 76.85% <100.00%> (+<0.01%) ⬆️
ubuntu_gcc_pigz 36.47% <ø> (-0.09%) ⬇️
ubuntu_gcc_pigz_aarch64 38.57% <ø> (-0.04%) ⬇️
ubuntu_gcc_ppc 74.57% <ø> (ø)
ubuntu_gcc_ppc64 77.61% <ø> (ø)
ubuntu_gcc_ppc64le 76.07% <ø> (ø)
ubuntu_gcc_ppc_no_power8 77.37% <ø> (ø)
ubuntu_gcc_s390x 75.89% <28.57%> (-0.04%) ⬇️
ubuntu_gcc_sparc64 78.65% <ø> (ø)
ubuntu_gcc_sprefix 74.57% <ø> (ø)
win64_gcc ∅ <ø> (∅)
win64_gcc_compat_no_opt ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
arch/s390/crc32-vx.c 100.00% <ø> (ø)
arch/s390/dfltcc_common.c 89.65% <ø> (ø)
arch/s390/dfltcc_deflate.c 13.49% <0.00%> (-0.17%) ⬇️
arch/s390/dfltcc_inflate.c 15.87% <ø> (ø)
arch/s390/s390.c 100.00% <ø> (ø)
compress.c 89.18% <100.00%> (+0.95%) ⬆️
test/example.c 81.84% <100.00%> (ø)
trees.c 96.17% <0.00%> (-0.28%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b418e9c...75d2140. Read the comment docs.

iii-i added 2 commits October 12, 2021 15:13
The zlib manual does not specify a strict contract for
inflateGetDictionary(), it merely says that it "Returns the sliding
dictionary being maintained by inflate", which is an implementation
detail. IBM Z inflate's behavior differs from that of software, and
may change in the future to boot.
Intermediate CRC32 value was moved from strm->adler to
state->crc_fold.
@iii-i iii-i force-pushed the ibm-z-compress-bound branch from 23ae6d2 to 533e7cf Compare October 12, 2021 14:06
When DFLTCC was introduced, deflateBound() was adjusted, but
compressBound() was not, leading to compression failures when using
compressBound() + compress() with poorly compressible data.
@iii-i iii-i force-pushed the ibm-z-compress-bound branch from 533e7cf to 75d2140 Compare October 12, 2021 14:48
@Dead2 Dead2 merged commit 63e0002 into zlib-ng:develop Oct 13, 2021
Dead2 added a commit that referenced this pull request Dec 13, 2021
 - Fix hangs on macOS #1031
 - Fix minideflate write buffers being overwritten #1060
 - Fix build problems when building outside of source dir #1049
 - Fix build problems on arm2-7 #1030
 - Fixed some compile warnings #1020 #1036 #1037 #1048
 - Improved posix memalign support #888
 - Improvements to testing #637 #1026 #1035 #1051 #1056 #1063 #1067
 - Improvements for integration into other projects #1022 #1042
 - Code style fixes #637 #1040 #1050
@Dead2 Dead2 mentioned this pull request Dec 13, 2021
Dead2 added a commit that referenced this pull request Dec 20, 2021
 - Fix hangs on macOS #1031
 - Fix minideflate write buffers being overwritten #1060
 - Fix deflateBound and compressBound returning too small size estimates #1071
 - Fix build problems when building outside of source dir #1049
 - Fix build problems on arm2-7 #1030
 - Fixed some compile warnings #1020 #1036 #1037 #1048
 - Improved posix memalign support #888
 - Improvements to testing #637 #1026 #1032 #1035 #1051 #1056 #1063 #1067
 - Improvements for integration into other projects #1022 #1042
 - Code style fixes #637 #1040 #1050 #1075
Dead2 added a commit that referenced this pull request Dec 20, 2021
 - Fix hangs on macOS #1031
 - Fix minideflate write buffers being overwritten #1060
 - Fix deflateBound and compressBound returning too small size estimates #1071
 - Fix build problems when building outside of source dir #1049
 - Fix build problems on arm2-7 #1030
 - Fixed some compile warnings #1020 #1036 #1037 #1048
 - Improved posix memalign support #888
 - Improvements to testing #637 #1026 #1032 #1035 #1051 #1056 #1063 #1067
 - Improvements for integration into other projects #1022 #1042
 - Code style fixes #637 #1040 #1050 #1075
Dead2 added a commit that referenced this pull request Dec 20, 2021
 - Fix hangs on macOS #1031
 - Fix minideflate write buffers being overwritten #1060
 - Fix deflateBound and compressBound returning too small size estimates #1071
 - Fix build problems when building outside of source dir #1049
 - Fix build problems on arm2-7 #1030
 - Fixed some compile warnings #1020 #1036 #1037 #1048
 - Improved posix memalign support #888
 - Improvements to testing #637 #1026 #1032 #1035 #1051 #1056 #1063 #1067
 - Improvements for integration into other projects #1022 #1042
 - Code style fixes #637 #1040 #1050 #1075
Dead2 added a commit that referenced this pull request Dec 20, 2021
 - Fix hangs on macOS #1031
 - Fix minideflate write buffers being overwritten #1060
 - Fix deflateBound and compressBound returning too small size estimates #1049 #1071
 - Fix incorrect function declaration warning #1080
 - Fix build problems when building outside of source dir #1049
 - Fix build problems on arm2-7 #1030
 - Fixed some compile warnings #1020 #1036 #1037 #1048
 - Improved posix memalign support #888
 - Improvements to testing #637 #1026 #1032 #1035 #1049 #1051 #1056 #1063 #1067
 - Improvements for integration into other projects #1022 #1042
 - Code style fixes #637 #1040 #1050 #1075
Dead2 added a commit that referenced this pull request Dec 20, 2021
 - Fix hangs on macOS #1031
 - Fix minideflate write buffers being overwritten #1060
 - Fix deflateBound and compressBound returning too small size estimates #1049 #1071
 - Fix incorrect function declaration warning #1080
 - Fix build problems when building outside of source dir #1049
 - Fix build problems on arm2-7 #1030
 - Fixed some compile warnings #1020 #1036 #1037 #1048
 - Improved posix memalign support #888
 - Improvements to testing #637 #1026 #1032 #1035 #1049 #1051 #1056 #1063 #1067 #1079
 - Improvements for integration into other projects #1022 #1042
 - Code style fixes #637 #1040 #1050 #1075
Dead2 added a commit that referenced this pull request Dec 24, 2021
 - Fix hangs on macOS #1031
 - Fix minideflate write buffers being overwritten #1060
 - Fix deflateBound and compressBound returning too small size estimates #1049 #1071
 - Fix incorrect function declaration warning #1080
 - Fix build problems when building outside of source dir #1049
 - Fix build problems on arm2-7 #1030
 - Fixed some compile warnings #1020 #1036 #1037 #1048
 - Improved posix memalign support #888
 - Improvements to testing #637 #1026 #1032 #1035 #1049 #1051 #1056 #1063 #1067 #1079
 - Improvements for integration into other projects #1022 #1042
 - Code style fixes #637 #1040 #1050 #1075
@iii-i iii-i deleted the ibm-z-compress-bound branch April 20, 2022 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants