Aether
Contributing to AetherArch
Contributing to AetherArch
Thank you for your interest in contributing to AetherArch! This document provides guidelines and information for contributors.
License
AetherArch is licensed under Apache-2.0. By contributing, you agree that your contributions will be licensed under the same terms. You retain copyright to your contributions. All contributors must sign the Contributor License Agreement (CLA).
Developer Certificate of Origin (DCO)
All commits must include a Signed-off-by line certifying that you wrote
or have the right to submit the code under the project's license. Add it
automatically with git commit -s. The DCO text is available at
https://developercertificate.org/.
Code of Conduct
As a contributor, you are expected to follow our Code of Conduct at all times. We are committed to providing a welcoming and inclusive experience for everyone.
Getting Started
Prerequisites
- Rust toolchain (see
rust-versioninCargo.tomlfor MSRV) - Git
Building
cargo build --workspace --release
Running Tests
# All tests
cargo test --workspace --release
# Specific crate
cargo test -p aether-core --release
# With output
cargo test --workspace --release -- --nocapture
Linting
cargo clippy --workspace -- -D warnings
cargo fmt --all -- --check
Development Workflow
- Fork and branch: Create a feature branch from
main. - Make changes: Follow the code style guidelines below.
- Test: Ensure all existing tests pass and add tests for new functionality.
- Lint: Run clippy and rustfmt before committing.
- Commit: Use clear, descriptive commit messages.
- Pull request: Open a PR against
mainwith a description of changes.
Code Style
- Follow standard Rust conventions (
rustfmtdefaults). - All public items must have
///rustdoc comments. - Use
thiserrorfor error types,anyhowonly in the CLI binary. - Prefer
Result<T>(fromcrate::error) over rawstd::result::Result. - All predictors must implement the
ProbabilityPredictortrait. - Determinism is critical: predictors must produce bit-identical output across platforms for the same input sequence.
Architecture Guidelines
aether-core: Library crate. No I/O to stdout/stderr. No CLI dependencies.aether-cli: Binary crate. Thin wrapper overaether-corepublic API.- Entropy predictors: One file per predictor in
entropy/. Must implementProbabilityPredictor. - Coding transforms: One file per transform in
coding/. Encode/decode must be inverse operations. - Pipeline:
router.rsdecides method per chunk,compress.rsorchestrates end-to-end,decompress.rshandles extraction.
Adding a New Predictor
- Create
aether-core/src/entropy/your_predictor.rs. - Implement the
ProbabilityPredictortrait (seetraits.rs):predict() -> [f32; 256]— return byte probability distributionpredict_cdf() -> [u16; 257]— return CDF for range coder (15-bit precision)update(byte: u8)— update internal state after observing a bytename() -> &str,predictor_id() -> PredictorIdsave_state() / load_state()— for dictionary pretraining support
- Add a
PredictorIdvariant informat.rsand wire it intoPredictorId::from_u16(). - Register the predictor in
router.rs(make_factory) andaether-cli/src/main.rs. - Add unit tests: determinism, adaptation, roundtrip with range coder.
- Critical: predictions must be deterministic — same input sequence must produce bit-identical CDF output on all platforms (beware f32 FMA differences on ARM vs x86).
Fuzz Testing
AetherArch maintains fuzz targets in fuzz/ using cargo-fuzz / libfuzzer-sys.
Run them with:
cargo +nightly fuzz run fuzz_block_header
cargo +nightly fuzz run fuzz_streaming_metadata
cargo +nightly fuzz run fuzz_decode_block
cargo +nightly fuzz run fuzz_range_coder
When adding new parsing code that handles untrusted input, please add a
corresponding fuzz target. See existing targets in fuzz/fuzz_targets/
for examples.
Unsafe Code Policy
aether-core avoids unsafe code. The only unsafe in the workspace lives
in aether-ffi/src/lib.rs (C FFI boundary, inherently unsafe). If you
believe unsafe is necessary for performance:
- Document the safety invariants in a
// SAFETY:comment. - Add a fuzz target covering the unsafe path.
- Explain in the PR why a safe alternative is insufficient.
Dependency Notes
zstd: Wraps the Clibzstdlibrary viazstd-sys. Requires a C compiler at build time. Thezstd-syscrate vendors the C source and compiles it viacc. This is the only non-Rust dependency in the default build.lz4_flex: Pure Rust, pinned to=0.11.3for format stability. Do not upgrade without verifying that existing archives still decompress correctly.
What Needs Help
Check the docs/ROADMAP.md for current priorities. High-impact areas:
- Performance: Target 2+ MiB/s compression, 5+ MiB/s decompression.
- Platform testing: Verify on Linux, macOS, and Windows.
- Code coverage: Achieve 80%+ coverage on core compression/decompression paths.
- Format freeze: Help validate the
.aetformat spec for 1.0 stability.
Reporting Bugs
- Use GitHub Issues with a clear title and reproduction steps.
- Include: OS, Rust version, AetherArch version, sample input (if possible).
- For security vulnerabilities, see SECURITY.md.
Questions?
Open a GitHub Discussion or reach out via Issues.
Copyright 2024-2026 Craton Software Company Licensed under Apache-2.0.