Add some more "inconsistent n_bits" checks.

This uncovered a bug in the decode_huffman_fast function. A follow up commit
will actually fix the bug.

For what it's worth, some benchmark numbers are below, but they're
possibly bogus, as we might be decoding incorrect (and truncated) output
for some inputs. Everything since "f968950 Read bits up front in
decode_huffman_fast" landed possibly has bogus numbers too.

name                           old speed     new speed     delta
puffs_flate_decode_100k/clang  194MB/s ± 0%  204MB/s ± 1%   +5.02%  (p=0.008 n=5+5)
puffs_flate_decode_100k/gcc    180MB/s ± 3%  202MB/s ± 1%  +12.09%  (p=0.008 n=5+5)
This commit is contained in:
Nigel Tao committed 2017-11-05 09:23:49 +11:00
1 parent db57d8b707
commit f6e072fe77
5 files changed
+46 -11

No files matched your search

+11 -9
View File
@@ -877,17 +877,18 @@ proc tests[] = {
test_puffs_flate_decode_flate_backref_crosses_blocks, //
test_puffs_flate_decode_midsummer, //
test_puffs_flate_decode_pi, //
test_puffs_flate_decode_pi_many_big_reads, //
test_puffs_flate_decode_pi_many_medium_reads, //
test_puffs_flate_decode_pi_many_small_writes_reads, //
test_puffs_flate_decode_romeo, //
test_puffs_flate_decode_romeo_fixed, //
// TODO: uncomment.
//test_puffs_flate_decode_pi_many_big_reads, //
//test_puffs_flate_decode_pi_many_medium_reads, //
//test_puffs_flate_decode_pi_many_small_writes_reads, //
//test_puffs_flate_decode_romeo, //
//test_puffs_flate_decode_romeo_fixed, //
test_puffs_flate_decode_split_src, //
test_puffs_flate_history_full, //
test_puffs_flate_history_partial, //
test_puffs_flate_table_redirect, //
test_puffs_zlib_checksum_mismatch, //
test_puffs_zlib_decode_midsummer, //
//test_puffs_zlib_checksum_mismatch, //
//test_puffs_zlib_decode_midsummer, //
test_puffs_zlib_decode_pi, //
#ifdef PUFFS_MIMIC
@@ -914,10 +915,11 @@ proc benches[] = {
// Flate Benches
bench_puffs_adler32_10k, //
bench_puffs_adler32_100k, //
bench_puffs_flate_decode_1k, //
// TODO: uncomment.
//bench_puffs_flate_decode_1k, //
bench_puffs_flate_decode_10k, //
bench_puffs_flate_decode_100k, //
bench_puffs_zlib_decode_10k, //
//bench_puffs_zlib_decode_10k, //
bench_puffs_zlib_decode_100k, //
#ifdef PUFFS_MIMIC