Contributing to DGX-Pixels
Thank you for your interest in contributing to DGX-Pixels! This document provides guidelines for contributing to the project.
Getting Started
Prerequisites
- Hardware: NVIDIA DGX-Spark (GB10 Grace Blackwell Superchip) or compatible NVIDIA GPU
- OS: Ubuntu 22.04 LTS (ARM64 or x86_64)
- Software:
- Rust 1.70+ (for TUI development)
- Python 3.10+
- CUDA 13.0+
- Docker with NVIDIA Container Toolkit
- Nushell 0.96+ (for automation scripts)
- Just (command runner)
- Git and GitHub CLI (
gh)
Initial Setup
# Clone the repository
git clone https://github.com/raibid-labs/dgx-pixels.git
cd dgx-pixels
# Initialize project (creates directories, virtual env, etc.)
just init
# Validate your hardware
just validate-gpu
# Run tests to verify setup
just testDevelopment Workflow
1. Agent-Based Development (Automated)
DGX-Pixels uses an agent-based workflow where AI agents implement workstreams. Each agent:
- Creates a branch for the issue/workstream
- Implements the changes following the workstream specification
- Runs tests (TDD approach: write tests first!)
- Creates a Pull Request with detailed summary
- Rebases onto latest main before merging
- Auto-merges after CI passes (squash merge)
Agent Workflow Commands
# Create branch for workstream WS-01
just branch WS-01
# Or using nushell directly:
use scripts/nu/modules/github.nu *
gh-create-branch "ws01-hardware-baselines"
# After implementing changes:
gh-create-pr "Implement WS-01: Hardware Baselines" --labels [workstream, M0]
# Enable auto-merge (squash)
gh-auto-merge --merge-method squash
# Before starting next workstream, rebase onto main
gh-rebase-main2. Manual Development (Human Contributors)
If you’re contributing manually (not via agent workflow):
Step 1: Pick a Workstream/Issue
- Browse open issues labeled
status:ready - Check
docs/orchestration/workstream-plan.mdfor available workstreams - Ensure you have the required skills (Rust, Python, ML, DevOps)
- Verify dependencies are met (blocked workstreams can’t start yet)
Step 2: Create a Branch
# Standard naming: workstream ID or feature description
git checkout -b ws01-hardware-baselines
# Or for bug fixes/features
git checkout -b fix/gpu-detection
git checkout -b feature/sixel-previewStep 3: Implement Using TDD
Test-Driven Development (TDD) is required:
# 1. Write tests FIRST (they will fail - that's expected!)
# For Rust:
touch rust/tests/ws01_hardware_baselines.rs
# Write tests...
# For Python:
touch python/tests/test_ws01_hardware_baselines.py
# Write tests...
# 2. Commit the failing tests
git add tests/
git commit -m "test: add tests for WS-01 hardware baselines"
# 3. Implement the functionality to make tests pass
# Write code...
# 4. Verify tests pass
just test
# 5. Commit implementation
git add src/
git commit -m "feat(ws01): implement hardware baseline detection"Step 4: Code Quality Checks
# Run all quality checks
just ci
# Or individually:
just fmt # Format code
just lint # Run linters (clippy for Rust)
just test # Run all tests
just test-coverage # Check coverage (aim for ≥80%)Step 5: Create Pull Request
# Push your branch
git push -u origin ws01-hardware-baselines
# Create PR using GitHub CLI
gh pr create \
--title "feat(WS-01): Implement hardware baselines" \
--body "$(cat <<EOF
## Summary
Implements WS-01: Hardware Baselines
## Changes
- Added hardware detection script (nushell)
- Created baseline JSON export
- Updated docs/hardware.md with actual measurements
- Added tests for all detection functions
## Workstream
WS-01: Hardware Baselines (Foundation domain)
## Acceptance Criteria
- [x] Hardware verification script exists and runs successfully
- [x] Baseline JSON recorded in \`bench/baselines/\`
- [x] docs/hardware.md updated with actual measurements
- [x] All hardware specs verified: GB10, 128GB unified, ARM CPU
## Test Results
\`\`\`
cargo test --workspace
...all tests passing...
pytest python/tests/
...all tests passing...
\`\`\`
## Dependencies
- None (first workstream, blocks all others)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)" \
--label "workstream,M0,foundation"Step 6: Address Review Feedback
# Make changes based on review
# Commit and push
git add .
git commit -m "fix: address review feedback"
git pushStep 7: Rebase Before Merge
Always rebase onto latest main before merging:
# Update main
git checkout main
git pull origin main
# Rebase your branch
git checkout ws01-hardware-baselines
git rebase main
# Force push (rebased commits)
git push --force-with-leaseStep 8: Merge (Squash)
Once CI passes and PR is approved:
- Use Squash and Merge (keeps history clean)
- Delete branch after merge
- Start next workstream
Commit Message Guidelines
Follow Conventional Commits:
Format
<type>(<scope>): <subject>
[optional body]
[optional footer]
Types
feat: New featurefix: Bug fixdocs: Documentation changestest: Add or update testsrefactor: Code refactoringperf: Performance improvementschore: Build process, dependencies, toolingci: CI/CD changes
Scopes
ws01,ws02, etc.: Workstream-specifictui: Rust TUI componentsbackend: Python backend workercomfyui: ComfyUI integrationtraining: LoRA training pipelinebevy: Bevy integrationdocs: Documentationci: CI/CD configuration
Examples
feat(ws01): implement hardware baseline detection
- Add nushell script for GPU detection
- Export baseline metrics to JSON
- Update hardware.md with verified specs
Closes #PIXELS-001
test(backend): add tests for ZeroMQ communication
- Test REQ-REP pattern
- Test PUB-SUB pattern
- Test error handling and reconnection
fix(tui): resolve Sixel rendering on ARM architecture
The Sixel library had issues on ARM. Switched to a pure Rust
implementation that works across architectures.
Fixes #PIXELS-035
Code Style
Rust
- Follow Rust API Guidelines
- Run
cargo fmtbefore committing - Run
cargo clippy -- -D warnings(no warnings allowed) - Document public APIs with doc comments
- Write tests for all public functions
Python
- Follow PEP 8
- Use type hints (Python 3.10+ syntax)
- Run
ruff formatorblackbefore committing - Docstrings for all functions/classes (Google style)
- Write tests using pytest
Nushell
- Follow examples in
scripts/nu/config.nu - Use header template for all scripts
- Export functions that other modules might use
- Add doc comments for all exported functions
- Use consistent logging (log-success, log-error, etc.)
Testing Requirements
Minimum Coverage
- Overall: ≥80% code coverage
- Critical paths: 100% coverage (GPU detection, model loading, API endpoints)
- New features: Must include tests
Test Categories
- Unit Tests: Test individual functions/modules
- Integration Tests: Test component interactions
- Performance Tests: Verify speed/latency targets
- End-to-End Tests: Full workflow validation
Running Tests
# All tests
just test
# With coverage
just test-coverage
# Integration tests only
just test-integration
# Performance benchmarks
just benchDocumentation Requirements
Required Documentation
Every workstream must include:
-
Code Documentation:
- Rust: Doc comments (
///) for all public APIs - Python: Docstrings for all functions/classes
- Nushell: Export comments for all functions
- Rust: Doc comments (
-
Usage Examples:
- In-code examples
examples/directory for complete examples- README in each major component directory
-
Completion Summary:
- Create
docs/orchestration/workstreams/wsXX-name/COMPLETION_SUMMARY.md - Include: deliverables, test results, known limitations, next steps
- Create
Updating Documentation
# Generate Rust docs
just docs
# Serve docs locally
just docs-serve
# Update relevant markdown files in docs/Workstream Implementation
Workstream Structure
Each workstream has:
- Specification:
docs/orchestration/workstreams/wsXX-name/README.md - Deliverables: Files/components to create
- Acceptance Criteria: Testable requirements
- Dependencies: What must complete first
Implementation Steps
- Read the Spec: Thoroughly review workstream README
- Verify Dependencies: Ensure blocking workstreams are complete
- Plan Implementation: Break down into phases (Foundation → Core → Testing)
- Write Tests First: TDD approach
- Implement: Follow the spec’s technical requirements
- Verify: Run all verification commands from spec
- Document: Create completion summary
- Submit PR: Use template with acceptance criteria checklist
Pull Request Guidelines
PR Title Format
<type>(<scope>): <description>
Examples:
- feat(WS-01): Implement hardware baselines
- fix(tui): Resolve Sixel rendering on ARM
- docs(orchestration): Update workstream dependencies
PR Description Template
## Summary
One paragraph describing the changes.
## Workstream
WS-XX: Workstream Name (Domain)
## Changes
- Bullet point list of changes
- Be specific
## Acceptance Criteria
- [x] Criterion 1
- [x] Criterion 2
- [ ] Criterion 3 (if any remain)
## Test Results
\`\`\`
Paste test output here
\`\`\`
## Dependencies
- Depends on: #PIXELS-XXX
- Blocks: #PIXELS-YYY
## Screenshots/Demos
(If applicable)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>PR Checklist
Before submitting:
- Code follows style guidelines
- Tests added/updated and passing
- Coverage ≥80%
- Documentation updated
- Commit messages follow conventions
- No merge conflicts
- CI checks passing
CI/CD Pipeline
Automated Checks
Every PR runs:
- Rust Tests:
cargo test --workspace - Rust Linting:
cargo clippy -- -D warnings - Rust Formatting:
cargo fmt --check - Python Tests:
pytest python/tests/ - Build Verification:
cargo build --release
Local Pre-Commit
Run before pushing:
just pre-commitIssue Labels
Status Labels
status:draft- Issue needs more definitionstatus:ready- Ready for implementationstatus:in-progress- Agent/developer working on itstatus:review- PR submitted, needs reviewstatus:completed- Done and merged
Priority Labels
priority:P0- Critical path, blocks other workpriority:P1- High prioritypriority:P2- Nice to have
Domain Labels
domain:foundation- M0 workstreamsdomain:model- M1/M3 workstreamsdomain:interface- M2 workstreamsdomain:integration- M4/M5 workstreams
Type Labels
workstream- Part of orchestrated workstream planbug- Bug fixenhancement- New featuredocumentation- Documentation changes
Questions?
- Documentation: See
docs/directory - Workstreams: See
docs/orchestration/workstream-plan.md - Orchestration: See
docs/orchestration/meta-orchestrator.md - Architecture: See
docs/02-architecture-proposals.md - Hardware: See
docs/hardware.md
For questions not covered in documentation:
- Open a GitHub Discussion
- Check existing issues for similar questions
Thank you for contributing to DGX-Pixels! 🎨🤖