|
| 1 | +# Contributing |
| 2 | + |
| 3 | +## Build & test |
| 4 | + |
| 5 | +rdmatop is Linux-only (netlink + sysfs). CI runs exactly: |
| 6 | + |
| 7 | +```bash |
| 8 | +cargo build --release |
| 9 | +cargo test |
| 10 | +cargo fmt --check |
| 11 | +cargo clippy -- -D warnings |
| 12 | +``` |
| 13 | + |
| 14 | +Hardware-dependent tests are `#[ignore]`d; on a machine with RDMA NICs or |
| 15 | +GPUs also run `cargo test -- --ignored`. To verify the TUI under load, use |
| 16 | +the traffic generators in `examples/` and cross-check rates against an |
| 17 | +independent source (`ethtool -S`, `amd-smi xgmi`, `nvidia-smi nvlink`). |
| 18 | + |
| 19 | +## Ground rules |
| 20 | + |
| 21 | +- Never crash the TUI over missing hardware — sampling degrades to empty |
| 22 | + rows / `None` fields. |
| 23 | +- Detect hardware at runtime (`dlopen`), not via cargo features. |
| 24 | +- Verify what vendor APIs actually return on real hardware before trusting |
| 25 | + them; leave a short comment citing the observed behavior. |
| 26 | +- Comments: 1–3 lines, explain *why*. New code mirrors its neighbors |
| 27 | + (e.g. a new backend follows `src/nvlink.rs` / `src/xgmi.rs`). |
| 28 | + |
| 29 | +## Pull requests |
| 30 | + |
| 31 | +- One logical change per PR; conventional title (`feat:`, `fix:`, `perf:`, |
| 32 | + `docs:`, `refactor:`). |
| 33 | +- Fill in the PR template with a real test plan and pasted output. If you |
| 34 | + couldn't test on hardware, say so and explain what you verified instead. |
| 35 | +- New behavior needs tests: unit tests for pure logic, an `#[ignore]`d |
| 36 | + smoke test for hardware paths. |
| 37 | + |
| 38 | +## Bug reports |
| 39 | + |
| 40 | +Include: rdmatop version, OS/kernel + driver stack (rdma-core, ROCm, NVIDIA |
| 41 | +driver), hardware models, a screenshot or pasted TUI output, and expected vs |
| 42 | +actual behavior. |
0 commit comments