Thank you for your interest in contributing to tieredsort! This document provides guidelines and information for contributors.
- Check if the bug has already been reported in Issues
- If not, create a new issue with:
- A clear, descriptive title
- Steps to reproduce the bug
- Expected vs actual behavior
- Your environment (OS, compiler, compiler version)
- Minimal code example if possible
- Open an issue with the
enhancementlabel - Describe the feature and its use case
- If possible, provide a rough implementation idea
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Run tests:
./test - Run benchmarks to ensure no regression:
./benchmark - Commit with a clear message:
git commit -m "Add feature X" - Push and create a Pull Request
# Clone your fork
git clone https://github.com/Cranot/tieredsort.git
cd tieredsort
# Build with CMake
mkdir build && cd build
cmake .. -DTIEREDSORT_BUILD_TESTS=ON -DTIEREDSORT_BUILD_BENCHMARKS=ON
cmake --build .
# Run tests
./test_tieredsort
# Run benchmarks
./benchmark- Use C++17 features where appropriate
- Follow the existing code style
- Use meaningful variable names
- Add comments for complex logic
- Keep functions focused and small
// Functions: snake_case
void radix_sort_32(int* arr, size_t n);
// Types/Classes: PascalCase (but we mostly use functions)
struct SortConfig { ... };
// Constants: UPPER_SNAKE_CASE
constexpr int SMALL_ARRAY_THRESHOLD = 256;
// Namespaces: lowercase
namespace tiered { ... }All contributions must include tests. Add tests to tests/test_tieredsort.cpp:
// Test pattern: test_<type>_<pattern>
void test_int32_random() {
std::vector<int32_t> data = generate_random<int32_t>(10000);
auto expected = data;
std::sort(expected.begin(), expected.end());
tiered::sort(data.begin(), data.end());
assert(data == expected);
}When adding new features, ensure they don't regress performance:
# Before your changes
./benchmark > before.txt
# After your changes
./benchmark > after.txt
# Compare
diff before.txt after.txtWe're particularly interested in contributions for:
- AVX2 implementation for 8x int32 parallelism
- AVX-512 for even more parallelism
- ARM NEON for mobile/ARM servers
- int16_t, uint16_t support
- int8_t, uint8_t support
- Custom key extraction (like ska_sort)
- Thread pool for very large arrays
- Work-stealing for better load balancing
- More real-world data patterns
- Comparison with more libraries
- Memory bandwidth analysis
Feel free to open an issue with the question label or reach out directly.
By contributing, you agree that your contributions will be licensed under the MIT License.