Welcome Contributors
Thank you for your interest in contributing to Hydra! This guide will help you get started with contributing code, reporting issues, and collaborating with the community.Getting Started
Prerequisites
Before contributing, make sure you:- Build Hydra from source - See Building
- Understand the architecture - Read Architecture
- Join the Discord - Hydra Discord Server for real-time discussion
- Review existing issues - Check GitHub Issues
Setting Up Your Development Environment
Code Style Guidelines
Hydra follows strict code style guidelines to maintain consistency across the codebase.C++ Code Style
Formatting
Hydra uses clang-format for automatic code formatting. The configuration is defined in.clang-format:
Naming Conventions
Pointer and Reference Alignment
Headers and Includes
Swift Code Style (SwiftUI Frontend)
CMake Style
Compilation Requirements
Compiler Warnings
Hydra treats all warnings as errors via-Werror. Ensure your code compiles without warnings:
C++ Standards
- Required: C++20
- Features used: Concepts, ranges, designated initializers, modules (future)
Development Workflow
Creating a Feature Branch
Commit Messages
Write clear, descriptive commit messages:Commit Guidelines
- One logical change per commit
- Prefix with component area (gpu, cpu, service/xxx, frontend, build, docs)
- Use imperative mood (“Add feature” not “Added feature”)
- Keep first line under 72 characters
- Add detailed explanation for complex changes
Pull Request Process
Before Submitting
Code quality checks
- Code compiles without warnings
- clang-format applied
- No debug code or commented-out sections
- All new code follows style guidelines
Testing
- Test with multiple games/homebrew
- Verify no regressions
- Check both Debug and Release builds
Submitting a Pull Request
Create pull request
Go to https://github.com/SamoZ256/hydra/pulls and click “New Pull Request”
PR Review Criteria
Your PR will be reviewed for:- Code quality: Follows style guidelines, well-structured
- Correctness: Implements feature correctly, no bugs introduced
- Performance: No unnecessary performance regressions
- Compatibility: Works on all supported macOS versions
- Documentation: Code is well-commented and documented
Areas for Contribution
High Priority
- Service implementations: Many system services need implementation
- GPU accuracy: Improve Maxwell emulation accuracy
- Performance: Optimize hot paths
- Game compatibility: Fix issues with specific games
Service Implementation
To implement a new service:- Check
src/core/horizon/services/for existing patterns - Create service class inheriting from
Service - Implement IPC command handlers
- Register service in service manager
- Test with games that use the service
GPU Features
To add GPU features:- Study Maxwell architecture documentation
- Locate relevant engine code (
src/core/hw/tegra_x1/gpu/engines/) - Implement in Metal renderer (
src/core/hw/tegra_x1/gpu/renderer/metal/) - Update shader decompiler if needed
Frontend Improvements
- SDL3: Improve controller support, add hotkeys
- SwiftUI: Enhance UI/UX, add features
Testing Guidelines
Manual Testing
Test your changes with:- Homebrew apps: Simple test cases
- Commercial games: Real-world testing
- Edge cases: Unusual configurations
Regression Testing
- Verify previously working games still work
- Test both frontends (SDL3 and SwiftUI)
- Test Debug and Release builds
Performance Testing
Debugging
GDB Debugger
Hydra includes a built-in GDB server:Xcode Debugging
Logging
Usefmt::print for debug logging:
Communication
Discord Server
Join the Hydra Discord for:- Development discussion
- Technical questions
- Coordination on features
- Community support
GitHub Discussions
Use GitHub Discussions for:- Feature proposals
- Architecture discussions
- Long-form technical topics
Issue Tracker
Use GitHub Issues for:- Bug reports
- Feature requests
- Tracking work
Reporting Issues
When reporting bugs, include:License
Hydra is licensed under GPL-3.0. By contributing, you agree that your contributions will be licensed under the same license. Key points:- All contributions must be compatible with GPL-3.0
- Original code must be your own or properly attributed
- Third-party code must have compatible licenses
Code of Conduct
Be Respectful
- Treat all contributors with respect
- Welcome newcomers
- Provide constructive feedback
- Be patient with questions
Be Collaborative
- Discuss design decisions openly
- Accept feedback gracefully
- Help review others’ contributions
- Share knowledge
Quality Standards
- Write clean, maintainable code
- Test thoroughly before submitting
- Document complex logic
- Follow established patterns
Resources
Documentation
- Building Guide: Building from Source
- Architecture: System Architecture
- GitHub: SamoZ256/hydra
External Resources
- Nintendo Switch Homebrew: switchbrew.org
- Metal Documentation: Apple Metal
- ARM Architecture: ARM Developer
- Maxwell GPU: NVIDIA documentation
Community
- Discord: Join Server
- GitHub Issues: Issue Tracker
- GitHub Discussions: Discussions