SOLID CUDA 13
Hard limits
- Max 400 lines per source file when practical
- Max 30 methods per class
- Keep decoder / pipeline / telemetry modules separate
Typing & boundaries
- Prefer concrete types over
Anyat public boundaries - Wrap vendor SDK objects behind narrow adapters
- Name GPU resources clearly (
surface,decoder,stream) - Document device ownership and reset/reopen behavior
Reliability
- Treat stream reconnect / decoder reset as first-class paths
- Fail with explicit errors; do not swallow CUDA init failures
- Keep CPU orchestration thin; heavy work stays on device code paths
Checklist
- No new
Anyat API boundaries without a typed wrapper plan - Resource lifetime (create/reset/close) is obvious
- File/module stays focused on one GPU concern