r/C_Programming • • 3d ago

Project Wrote a multi-core-native, SIMD lossless compression codec, originally for my engine, but just released to github with permissive license!

https://github.com/JoseIgnacioAragon/axz

Hey everyone,

I originally built this compression algorithm for my own game engine because I wanted an open-source middle ground between LZ4 and Zstd for game dev workloads (paks, streaming assets, snapshots, small netcode packets). Full disclosure: I have background in network and low-level optimization, and I used AI to help me bridge the domain gap in compression itself while steering the architecture, profiling, and verifying everything on real hardware.

It turned out useful enough that I split it into a standalone zero-dependency library + CLI in both C11 and native Odin (100% wire-compatible, Apache-2.0, Linux/macOS/Windows):

https://github.com/JoseIgnacioAragon/axz

Quick numbers on the standard 202 MiB Silesia corpus (Intel Core 7 240H, AVX2, in-memory):

  • AXZ -1: 2.21x | 3.36 GiB/s 1T / 17.0 GiB/s 16T decode
  • AXZ -5: 2.90x | 3.24 GiB/s 1T / 17.0 GiB/s 16T decode (matches Zstd -1 ratio while decoding ~2x faster 1T and ~11x faster 16T, since standard Zstd frames don't parallelize decode)
  • On a 32T Ryzen 9 7950X (AVX-512VBMI2) it scales up to 58 GiB/s multi-core decode.

It's multi-core native in the wire format, skips bit-level Huffman/ANS in favor of SIMD planar tables, and includes 11 per-chunk pre-filters (RGBA8, Float4_Xor, Delta, SoA, etc.) plus 8-byte micro-packets + 8 KiB dictionaries for small RPC/netcode payloads. ARM64 NEON isn't in yet (runs scalar fallback for now), and -5 is intentionally slow to encode for offline asset cooking.

1 Upvotes

13 comments sorted by

•

u/AutoModerator 3d ago

Hi /u/Alcacholaruz,

Your submission in r/C_Programming was filtered because it links to a git project.

You must edit the submission or respond to this comment with an explanation about how AI was involved in the creation of your project.

While AI-generated code is not disallowed, low-effort "slop" projects may be removed and it's likely that other users push back strongly on substantially AI-generated projects.

You can read more at How do I post my Project?


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

→ More replies (2)

33

u/tastygames_official 2d ago

> has a background in network and low-level optimization
> still chose to watch while claude did all the work

why are you people like this?

15

u/SystemSigma_ 2d ago

Drugs are addicting by nature

2

u/tastygames_official 2d ago

and the reward is fleeting

6

u/Rabbitical 2d ago

I throw up a little bit every time I read someone talking about "steering the architecture." Look I write slop on occasion too (though I don't feel the need to share it with others because why would anyone else care?). We don't need to come up with euphemisms for it.

7

u/tastygames_official 2d ago • Bravo

my guess is peope who command AI to do their bidding are just psychopaths who couldn't land a management position, so this lets them LARP as one. Normal people get zero sense of accomplishment in handing off tasks to other people - especially when creativity is involved. No creative person is satisfied having an idea and just letting others do it, or even worse: giving a few vague pointers to other people and let them run with it. That's something only psychopaths do. I guess this "AI revolution" is showing us who's really human.

8

u/karurochari 2d ago

Clean room over what? This is constantly reported in the wording of the licence and readme.
I cannot understand if there is a reference implementation which was taken for specifications to be written against and implemented anew.

3

u/al2o3cr 1d ago

How can you know it's "clean-room" if an LLM trained on all the code the provider could find wrote parts of it?

1

u/bazingaboi22 21h ago

Under what situation is lz4 insufficient?

1

u/Vasili_Sk 20h ago

would be nice to have comparsion to existing codecs