RecursiveAI.OneCompress 0.1.0-preview.1

This is a prerelease version of RecursiveAI.OneCompress.
There is a newer version of this package available.
See the version list below for details.
dotnet add package RecursiveAI.OneCompress --version 0.1.0-preview.1
                    
NuGet\Install-Package RecursiveAI.OneCompress -Version 0.1.0-preview.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RecursiveAI.OneCompress" Version="0.1.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RecursiveAI.OneCompress" Version="0.1.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="RecursiveAI.OneCompress" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RecursiveAI.OneCompress --version 0.1.0-preview.1
                    
#r "nuget: RecursiveAI.OneCompress, 0.1.0-preview.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RecursiveAI.OneCompress@0.1.0-preview.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RecursiveAI.OneCompress&version=0.1.0-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=RecursiveAI.OneCompress&version=0.1.0-preview.1&prerelease
                    
Install as a Cake Tool

onearchive-csharp

Compression codecs and archive formats for .NET, written from first principles in managed code. No native dependencies; the compressed bytes are identical on every platform.

Two packages:

  • RecursiveAI.OneCompress - codecs and checksums.
  • RecursiveAI.OneArchive - archive containers and a simple Archive API, built on OneCompress.

Status: 0.1.0-preview.1. OneCompress has Zstandard (frames, skippable frames, dictionaries and dictionary training, long-distance matching, multithreaded compression in fixed-size jobs, the seekable format), LZ4 (block and frame), and CRC32, CRC32C, CRC64, Adler-32 and xxHash64. OneArchive has no containers yet. Both codecs are preview: see below.

byte[] packed = Zstd.Compress(data, new ZstdCompressionOptions { Level = 19 });
byte[] again = Zstd.Decompress(packed);

Build

Requires the .NET 10 SDK (see global.json).

build/ci.sh              # build, test (Checked configuration), NativeAOT/trim smoke
build/ci.sh wasm         # browser-wasm build and a headless run under Node (needs the wasm-tools workload)

Build output goes to artifacts/ (ignored by git). Set ONEARCHIVE_ARTIFACTS to put it elsewhere, for example one directory per git worktree.

Preview codecs

Zstandard and LZ4 are preview while their speed is below the reference tools'. Their compression ratio and byte-identical output are already at the target; speed is what is still being tuned. Their public types carry [Experimental], so using them is a compiler error until you opt in per codec:

Codec Diagnostic ID
Zstandard (including dictionary training and the seekable format) ONECOMPRESS001
LZ4 ONECOMPRESS002
<PropertyGroup>
  <NoWarn>$(NoWarn);ONECOMPRESS001</NoWarn>
</PropertyGroup>

or #pragma warning disable ONECOMPRESS001 around the code that uses it. The marker comes off once the codec meets its speed target.

Where they stand

The target for every codec: compressed size within 1% of the reference tool, and compress and decompress speed at least 0.87 of the reference tool's, at every level. Measured memory to memory against zstd 1.5.7 and lz4 1.10.0, single-threaded unless noted, on Silesia and enwik8 and on small game snapshot payloads with trained dictionaries. Speed is ours divided by the reference (1.00 = same speed). x64 is an AMD Ryzen 9 7950X3D on Linux; arm64 is an Apple M2 on macOS. .NET 10.0.402 with the JIT.

Rows x64 arm64
Zstandard compress, levels -5 to 15 0.56-0.84; size within +0.93% 0.63-0.78
Zstandard compress, levels 16-19 0.76-0.85 (enwik8 16-18 at the target) 0.78-0.87
Zstandard compress, levels 20 and 22 0.86-1.07; enwik8 level 22 size +1.17% 0.90-1.02; enwik8 level 22 size +1.17%
Zstandard decompress 12 of 16 rows at the target; the rest 0.86-0.87 5 of 8 at the target; the rest 0.86-0.87
Zstandard long-distance matching 0.60-0.75; Silesia level 3 size +1.04% 0.66-0.78
Zstandard multithreaded jobs not yet measured 0.68-0.85
Game payloads with dictionaries, compress per-tick frames 1.0-1.4x faster; snapshots and saves 0.26-0.58 10 of 48 rows at the target
Game payloads with dictionaries, decompress 29 of 48 rows at the target; frames 1.02-1.44x faster; the rest 0.83-0.86 not yet measured
LZ4 compress 0.58-0.82; level 2 size +2.2% (Silesia) 0.54-0.83
LZ4 decompress 0.80-0.90 0.82-0.89
Dictionary training not yet measured 3-35x the tool's time, 20-40x its memory; output with our dictionaries within 1% of the tool's overall, up to 2.6% larger on tiny training sets and 1.1-2.1% larger with 64 KiB and larger dictionaries on Silesia

Output is byte-identical across x64 and arm64, the JIT and NativeAOT, with and without hardware intrinsics, at any thread count, and in the browser (WebAssembly).

Layout

  • src/OneCompress, src/OneArchive - the two packages.
  • tests/ - xUnit tests.
  • fuzz/ - in-process mutational fuzz driver and targets.
  • bench/ - benchmarks; the only project that may reference comparison libraries.
  • smoke/aot-trim, smoke/wasm - NativeAOT/trim and browser-wasm smoke apps.
  • build/ci.sh - the script CI and developers run.

Licence

Licensed under either of MIT or Apache-2.0, at your option. Copyright (c) Recursive AI, LLC.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on RecursiveAI.OneCompress:

Package Downloads
RecursiveAI.OneArchive

Archive and container formats (zip, tar, 7z and more) with safe extraction by default.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 0 10/31/2026
0.7.0-preview.1 48 10/30/2026
0.5.1-preview.1 30 10/29/2026
0.5.0-preview.1 40 10/29/2026
0.4.0-preview.1 43 10/29/2026
0.3.0-preview.1 38 10/29/2026
0.2.0-preview.1 42 10/28/2026
0.1.0-preview.1 48 10/28/2026