Eremey Valetov 33a892721d
Distributions / Wheels and CLI (windows-x86_64) (push) Canceled after 0s
Distributions / Wheels and CLI (macos-arm64) (push) Canceled after 0s
Distributions / Wheels and CLI (macos-x86_64) (push) Canceled after 0s
Distributions / Wheels and CLI (linux-x86_64) (push) Canceled after 0s
Distributions / Source distribution and metadata (push) Canceled after 0s
Test and document the 32-bit Total Commander extension workaround
2026-11-05 17:49:14 -05:00

UC2: UltraCompressor II

A cross-platform revival of UltraCompressor II, the DOS-era archiver by Nico de Vries (1992-1996). UC2 used shared compression dictionaries ("master blocks") and file versioning.

UC2 v3 is under development in portable C99. The current alpha is 3.0.0a5. Compression levels 2-5 use the original Huffman format; levels 6-9 require the new rANS reader. Original-format compatibility is covered by DOSBox-X fixtures, but some legacy methods, including Turbo/method 80, remain unsupported.

Features

The command-line tool creates, lists, tests, and extracts archives. It supports nested directories, stored file versions, shared master blocks, output to stdout, tab-separated listings, and a quiet mode for scripts.

  • LZ77 with Huffman coding at levels 2-5, or rANS at levels 6-9.
  • Content-defined chunking and identical-chunk deduplication through --ingest. The resulting archive is self-contained; --ingest-restore reconstructs the input stream. A tar input remains a byte stream of part-N entries.
  • Compression comparisons through -B, including the library's LZ4 method.
  • OpenTimestamps proof attachment, extraction, and inspection.
  • Readers for libarchive/bsdtar, Midnight Commander, and Total Commander.
  • A Python reader API with entry metadata, stored versions, streamed decoding, verification, and extraction limits.
  • A read-only Linux FUSE mount with separate version views and a bounded cache of verified decoded files.
  • Builds for Linux, macOS, Windows (MSVC), and DOS (DJGPP).

The library also contains a 64-bit Merkle DAG, a shared block store, SimHash, binary delta coding, dictionary metadata, and BCJ/BWT/delta preprocessing. These modules are not all connected to the CLI archive writer. Its BLAKE3 module currently fails official test vectors and must not be used for integrity claims; it is not used by the current archive read/write path. The repair is tracked in ROADMAP.md.

See the updated collection benchmarks for measured size, time, and memory comparisons with 7z and tar+zstd.

Install

python -m pip install --pre uc2
uc2 -l archive.uc2

The Python package includes the native CLI. Wheels support CPython 3.10-3.14 on Linux x86-64, Windows x86-64, and Intel/Apple Silicon macOS. Standalone CLI downloads do not require Python. These are alpha releases.

from uc2 import UC2File

with UC2File("archive.uc2") as archive:
    print(archive.namelist())
    archive.verify()
    archive.extractall("restored")

See the Python documentation for limits, stored versions, error handling, and extraction behavior.

Building

Requires CMake >= 3.16 and a C99 compiler (GCC, Clang, or MSVC).

cmake -B build
cmake --build build
ctest --test-dir build --output-on-failure -E roundtrip_dosbox

The CMake CLI integration tests require Python 3.11 or newer. The Python package itself supports Python 3.10 or newer. The separate roundtrip_dosbox test requires the DOSBox-X environment described in tests/scripts/roundtrip_dosbox.sh.

Usage

uc2 -w archive.uc2 files...            # Create archive
uc2 archive.uc2                        # Extract all files
uc2 -l archive.uc2                     # List contents
uc2 -t archive.uc2                     # Test integrity
uc2 -d /tmp/out archive.uc2            # Extract to directory
uc2 -w -L 8 archive.uc2 files...      # Create with rANS Tight
uc2 -B files...                        # Benchmark all methods

Compression Levels

Level Method Description
2 Huffman Fast
3 Huffman Normal
4 Huffman Tight (default)
5 Huffman Ultra
6 rANS Fast
7 rANS Normal
8 rANS Tight
9 rANS Ultra

Levels 2-5 produce archives readable by the original 1992 UC2 Pro. Levels 6-9 use rANS entropy coding (UC2 v3 only).

Options

Flag Description
-w Create archive
-l List archive contents
-t Test archive integrity
-L n Compression level (2-9)
-B Benchmark all methods on input files
-d path Extract to specified directory
-f Overwrite existing files
-p Extract to stdout
-q Quiet (suppress status messages)
-a Include all file versions
-D Skip directory metadata; -DD also skips file metadata
-T Tab-separated output

Stream ingestion

tar cf - project/ | uc2 --ingest backup.uc2
uc2 --ingest-restore backup.uc2 > restored.tar

Ingestion keeps a small payload buffer and spools unique raw chunks to a temporary file. Memory for chunk indexes and directory entries grows with the number of chunks. The writer replaces the output only after completing the archive. A killed process can leave a sibling .tmp-* file; the previous output remains intact. The format and this writer use 32-bit size limits.

Project Structure

UC2/
  lib/              libuc2 compression/decompression library
    include/uc2/    public headers (libuc2, uc2_cdc, uc2_merkle, uc2_rans, ...)
    src/            library implementation
  cli/              uc2 command-line tool
  python/           Python reader API and native extension
  tests/            unit tests and test corpus
  original/         preserved original UC2 Pro sources (reference only)
  contrib/          libarchive and file-manager integrations
  docs/             documentation and benchmark results

Credits

  • Nico de Vries: Original UltraCompressor II (1992-1996)
  • Danny Bezemer: Co-developed the original UC2
  • Vladislav Sagunov: Requested the free-software source release (2015)
  • Jan Bobrowski: Clean-room portable decompressor (unuc2/libunuc2, 2020-2021)
  • Eremey Valetov: UC2 v3 revival, compression engine, deduplication, and ongoing development

See CREDITS.md for full attribution.

History

  • v1.0 to v2.3 (1992-1996) Original DOS releases by Nico de Vries
  • 2015 Nico de Vries releases the source under LGPL-3.0 after a request from Vladislav Sagunov
  • 2020-2021 Jan Bobrowski writes unuc2/libunuc2 (portable decompressor)
  • 2026 UC2 v3 development adds a compression engine, rANS, and stream deduplication

License

The project combines GPL-3.0-or-later code and LGPL-3.0-only components. The libarchive adapter and independently written integration glue are available under GPL-3.0-or-later OR BSD-2-Clause. The Total Commander adapter retains Bobrowski's LGPL license. See LICENSE, CREDITS.md, and the per-file license audit.

S
Description
Cross-platform revival of UltraCompressor II (Nico de Vries, 1992-1996). C99, GPL-3.0.
Readme BSD-2-Clause LGPL-3.0-only
3.4 MiB
0 Stars 1 Watchers 0 Forks
Languages
C 40.1%
C++ 32.2%
Python 19.8%
Batchfile 2.4%
CMake 2.2%
Other 3.3%