summaryrefslogtreecommitdiff
path: root/lib/compression/tests/scripts
AgeCommit message (Collapse)AuthorFilesLines
2025-03-29lib/compression: add a windows python script for test vectorsDouglas Bagnall1-0/+155
The C program we have (generate-windows-test-vectors.c) uses a higher level API than MS-XCA refers to, which plays tricks like refusing to do compression if the result would be larger than the original. It does that because I could not successfully compile something using the correct RtlCompressBuffer API in Cygwin. It turns out you don't need to compile anything; using the Python ctypes library, the Windows libraries are available to Python. The compression *is* the same, which is what we expected. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-12-01lib/compression: add test scripts READMEDouglas Bagnall1-0/+19
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2022-12-01lib/compression: test util to generate fuzzing seedsDouglas Bagnall1-0/+45
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2022-12-01lib/compression: Windows utility to generate test vectorsDouglas Bagnall1-0/+206
If compiled on Windows using Cygwin, MSYS2, or similar, this will output compressed versions of files exactly as specified by MZ-XCA, if the following conditions are met: 1. The file > 300 bytes. 2. The compressed file is smaller than the decompressed file. Otherwise it returns the data unchanged. Without warning; that's just how the API works. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2022-12-01lib/compression: script to test 3 byte hashDouglas Bagnall1-0/+49
Compression uses a 3 byte hash remember LZ77 matches in a 14-bit table. This script runs the hash over all 16M combinations, then again over all ASCII combinations, counting collisions to find hot-spots. If you think you have a better hash, you are probably right, but you should try it here -- alter h() -- before committing to it. This one is literally the first one I thought of. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2022-12-01lib/compression: helper script to make unbalanced dataDouglas Bagnall1-0/+185
Huffman tree re-quantisation and perhaps other code paths are only triggered by pathological data like this. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2022-12-01lib/compression: add a debug script to describe headersDouglas Bagnall1-0/+54
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>