78 Commits
Author SHA1 Message Date
Nigel Tao bd42fa7af2 base38: reassign alphabet and numbers
It changes from " 0-9?a-z" to ".0-9a-z~". The default or placeholder
changes from " " to "." so it's now always visible. The wildcard changes
from "?" to "~" so it's now sorted last.
2024-08-26 12:30:20 +10:00
Nigel Tao aae5997e12 lang: remove endwhile keyword 2024-07-08 17:15:48 +10:00
Nigel Tao 77fa011072 std: rename foo_got variables to foo_have 2023-12-27 16:47:52 +11:00
Nigel Tao eed1af7bee base: rename history_retain_length
It was renamed to dst_history_retain_length.

It also was removed from image_decoders and token_decoders. It only
applies to io_transformers, as retaining history applies to the
destination (not source) IO buffer.

Also adjust example/bzcat and example/zcat to apply the history retain
length to the dst (not src) buffer.
2023-12-17 12:26:08 +11:00
Nigel Tao 82ea1985b4 base: add optional_u63 type 2023-11-19 12:02:24 +11:00
Patrick Georgi f563f32f82 Add SPDX identifier to license headers
SPDX is an ISO standard for describing licenses in a computer readable
format, which is useful when applying license compliance tools and the
like to source code.

In addition to ensuring that the Wuffs C distribution is properly
annotated to the benefit of projects using Wuffs and SPDX-supporting
tools, add it everywhere else where there's a license in this repo for
consistency, too.
2023-10-06 20:52:36 +02:00
Nigel Tao 74a6ea2fcd all: relicense from Apache2 to dual Apache2/MIT
The LICENSE has changed from a single license (Apache2) to a dual
license (Apache2 or MIT, at your option).

If you've previously used Wuffs under the Apache2 license, you are able
to keep doing so. No further action required by you.

The two files listed below (previous releases) are exceptions, as they
are older snapshots, frozen in time. Their license has not changed:
release/c/wuffs-v0.2.c
release/c/wuffs-v0.3.c

Every name in the AUTHORS file, other than Google Inc., has signed
Google's CLA (Contributor License Agreement).
2023-10-06 10:00:59 +11:00
Nigel Tao 5fb82e7d0a std: add compact_retaining, history_retain_length 2023-10-05 13:24:44 +11:00
Nigel Tao 4dfd70928b std: add "get_quirk(key: u32) u64" 2023-07-16 12:04:09 +10:00
Nigel Tao 6e84987d33 std: change set_quirk_enabled to set_quirk 2023-04-14 21:42:15 +10:00
Nigel Tao f5eb38d76e wuffsfmt: indent with 4 spaces (not a tab) 2023-04-09 15:28:07 +10:00
Nigel Tao 9c03b8c71d wuffsfmt: double-indents hanging lines 2023-04-09 15:22:25 +10:00
Nigel Tao f01f0859f0 std/*io_transformer*: add "#truncated input"
name                                              old speed      new speed       delta

wuffs_bzip2_decode_10k/clang11                    58.5MB/s ± 0%   59.9MB/s ± 0%   +2.50%  (p=0.008 n=5+5)
wuffs_bzip2_decode_100k/clang11                   45.7MB/s ± 0%   50.5MB/s ± 0%  +10.66%  (p=0.008 n=5+5)

wuffs_bzip2_decode_10k/gcc10                      56.2MB/s ± 0%   61.9MB/s ± 0%  +10.01%  (p=0.008 n=5+5)
wuffs_bzip2_decode_100k/gcc10                     46.5MB/s ± 0%   50.4MB/s ± 0%   +8.41%  (p=0.016 n=4+5)

wuffs_deflate_decode_1k_full_init/clang11          195MB/s ± 0%    191MB/s ± 0%   -1.71%  (p=0.008 n=5+5)
wuffs_deflate_decode_1k_part_init/clang11          224MB/s ± 0%    225MB/s ± 0%   +0.87%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_full_init/clang11         421MB/s ± 0%    401MB/s ± 0%   -4.59%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_part_init/clang11         432MB/s ± 0%    413MB/s ± 0%   -4.49%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_just_one_read/clang11    542MB/s ± 0%    518MB/s ± 0%   -4.43%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_many_big_reads/clang11   338MB/s ± 0%    325MB/s ± 0%   -3.81%  (p=0.008 n=5+5)

wuffs_deflate_decode_1k_full_init/gcc10            181MB/s ± 0%    185MB/s ± 0%   +1.76%  (p=0.008 n=5+5)
wuffs_deflate_decode_1k_part_init/gcc10            209MB/s ± 0%    212MB/s ± 0%   +1.79%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_full_init/gcc10           410MB/s ± 0%    407MB/s ± 0%   -0.93%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k_part_init/gcc10           421MB/s ± 0%    418MB/s ± 0%   -0.87%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k_just_one_read/gcc10      533MB/s ± 0%    533MB/s ± 0%     ~     (p=0.548 n=5+5)
wuffs_deflate_decode_100k_many_big_reads/gcc10     336MB/s ± 0%    334MB/s ± 1%   -0.67%  (p=0.008 n=5+5)

wuffs_gzip_decode_10k/clang11                      401MB/s ± 0%    398MB/s ± 0%   -0.77%  (p=0.008 n=5+5)
wuffs_gzip_decode_100k/clang11                     505MB/s ± 0%    503MB/s ± 0%   -0.46%  (p=0.008 n=5+5)

wuffs_gzip_decode_10k/gcc10                        403MB/s ± 0%    410MB/s ± 0%   +1.90%  (p=0.008 n=5+5)
wuffs_gzip_decode_100k/gcc10                       522MB/s ± 0%    523MB/s ± 0%   +0.10%  (p=0.032 n=5+5)

wuffs_zlib_decode_10k/clang11                      418MB/s ± 0%    417MB/s ± 1%     ~     (p=0.310 n=5+5)
wuffs_zlib_decode_100k/clang11                     530MB/s ± 0%    529MB/s ± 0%     ~     (p=0.421 n=5+5)

wuffs_zlib_decode_10k/gcc10                        428MB/s ± 0%    434MB/s ± 0%   +1.50%  (p=0.008 n=5+5)
wuffs_zlib_decode_100k/gcc10                       551MB/s ± 0%    551MB/s ± 0%     ~     (p=0.690 n=5+5)

Fixes #96
2023-01-31 23:09:37 +11:00
Nigel Tao 8ef4c062d9 Add zlib QUIRK_JUST_RAW_DEFLATE 2021-11-26 23:13:57 +11:00
Nigel Tao 78da50820e Rename set_ignore_checksum! as a quirk 2021-01-21 22:52:11 +11:00
Nigel Tao 0de64ee8b7 Use WUFFS_BASE__QUIRK_IGNORE_CHECKSUM 2021-01-21 22:49:57 +11:00
Nigel Tao 532e18c4a5 Add colons to const syntax 2020-04-14 14:57:30 +10:00
Nigel Tao 74871344f0 Capitalize Wuffs const names 2020-04-13 15:52:36 +10:00
Nigel Tao 4bc42db1d3 Add set_quirk_enabled interface methods 2020-04-12 20:53:54 +10:00
Nigel Tao 58351d44da Make endwhile mandatory for nameless loops 2020-03-25 21:40:00 +11:00
Nigel Tao 92a5bfd7ec Have various structs implement base.io_transformer 2020-01-11 22:25:31 +11:00
Nigel Tao 5f8d2da74f Rename decode_io_writer methods to transform_io 2020-01-11 10:19:25 +11:00
Nigel Tao 8ff9cdb9a6 Rename hasher update_u32 method 2019-11-20 21:07:22 +11:00
Nigel Tao a21ad25bb8 Rename x T to x: T for vars 2019-10-12 21:55:13 +11:00
Nigel Tao 1520a1f345 Rename x T to x: T for fields and func args 2019-10-12 21:49:04 +11:00
Nigel Tao 5b4e3647c0 Reformat x:y as x: y 2019-10-12 21:21:39 +11:00
Nigel Tao 18763813d5 Support zlib dictionaries 2019-09-28 10:38:30 +10:00
Nigel Tao ff1e3c9c48 Add mark/since/count_since methods
name                                             old speed     new speed     delta

wuffs_deflate_decode_1k_full_init/clang5         149MB/s ± 0%  151MB/s ± 1%  +1.46%  (p=0.000 n=9+7)
wuffs_deflate_decode_1k_part_init/clang5         183MB/s ± 1%  188MB/s ± 2%  +2.40%  (p=0.000 n=10+10)
wuffs_deflate_decode_10k_full_init/clang5        236MB/s ± 0%  242MB/s ± 1%  +2.56%  (p=0.000 n=10+10)
wuffs_deflate_decode_10k_part_init/clang5        243MB/s ± 0%  249MB/s ± 0%  +2.36%  (p=0.000 n=9+9)
wuffs_deflate_decode_100k_just_one_read/clang5   279MB/s ± 0%  288MB/s ± 1%  +3.28%  (p=0.000 n=9+8)
wuffs_deflate_decode_100k_many_big_reads/clang5  232MB/s ± 0%  240MB/s ± 1%  +3.76%  (p=0.000 n=9+9)

wuffs_deflate_decode_1k_full_init/gcc7           152MB/s ± 1%  152MB/s ± 1%    ~     (p=0.661 n=10+9)
wuffs_deflate_decode_1k_part_init/gcc7           188MB/s ± 0%  187MB/s ± 1%  -0.58%  (p=0.013 n=10+9)
wuffs_deflate_decode_10k_full_init/gcc7          260MB/s ± 0%  260MB/s ± 0%    ~     (p=0.393 n=10+10)
wuffs_deflate_decode_10k_part_init/gcc7          268MB/s ± 0%  268MB/s ± 0%    ~     (p=0.971 n=10+10)
wuffs_deflate_decode_100k_just_one_read/gcc7     312MB/s ± 1%  312MB/s ± 0%    ~     (p=0.720 n=10+9)
wuffs_deflate_decode_100k_many_big_reads/gcc7    247MB/s ± 1%  247MB/s ± 0%  -0.26%  (p=0.022 n=10+9)
2019-07-06 09:58:51 +10:00
Nigel Tao ef7aa0d980 Rename "!=" to "<>"; "!" now only shows impurity 2019-03-02 14:51:32 +11:00
Nigel Tao 931fdce475 Rename "yield foo" to "yield? foo" 2019-02-23 17:15:57 +11:00
Nigel Tao 045f180a6c Rename errors from "?msg" to "#msg" 2019-02-23 17:06:24 +11:00
Nigel Tao 33eae7ae40 Set decoder_workbuf_len_max_incl_worst_case to 1 2019-02-16 12:31:23 +11:00
Nigel Tao 2928806ab6 Re-arrange struct fields so bulk data is last
name                                             old speed      new speed      delta

wuffs_adler32_10k/clang5                         2.42GB/s ± 1%  2.43GB/s ± 1%  +0.15%  (p=0.014 n=46+45)
wuffs_adler32_100k/clang5                        2.43GB/s ± 1%  2.43GB/s ± 1%    ~     (p=0.532 n=43+46)

wuffs_adler32_10k/gcc7                           3.22GB/s ± 0%  3.23GB/s ± 1%  +0.17%  (p=0.000 n=47+48)
wuffs_adler32_100k/gcc7                          3.23GB/s ± 0%  3.23GB/s ± 0%  +0.20%  (p=0.000 n=45+48)

wuffs_crc32_ieee_10k/clang5                      2.86GB/s ± 0%  2.86GB/s ± 0%  +0.22%  (p=0.000 n=47+46)
wuffs_crc32_ieee_100k/clang5                     2.88GB/s ± 0%  2.88GB/s ± 1%  +0.11%  (p=0.006 n=48+47)

wuffs_crc32_ieee_10k/gcc7                        3.37GB/s ± 1%  3.37GB/s ± 1%    ~     (p=0.050 n=49+48)
wuffs_crc32_ieee_100k/gcc7                       3.40GB/s ± 0%  3.40GB/s ± 1%  +0.15%  (p=0.001 n=46+48)

wuffs_deflate_decode_1k/clang5                    139MB/s ± 0%   138MB/s ± 0%  -0.44%  (p=0.000 n=45+47)
wuffs_deflate_decode_10k/clang5                   222MB/s ± 0%   233MB/s ± 1%  +4.81%  (p=0.000 n=45+47)
wuffs_deflate_decode_100k_just_one_read/clang5    260MB/s ± 1%   274MB/s ± 0%  +5.34%  (p=0.000 n=46+45)
wuffs_deflate_decode_100k_many_big_reads/clang5   218MB/s ± 0%   224MB/s ± 1%  +2.36%  (p=0.000 n=44+46)

wuffs_deflate_decode_1k/gcc7                      158MB/s ± 1%   157MB/s ± 1%  -0.23%  (p=0.000 n=44+48)
wuffs_deflate_decode_10k/gcc7                     266MB/s ± 1%   265MB/s ± 1%  -0.48%  (p=0.000 n=45+47)
wuffs_deflate_decode_100k_just_one_read/gcc7      323MB/s ± 1%   320MB/s ± 0%  -0.87%  (p=0.000 n=46+46)
wuffs_deflate_decode_100k_many_big_reads/gcc7     255MB/s ± 0%   252MB/s ± 0%  -1.04%  (p=0.000 n=42+44)

wuffs_gif_decode_1k_bw/clang5                     243MB/s ± 1%   238MB/s ± 1%  -1.74%  (p=0.000 n=49+48)
wuffs_gif_decode_1k_color/clang5                  142MB/s ± 1%   140MB/s ± 1%  -1.17%  (p=0.000 n=45+49)
wuffs_gif_decode_10k_bgra/clang5                  723MB/s ± 1%   720MB/s ± 1%  -0.37%  (p=0.000 n=48+49)
wuffs_gif_decode_10k_indexed/clang5               193MB/s ± 1%   194MB/s ± 1%  +0.23%  (p=0.002 n=49+48)
wuffs_gif_decode_20k/clang5                       245MB/s ± 1%   246MB/s ± 1%  +0.20%  (p=0.002 n=49+46)
wuffs_gif_decode_100k_artificial/clang5           542MB/s ± 1%   543MB/s ± 1%  +0.16%  (p=0.012 n=48+47)
wuffs_gif_decode_100k_realistic/clang5            227MB/s ± 1%   226MB/s ± 1%  -0.31%  (p=0.000 n=48+45)
wuffs_gif_decode_1000k/clang5                     232MB/s ± 0%   231MB/s ± 1%  -0.40%  (p=0.000 n=48+42)
wuffs_gif_decode_anim_screencap/clang5           1.08GB/s ± 1%  1.07GB/s ± 1%  -1.09%  (p=0.000 n=46+46)

wuffs_gif_decode_1k_bw/gcc7                       264MB/s ± 1%   262MB/s ± 1%  -0.81%  (p=0.000 n=50+49)
wuffs_gif_decode_1k_color/gcc7                    148MB/s ± 0%   146MB/s ± 1%  -1.60%  (p=0.000 n=47+49)
wuffs_gif_decode_10k_bgra/gcc7                    621MB/s ± 1%   618MB/s ± 1%  -0.47%  (p=0.000 n=49+49)
wuffs_gif_decode_10k_indexed/gcc7                 194MB/s ± 1%   194MB/s ± 3%    ~     (p=0.222 n=49+50)
wuffs_gif_decode_20k/gcc7                         236MB/s ± 1%   237MB/s ± 1%  +0.52%  (p=0.000 n=49+45)
wuffs_gif_decode_100k_artificial/gcc7             505MB/s ± 1%   507MB/s ± 1%  +0.36%  (p=0.000 n=46+47)
wuffs_gif_decode_100k_realistic/gcc7              210MB/s ± 1%   210MB/s ± 1%    ~     (p=0.081 n=49+42)
wuffs_gif_decode_1000k/gcc7                       213MB/s ± 1%   213MB/s ± 1%  -0.19%  (p=0.001 n=49+47)
wuffs_gif_decode_anim_screencap/gcc7             1.06GB/s ± 0%  1.05GB/s ± 1%  -1.02%  (p=0.000 n=48+47)

wuffs_gzip_decode_10k/clang5                      206MB/s ± 0%   215MB/s ± 0%  +4.52%  (p=0.000 n=49+44)
wuffs_gzip_decode_100k/clang5                     239MB/s ± 0%   250MB/s ± 0%  +4.71%  (p=0.000 n=47+46)

wuffs_gzip_decode_10k/gcc7                        250MB/s ± 1%   249MB/s ± 0%  -0.38%  (p=0.000 n=47+50)
wuffs_gzip_decode_100k/gcc7                       293MB/s ± 0%   289MB/s ± 0%  -1.28%  (p=0.000 n=45+44)

wuffs_lzw_decode_20k/clang5                       265MB/s ± 1%   265MB/s ± 0%    ~     (p=0.331 n=47+44)
wuffs_lzw_decode_100k/clang5                      452MB/s ± 1%   450MB/s ± 1%  -0.31%  (p=0.001 n=48+46)

wuffs_lzw_decode_20k/gcc7                         264MB/s ± 1%   263MB/s ± 1%  -0.49%  (p=0.000 n=48+47)
wuffs_lzw_decode_100k/gcc7                        481MB/s ± 1%   475MB/s ± 1%  -1.22%  (p=0.000 n=48+50)

wuffs_zlib_decode_10k/clang5                      202MB/s ± 0%   212MB/s ± 0%  +5.18%  (p=0.000 n=46+46)
wuffs_zlib_decode_100k/clang5                     235MB/s ± 0%   247MB/s ± 0%  +4.92%  (p=0.000 n=46+45)

wuffs_zlib_decode_10k/gcc7                        246MB/s ± 0%   246MB/s ± 0%  -0.13%  (p=0.001 n=45+47)
wuffs_zlib_decode_100k/gcc7                       289MB/s ± 0%   291MB/s ± 0%  +0.67%  (p=0.000 n=47+46)
2019-02-09 10:35:48 +11:00
Nigel Tao fc4abafbe7 Rename decoder_max_incl_workbuf_len constants 2019-02-03 15:44:25 +11:00
Nigel Tao b9cbce9779 Add decoder.workbuf_len methods 2019-02-02 16:34:40 +11:00
Nigel Tao de5b64a846 Rename max_incl_workbuf_len constants 2019-02-02 16:29:54 +11:00
Nigel Tao be2d96bb27 Add public max_incl_workbuf_len constants 2019-02-02 15:51:04 +11:00
Nigel Tao c9830ceb9a Add a workbuf argument to decode_io_writer 2019-02-02 15:35:05 +11:00
Nigel Tao 16e97281e2 Rename some decode methods to decode_io_writer 2019-01-12 10:29:41 +11:00
Nigel Tao 093268e179 Rename the !?? effect to ? 2018-12-29 13:57:57 +11:00
Nigel Tao ce96837b40 Rename z variable to status, in Wuffs code 2018-12-28 15:52:34 +11:00
Nigel Tao d26fa09d07 Have wuffsfmt align the "T"s in "x T" fields 2018-12-27 15:09:52 +11:00
Nigel Tao 1ceb304ad9 Have wuffsfmt align the "T"s in "var x T" blocks 2018-12-27 14:19:20 +11:00
Nigel Tao bac74a830d Place some vars at the top of functions 2018-12-26 18:34:52 +11:00
Nigel Tao 9741eada02 Replace "= try foo" with "=? foo" 2018-12-01 13:11:47 +11:00
Nigel Tao 875362ea07 Change status "?foo" to just "?foo" 2018-11-24 12:36:42 +11:00
Nigel Tao 6236e7205f Remove packageid 2018-08-12 21:44:49 +10:00
Nigel Tao eec0fce647 Change error "?foo" to status "?foo" 2018-08-12 21:31:56 +10:00
Nigel Tao 203b45e869 Remove status values 2018-08-12 19:36:29 +10:00
Nigel Tao b385c30b4f Add a "?" prefix to non-built-in status messages 2018-08-12 14:07:40 +10:00