Rendered at 21:48:35 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
Wicher 2 days ago [-]
Does it allow for padding so that the start of files can be (memory/filesystem)-page aligned? That allows for mmap-ing non-compressed members and also for reflinking in/out contents from/to the filesystem (on Linux with btrfs, XFS). With tar it's possible with some padding tricks involving PAX comments, see https://pkg.go.dev/nontrivialpursuit.org/deduptar (mine!).
For any new format I'd like to have that flexibility at least in the format; the utilities can implement it later or not at all but at least the format should allow for the required alignment.
Try getting it into as many distros as possible, lest it won't have any chance of being adopted.
brmmm3 2 days ago [-]
I'm working on this.
lifthrasiir 2 days ago [-]
I can't figure out the actual file format, partly because your document exposes bare UMLs [1]. Also ideally you better do the runtime detection for x86-64 features (otherwise, well, you need to do what you are doing now).
(I have much more ambitious and possibly competiting format called Aqueous [2], as you may have seen in r/rust, but these points are genuine advices for you ;-)
You're right. github shows UML files as source. I'll correct this. Runtime detection of CPU features is a good idea.
bonki 1 days ago [-]
This looks pretty cool! Is it (or would it be) possible to have multiple adjacent root commits?
Example use case: Store multiple versions of a game (which means they don't really share a chronological history, but possibly share assets which can be deduplicated)?
This would avoid having to deal with subfolders inside the archive and push the abstraction from the file layout to the archive format. Being able to store unrelated archives inside the same file would be great.
Also, can commits be named?
brmmm3 1 days ago [-]
Commits are organized in a chain, not in a tree. So there is not root commit. If you add same files with the next commit then only links to existing data are added. The same content will not be added twice. The files are stored in the same layout as the file tree(s). And yes, every commit can have a name (max 64 characters) and a description (max 8 lines by max 128 characters each line). Existing commits can be modified: name, description, encryption. Several commits can be joined to cleanup the archive.
If you want to store data, which is unrelated to the files stored, then you can use the arbitrary metadata feature. This feature lets you store keys with values and strings.
For metadata keys the same limitations as for commit names apply. Metadata values can have 1024 characters max. This metadata is also stored as commits.
bonki 1 days ago [-]
I get that commits are a chain (commit #1 is still a root commit for the chain), hence my question. If I want to store multiple unrelated "things" in a single archive the chain-methodology doesn't really make much sense across these "things". My question/proposal regards having the option to store multiple commit-chains in a single file side by side which don't concern eachother (dedup aside) so something along these lines would be possible:
Ok I get it. You want to select a specific group of commits with the slot mechanism. This is currently not supported, but is a good idea.
bonki 1 days ago [-]
Yes, basically! I'd like to be able to use "slot" (don't use that terminology, I was just too lazy to think of something better ad hoc) like a file within a file which gives you grouping options:
a) bundle related file structures together which share no history (e.g. oranges + grapefruits)
b) bundle unrelated file structures together which are related to a 3rd party (e.g. alice's oranges + bob's oranges)
Usually you would just throw everything in subfolders inside the archive but this has a lot of drawbacks (both ergonomical as well as technical) and I can think of all sorts of use cases where this would be very handy.
brmmm3 1 days ago [-]
Currently you can only set the last commit for viewing/extracting the contents. The idea is that you can go back in history and always see the full contents up to the selected commit. Original idea was to be able to do updates in the archive very quickly without the need for rewriting/recompressing the whole archive.
Your idea is a complete different use case, but interesting and not too complicated to implement. Next version will support:
- Select first and last commit
- Select commits by commit name, where name ca be an fnmatch filter. So you can select for example all commits which are related to mail with "mail*"
bonki 1 days ago [-]
I was imagining completely separate commit chains which can't spoil eachother. I guess your idea boils down to more or less the same or a similar thing but I see several disadvantages, e.g. that commit names (and other metadata) must be file-unique (as opposed to slot-unique), and accessing commits of a certain slot via filtering would always require to traverse the whole archive's commit chain. The upside is you don't have to introduce a potential change to the file format. I like the filtering idea and would welcome it on top, but not as a solution to what I had in mind. To me they are related but not the same thing.
brmmm3 16 hours ago [-]
0.19.0 is now available which supports the features I described. I do not want to add another selection layer, because it makes zar more complicated. I want to keep it lean and simple. With suitable commit naming it should be possible that zar is doing what you need.
bonki 47 minutes ago [-]
Sadly no, it doesn't really solve any of the use cases I had in mind.
Thanks for your comment. I've already made a test implementation with mzstd and saw that zar is slower with that. So I'll keep using zstd.
bad_username 2 days ago [-]
Reminds me of restic (local storage mode), but with just one file instead of a whole repo.
peter_d_sherman 2 days ago [-]
Parallel (and GPU, if available) compression in archivers is a highly desirable feature!
arkg03 2 days ago [-]
with someone who has no idea what this product is how do you explain it? just wanna know more about this.
brmmm3 2 days ago [-]
Of course.
As you already know zip, 7z, tar this project provides a new archive format including tools for users and a library for developers.
The reason why I'm developing it is that I'm not satisfied with the exsting archivers. They all are very slow and not using the full power of today's CPUs and SSDs. zar does. It is very fast. My measurements have shown up 22 times faster than 7z with LZMA2. But this depends much on the OS, data and hardware.
And it comes with much more features which other archives don't provide and you may like:
- Versioning: With zar you can add/remove/replace (same) files to/in existing zar archives. This gives you the possibility to have several versions of a file in the archive. Example: You have an Excel file which you change from time to time. You can have all versions in that one zar file. Every action done on the zar archive is called a commit, as you may already know from git.
- Encryption: You can encrypt each commit individually. This gives you the possibility to have data with different protection levels in one file. For example you have a team of developers and want to provide specific project information/data to specific people. You can distribute this single file to all team members and everyone sees only what he is allowed to see.
- Streaming: zar supports streaming. For example you can stream only parts of a zar file to other machines. So the clients don't need to download and temporary extract the whole zar file.
- Mounting: You can mount a zar file, like an iso file, and access the contents with a file explorer.
- grep: zar has an integrated grep feature. So you can search for contents in a zar archive without extracting it.
- AI support: zar also comes with an MCP which gives the AI direct access to zar files.
childintime 2 days ago [-]
I admire your ambition to replace a whole ecosystem. Next you'll integrate a cooperative kernel and make an app store for it, so you can run apps cross platform on top of the file format? Just kidding of course.. you seem crazy enough to do it, in a good way.
Come to think of it, if you include a link to a UI, that opens as a webpage, downloaded, and serve the contents of the zar to it, it may actually be a nice hybrid format. Haven't thought it through though.
brmmm3 2 days ago [-]
You're absolutely right, I'm crazy ;-) I want to build a possible replacement for zip and 7z. tar not, because it is good for other usage scenarios.
Your thought is maybe already implemented. See examples in zarlib. There you've a streaming server and client example. The server is able to handle a folder with zar files and the client can select arbitrary files in the available zar files to stream them to the destination machine.
For any new format I'd like to have that flexibility at least in the format; the utilities can implement it later or not at all but at least the format should allow for the required alignment.
(I have much more ambitious and possibly competiting format called Aqueous [2], as you may have seen in r/rust, but these points are genuine advices for you ;-)
[1] https://github.com/brmmm3/zar-rs/blob/master/doc/zar-file-fo...
[2] https://lifthrasiir.github.io/aqueous/
Example use case: Store multiple versions of a game (which means they don't really share a chronological history, but possibly share assets which can be deduplicated)? This would avoid having to deal with subfolders inside the archive and push the abstraction from the file layout to the archive format. Being able to store unrelated archives inside the same file would be great.
Also, can commits be named?
a) bundle related file structures together which share no history (e.g. oranges + grapefruits) b) bundle unrelated file structures together which are related to a 3rd party (e.g. alice's oranges + bob's oranges)
Usually you would just throw everything in subfolders inside the archive but this has a lot of drawbacks (both ergonomical as well as technical) and I can think of all sorts of use cases where this would be very handy.
Your idea is a complete different use case, but interesting and not too complicated to implement. Next version will support:
- Select first and last commit
- Select commits by commit name, where name ca be an fnmatch filter. So you can select for example all commits which are related to mail with "mail*"
The only thing with similar features that I know of is ZPAQ. https://mattmahoney.net/dc/zpaq.html
can you avoid zstd?
exiting 'pure rust' breaks the deal for me when considering to include in my project.
[1] https://docs.rs/libzstd-rs-sys/
[2] https://docs.rs/mzstd/
Unfortunately the performance is much worse than with zstd.
Tested with compiled linux kernel 6.1.1:
- zstd: compress ~6s, uncompress ~6s
- mzstd: compress ~7s, uncompress ~8s (encrypted 33s)
Quick test using TurboBench [1]:
Download TurboBench and test both yourself with your data:[1] https://github.com/powturbo/TurboBench
As you already know zip, 7z, tar this project provides a new archive format including tools for users and a library for developers.
The reason why I'm developing it is that I'm not satisfied with the exsting archivers. They all are very slow and not using the full power of today's CPUs and SSDs. zar does. It is very fast. My measurements have shown up 22 times faster than 7z with LZMA2. But this depends much on the OS, data and hardware.
And it comes with much more features which other archives don't provide and you may like:
- Versioning: With zar you can add/remove/replace (same) files to/in existing zar archives. This gives you the possibility to have several versions of a file in the archive. Example: You have an Excel file which you change from time to time. You can have all versions in that one zar file. Every action done on the zar archive is called a commit, as you may already know from git.
- Encryption: You can encrypt each commit individually. This gives you the possibility to have data with different protection levels in one file. For example you have a team of developers and want to provide specific project information/data to specific people. You can distribute this single file to all team members and everyone sees only what he is allowed to see.
- Streaming: zar supports streaming. For example you can stream only parts of a zar file to other machines. So the clients don't need to download and temporary extract the whole zar file.
- Mounting: You can mount a zar file, like an iso file, and access the contents with a file explorer.
- grep: zar has an integrated grep feature. So you can search for contents in a zar archive without extracting it.
- AI support: zar also comes with an MCP which gives the AI direct access to zar files.
Come to think of it, if you include a link to a UI, that opens as a webpage, downloaded, and serve the contents of the zar to it, it may actually be a nice hybrid format. Haven't thought it through though.