Skip to content

Commit fd1c399

Browse files
committed
Contribution and AI guidelines
1 parent e0b63f4 commit fd1c399

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed

AGENTS.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# AGENTS.md
2+
3+
## Build & Test
4+
- Build: `cargo build -p renderling`
5+
- Test all: `cargo nextest run -j 1` or `cargo test`
6+
- Single test: `cargo test <test_name>` or `cargo nextest run <test_name>`
7+
- Lint: `cargo clippy`
8+
- Shaders: `cargo shaders` (compile), `cargo linkage` (generate WGSL)
9+
10+
## Code Style
11+
- Max line width: 100 chars
12+
- Imports: group by crate (`imports_granularity = "crate"`), std → external → internal
13+
- Error handling: use `snafu` crate with `#[derive(Debug, Snafu)]`
14+
- Naming: `snake_case` functions/modules, `PascalCase` types, `with_*` builder methods
15+
- Tests: inline `#[cfg(test)] mod test { ... }` within modules
16+
- CPU-only code: wrap with `#[cfg(cpu)]`
17+
18+
## Disallowed Methods (clippy.toml)
19+
Avoid: `Vec{2,3,4}::normalize_or_zero`, `Mat4::to_scale_rotation_translation`, `f32::signum`

CONTRIBUTING.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Contributing to Renderling
2+
3+
Thank you for your interest in contributing to Renderling!
4+
5+
## Code of Conduct
6+
7+
This project follows the [Zcash Code of Conduct](https://github.com/zcash/zcash/blob/master/code_of_conduct.md).
8+
We are committed to providing a welcoming and harassment-free experience for everyone.
9+
10+
## NLnet Generative AI Policy
11+
12+
This is an NLnet-funded project. We adhere to the [NLnet Generative AI Policy](https://nlnet.nl/foundation/policies/generativeAI/).
13+
If you use generative AI tools like LLMs, code assistants, etc. in your contributions, you must:
14+
- Disclose any substantive use
15+
- Maintain a prompt provenance log for material contributions
16+
- Ensure outputs can be legally published under FLOS licenses
17+
- Not present AI-generated content as your own human-authored work
18+
19+
### When it comes to AI - use your best judgment
20+
21+
I use AI to help plan a strategy and then make changes by hand.
22+
23+
What I want to avoid is a situation where copyrighted material from an LLM's training corpus
24+
makes it into the codebase.
25+
26+
So please disclose if the _outputs_ of generative AI is what is being committed.
27+
28+
## Getting Started
29+
30+
1. Fork and clone the repository
31+
2. Install Rust via [rustup](https://rustup.rs)
32+
3. Install `cargo-gpu`: `cargo install --git https://github.com/rust-gpu/cargo-gpu cargo-gpu`
33+
4. Optionally install `cargo-nextest`: `cargo install cargo-nextest`
34+
35+
## Development Workflow
36+
37+
1. Create a branch for your changes
38+
2. Follow the code style guidelines in [AGENTS.md](AGENTS.md)
39+
3. Run tests: `cargo nextest run -j 1` or `cargo test`
40+
4. Run lints: `cargo clippy`
41+
5. If modifying shaders: `cargo shaders && cargo linkage`
42+
6. Ensure there are no unexpected diffs: `git diff`
43+
7. Submit a pull request
44+
45+
## Discussions
46+
47+
Questions, ideas, and general discussion should happen on
48+
[GitHub Discussions](https://github.com/schell/renderling/discussions).
49+
50+
## Testing
51+
52+
Tests render images in headless mode and compare against reference images in `test_img/`.
53+
New visual features should include image comparison tests where applicable.
54+
55+
## License
56+
57+
By contributing, you agree that your contributions will be dual-licensed under
58+
the MIT and Apache 2.0 licenses. See [LICENSE](LICENSE) for details.

0 commit comments

Comments
 (0)