kornia-simd
Skill748 starsChanged 7 days agoApache-2.0View on GitHub
Use when adding or optimizing SIMD (NEON/AVX2) or performance-critical kernels in kornia-imgproc — module layout, dispatch, cross-arch testing, benchmarking and correctness-vs-scalar checks. Trigger on "SIMD", "NEON", "AVX2", "benchmark", "speed up".
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Always keep a scalar fallback.
- Very specific: line 21
Every unsafe intrinsic block has // SAFETY:.
- Very specific: line 25
Test cross-arch with qemu/binfmt as described in SIMD.md or pixi run rust-cross-test-aarch64.
- Distinctive: line 30
Avoid allocations in hot paths.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SIMD / performance in kornia-imgproc
The authoritative guide is crates/kornia-imgproc/SIMD.md; read it first.
Layout
- Multi-kernel op: subdirectory with
mod.rs(public Image API + sealed-trait dispatch) andkernels.rs(slice-level NEON/AVX2/scalar). Canonical example:crates/kornia-imgproc/src/color/gray/. - Single-dtype op: a flat
.rsfile is fine. - Shared helpers live in
crates/kornia-imgproc/src/simd/andparallel.rs.
Rules
- Always keep a scalar fallback; SIMD output must match scalar (assert in tests).
- Every
unsafeintrinsic block has// SAFETY:; gate with#[cfg(target_arch = ...)]; runtime dispatch readscrate::simd::cpu_features(), neveris_x86_feature_detected!directly (it is compile-time-sensitive under-Ctarget-cpu, see SIMD.md). - Test cross-arch with qemu/binfmt as described in SIMD.md or
pixi run rust-cross-test-aarch64. - Benchmark before and after (
cargo bench, best-of-N rounds). Report numbers in the PR. iai-callgrind runner version must exactly match theiai-callgrinddev-dependency version. - Avoid allocations in hot paths; mind rayon row chunking.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- kornia-api-flavorSkill
- kornia-archSkill
- kornia-bindingsSkill
- kornia-code-reviewSkill
- kornia-coding-styleSkill
- kornia-curationSkill
- kornia-workflowSkill
- releaseSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

