GXD v0.0.0a2: Major Updates and New Features

Published: (December 22, 2025 at 10:07 PM EST)
3 min read
Source: Dev.to

Source: Dev.to

Release Information

Release Date: December 2025
Author: @hejhdiss (Muhammed Shafin p)
Status: Alpha Release

GXD Compression Utility has received significant updates in version 0.0.0a2, introducing intelligent compression, enhanced metadata tracking, and a better user experience. This release transforms GXD from a simple block‑based compressor into a smart, adaptive archival tool.

Note on Versioning – Although the feature set has grown considerably, the version number remains 0.0.0a2 because the software is still in the alpha phase. Version numbers may not increment with each update during this stage. The alpha designation indicates that APIs/formats may still change.

New Feature: Auto Mode (--algo auto)

The most significant addition is auto mode, which automatically selects the best algorithm for each individual block.

How It Works

  1. Analyze each block

    • Shannon entropy (0.0 – 8.0 scale)
    • Zero‑byte density
    • Unique byte ratios
  2. Decision logic determines the optimal algorithm per block.

  3. The chosen algorithm is stored in the block’s metadata.

Decision Logic

ConditionSelected Algorithm
Entropy > 7.9none (already compressed/encrypted)
Zeros > 40 % or Entropy …see code snippet below
def calculate_entropy(data: bytes) -> float:
    """Return Shannon entropy of *data* (0.0‑8.0)."""
    if not data:
        return 0.0
    counter = collections.Counter(data)
    entropy = 0.0
    for count in counter.values():
        p_x = count / len(data)
        entropy -= p_x * math.log2(p_x)
    return entropy

Smart Selector Class

class GXDSmartSelector:
    @staticmethod
    def predict(data: bytes) -> str:
        """Predict the best compression algorithm for *data*."""
        entropy = calculate_entropy(data)
        metrics = calculate_metrics(data)          # e.g., zero_ratio, unique_ratio
        zeros = metrics['zero_ratio']

        if entropy > 7.9:
            return "none"
        if zeros > 0.4 or entropy:  # Note: Your existing `.gxd` archives work perfectly with the new version.
            # (additional logic would go here)
            pass

Leveraging the New Features

# Auto mode on a new compression
python gxd.py compress data.bin data.gxd --algo auto

# Inspect an existing archive
python gxd.py info old_archive.gxd

# Re‑compress for attribute preservation
# 1️⃣ Decompress the old archive
python gxd.py decompress old.gxd -o data.bin

# 2️⃣ Re‑compress with the new version (captures attributes)
python gxd.py compress data.bin new.gxd

Required Libraries

pip install zstandard lz4 brotli

If any library is missing, auto mode will fail with a clear error message.

Platform‑Specific Notes

  • Full support: Unix/Linux
  • Partial support: Windows (permissions may not restore)
  • Cross‑platform archives: May lose some attributes

Permissions Required

  • Restoring uid/gid needs appropriate system permissions.
  • The tool falls back gracefully with a warning if permissions are insufficient.

Disclaimer & Future Ideas

The author is not committed to regular updates. The following are potential ideas that may or may not be implemented:

  • Machine‑learning‑based algorithm selection
  • Compression dictionaries for better ratios
  • Multi‑volume archive support
  • GUI for archive inspection
  • Plugin system for custom algorithms
  • Differential / incremental compression
  • Block‑level deduplication (duplicate‑block detection)
  • Content‑aware deduplication (hash‑based chunk identification)

Community contributions toward any of these features are welcome!

Recommendations

✅ Use auto when…❌ Skip auto when…
Compressing diverse file types togetherAll data is the same type (e.g., only text logs, only images)
Unsure about data characteristicsSpeed is absolutely critical
Maximum compression efficiency is the goalYou’ve profiled and know the best algorithm
Data includes pre‑compressed contentWorking with very small files (e.g., /dev/null)
# Quick metadata verification
python gxd.py info data.gxd

# Extract a sample for testing
python gxd.py seek data.gxd --offset 0 --length 1mb --text

Current Version

0.0.0a2 (Alpha)

Installation

# Clone the repository
git clone https://github.com/hejhdiss/gxd.git
cd gxd

# Install dependencies
pip install zstandard lz4 brotli tqdm

# Verify installation
python gxd.py --version

Quick Start

# Try auto mode
python gxd.py compress yourfile.bin output.gxd --algo auto

# Inspect results
python gxd.py info output.gxd

# Decompress
python gxd.py decompress output.gxd -o restored.bin

Contributing & Support

  • Found a bug? Open an issue on GitHub.
  • Have an idea? Share it in Discussions.
  • Want to contribute? Pull requests are welcome.
  • Questions? Check the documentation or ask the community.

Remember: this is an alpha release provided as‑is. Updates may or may not come regularly, but community contributions can help drive future development.

Back to Blog

Related posts

Read more »

Verdichtung

Article URL: https://alexeygy.github.io/blog/verdichtung/ Comments URL: https://news.ycombinator.com/item?id=46400242 Points: 11 Comments: 1...