Contributing to Tiny-DL-Inference
Thank you for your interest in contributing! This project follows Spec-Driven Development (SDD), meaning all code changes must be guided by specifications in the /specs directory.
Development Workflow
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Review or update specs in
/specs/before coding - Implement your changes following specs
- Test your changes thoroughly
- Commit with conventional commits
- Push and create a Pull Request
Development Setup
Prerequisites
- Node.js 18+
- npm 9+
Installation
bash
# Clone your fork
git clone https://github.com/YOUR_USERNAME/tiny-dl-inference.git
cd tiny-dl-inference
# Install dependencies
npm install
# Verify setup
npm run typecheck
npm test1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
Build Commands
bash
# Type checking
npm run typecheck
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Build distribution
npm run build1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
Code Style
TypeScript
- Strict mode: All code must pass
strict: true - Explicit types: Add return types to exported functions
- No
any: Useunknownwith type narrowing instead
Formatting
Follow .editorconfig:
ini
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true1
2
3
4
5
6
2
3
4
5
6
Naming Conventions
| Type | Convention | Example |
|---|---|---|
| Classes | PascalCase | Conv2dOperator |
| Interfaces | PascalCase | OperatorParams |
| Functions | camelCase | computeOutputShape |
| Constants | SCREAMING_SNAKE_CASE | FLT_MIN |
Commit Messages
Follow Conventional Commits:
feat: add BatchNorm operator
fix: correct padding calculation in Conv2d
docs: update API reference
test: add property tests for Dense operator
refactor: simplify shader compilation
perf: optimize memory layout for NHWC1
2
3
4
5
6
2
3
4
5
6
Testing Guidelines
Test Requirements
- New operators: Must include property tests
- Bug fixes: Must include regression tests
- All changes: Existing tests must pass
Pull Request Process
Before Submitting
- Run all checks:bash
npm run typecheck npm test npm run build1
2
3 - Add tests for new functionality
- Update documentation if needed
PR Description Template
markdown
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix (non-breaking)
- [ ] New feature (non-breaking)
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Added unit tests
- [ ] All tests pass1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
For the complete contributing guide, see GitHub CONTRIBUTING.md.