Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

docs(policy): make the contribution policy simple and honest (#4004)

Dmytro Mishkin0685b1f54b87
diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml
index d0ab23f7f..aff4a19c6 100644
--- a/.github/ISSUE_TEMPLATE/bug-report.yml
+++ b/.github/ISSUE_TEMPLATE/bug-report.yml
@@ -1,7 +1,7 @@
name: 🐛 Bug Report
description: Something is broken or gives wrong results
title: "[Bug]: "
-labels: ["bug"]
+labels: ["bug :bug:"]
body:
- type: markdown
@@ -9,9 +9,8 @@ body:
value: |
Thanks for the report! Please search existing issues first.
- **Want to fix it yourself?** You don't need permission: send a PR with a test
- that fails on `main` plus your fix — see the
- [green lane](https://github.com/kornia/kornia/blob/main/CONTRIBUTING.md#which-lane-is-your-contribution).
+ If you want to investigate or fix it yourself, you are welcome to send a pull
+ request. A small reproduction and a regression test are especially helpful.
- type: textarea
id: what-happened
@@ -39,15 +38,18 @@ body:
attributes:
label: Environment
description: |
- Easiest: paste the output of this one-liner (add `python -m torch.utils.collect_env` for full GPU detail):
+ This command reports the versions and compute backend that usually matter without
+ collecting usernames, paths, environment variables, or hostnames:
```
- python -c "import kornia, torch, sys, platform; print(f'kornia {kornia.__version__} | torch {torch.__version__} | python {sys.version.split()[0]} | {platform.platform()} | cuda {torch.version.cuda} (avail={torch.cuda.is_available()}) | mps={torch.backends.mps.is_available()}')"
+ python -W ignore -c "import kornia, platform, sys, torch; gpu=torch.cuda.get_device_name(0) if torch.cuda.is_available() else 'none'; backend=torch.version.cuda or getattr(torch.version, 'hip', None); print(f'kornia {kornia.__version__} | torch {torch.__version__} | python {sys.version.split()[0]} | OS {platform.platform()} | CUDA/ROCm {backend} (available={torch.cuda.is_available()}, GPU={gpu}) | MPS={torch.backends.mps.is_available()}')"
```
+ Preview and redact any other diagnostic output before posting it. Do not share
+ usernames, home or project paths, tokens, internal hostnames, or private data names.
value: |
- Kornia version:
- PyTorch version:
- Python version:
- - OS / device (CPU, CUDA, MPS):
+ - OS / device (CPU, CUDA, ROCm, MPS):
validations:
required: true
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index dd931a9fc..0b1ba42c5 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -11,4 +11,4 @@ contact_links:
about: Chat with our community
- name: 📖 Contributing Guide
url: https://github.com/kornia/kornia/blob/main/CONTRIBUTING.md
- about: Read our contribution guidelines and policies
+ about: Read our contribution guide
diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml
index 82c80699e..6257ccfa3 100644
--- a/.github/ISSUE_TEMPLATE/feature-request.yml
+++ b/.github/ISSUE_TEMPLATE/feature-request.yml
@@ -1,7 +1,7 @@
name: 🚀 Feature Request
description: Suggest an idea or new feature
title: "[Feature]: "
-labels: ["enhancement"]
+labels: ["feature request"]
body:
- type: markdown
@@ -9,15 +9,13 @@ body:
value: |
Thanks for the suggestion! Please search existing issues first.
- Two honest notes before you write:
+ Two notes that may help:
- - Features are **discuss-first**: if you want to implement this yourself, wait for a
- maintainer to confirm the scope here before writing code — it protects you from
- building something we can't merge. See
- [which lane is your contribution?](https://github.com/kornia/kornia/blob/main/CONTRIBUTING.md#which-lane-is-your-contribution)
+ - If you want to implement the idea, sharing the shape of it here before doing a
+ large amount of work may reveal design or compatibility concerns early.
- Kornia currently focuses on hardening its differentiable geometry / CV core rather
than growing breadth — new model integrations are mostly frozen. Proposals in the
- core areas have much better odds.
+ core areas are closest to the current project direction.
- type: textarea
id: what-and-why
diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md
index 88cd3107e..1042e35cb 100644
--- a/.github/copilot-instructions.md
+++ b/.github/copilot-instructions.md
@@ -1,94 +1,13 @@
-# Kornia Repository Instructions
+# Copilot instructions for kornia
-This file provides instructions for GitHub Copilot when working with code in this repository.
+Use [AGENTS.md](../AGENTS.md) as the repository's operational guide. In particular:
-## Coding Standards
+- prefer existing kornia utilities and nearby code patterns;
+- preserve device, dtype, batching, gradient, JIT, and `torch.compile` behavior where applicable;
+- use `BaseTester`, injected `device`/`dtype` fixtures, and `self.assert_close()` in tests;
+- treat half precision, CUDA, MPS, and ONNX as explicit compatibility surfaces;
+- run focused checks and report what was and was not verified;
+- avoid requesting or exposing private environment information.
-Follow the coding standards and best practices defined in [CONTRIBUTING.md](../CONTRIBUTING.md#coding-standards).
-
-## AI Policy
-
-**CRITICAL**: All contributions must comply with the [AI_POLICY.md](../AI_POLICY.md). Review that document for complete requirements.
-
-### Core Principles:
-- The policy gates on **verification and accountability**, not on how much AI was used
-- Every functional change carries pasted test logs as execution evidence — evidence is ranked per AI_POLICY.md Rule 1 (oracle/invariant-backed test > failing-test repro > CI > local logs); logs alone are provenance, not proof
-- The submitter owns the code and must be able to address targeted questions about it (algorithms, shapes, edge cases, design); the failure condition is an unresolved correctness or ownership concern, never eloquence or language fluency
-- AI-generated PRs are acceptable when honestly disclosed and verified; only **demonstrable deception** (verification that never ran, fabricated logs) is grounds for closure — never an arguable 🟡/🔴 classification
-- Hallucinated or redundant comments are a code-quality defect — flag them as such
-
-## Instructions for AI Reviewers (Copilot / CodeRabbit)
-
-AI-based reviewers (e.g. GitHub Copilot, CodeRabbit) must follow the repository's AI usage policy and review rules.
-
-For the governing contribution policy, see [AI_POLICY.md](../AI_POLICY.md). This file contains the canonical operational instructions for AI reviewers.
-
-When generating or reviewing suggestions, prefer:
-- Enforcing the coding standards in [CONTRIBUTING.md](../CONTRIBUTING.md#coding-standards)
-- Enforcing the AI usage rules and review heuristics defined in [AI_POLICY.md](../AI_POLICY.md)
-- Highlighting missing tests, missing execution evidence (test logs, oracle-backed expected values), and misuse of `kornia` vs. raw PyTorch utilities
-## Key Guidelines
-
-- **Code style**: Follow PEP8, use 120 character line length, Ruff linting, and f-strings
-- **Type hints**: Required for all function inputs and outputs
-- **Documentation**: Follow documentation and docstring guidelines in [CONTRIBUTING.md](../CONTRIBUTING.md#coding-standards) and match the existing codebase style
-- **Testing**: Use `BaseTester` pattern with smoke, exception, cardinality, feature, gradcheck, and dynamo tests
-- **Dependencies**: Only PyTorch is allowed as a dependency
-- **Use kornia**: Always prefer `kornia` utilities over raw PyTorch functions
-
-## Running Checks
-
-```bash
-pixi run lint # Linting
-pixi run typecheck # Type checking
-pixi run test # Testing
-pixi run doctest # Documentation tests
-```
-
-## Review Checklist
-
-When reviewing code changes, verify:
-
-- Code follows guidelines in [CONTRIBUTING.md](../CONTRIBUTING.md)
-- Code complies with [AI_POLICY.md](../AI_POLICY.md)
-- Tests are included for new functionality
-- Code passes `pixi run lint` and `pixi run typecheck`
-- PR includes pasted test logs as execution evidence
-- Code uses `kornia` utilities instead of reinventing existing functionality
-- Comments are written in English, are non-redundant, and reflect genuine understanding of the code
-- The AI Usage Disclosure section is completed. **Never infer AI use from code or writing style** — poor code is not evidence of AI use, and disclosure classification is not litigated (see AI_POLICY.md Rule 4). Flag quality problems (hallucinated comments, reinvented utilities) as quality problems in their own right, not as disclosure evidence
-
-## Lane-Aware PR Review
-
-Kornia uses a two-lane contribution model (see
-[CONTRIBUTING.md](../CONTRIBUTING.md#which-lane-is-your-contribution)). Determine the
-PR's lane from its template declaration and content, then apply the matching checks.
-
-1. **Green lane** (test-first bug fixes, verified docs fixes, `help wanted` issues,
- benchmark results) — no issue link or assignment is required. Verify instead:
- - Bug fixes: the PR contains a new test and states that it fails on `main` without
- the fix; test logs are pasted
- - Docs fixes: the PR description shows the verification snippet that was run
- - `help wanted` PRs: the referenced issue carries the `help wanted` label and the
- PR meets the acceptance criteria stated in that issue; if another open PR
- already addresses the same issue, note it
- - Benchmark contributions: results follow the `benchmarks/` `--contribute` format
- - The PR does NOT introduce new features, new public APIs, or behavior changes —
- if it does, it is not green lane; ask for the discuss-first process
-
-2. **Discuss-first lane** (features, API changes, behavior/default/convention changes,
- models, large refactors):
- - Verify the PR description contains a valid issue reference (e.g., "Fixes #123")
- - Verify a maintainer confirmed the scope on the linked issue (a confirming
- comment or label; formal assignment is optional)
- - **Scope matching (critical)**: the PR implementation strictly matches what the
- issue describes; changes beyond that scope should be split into separate
- issues/PRs
- - **Behavior/default/convention changes deserve maximum scrutiny**: in a geometry
- library, changed semantics break users silently. Confirm the issue discussion
- explicitly acknowledges the behavior change and its migration path
-
-**Reviewer Action**: If requirements for the PR's lane are not met, explain exactly
-what is missing (which evidence for green lane; which confirmation for discuss-first)
-rather than issuing a generic warning. Never recommend closure based on subjective
-quality opinions alone — anchor findings in the objective criteria above.
+When reviewing, comment on concrete correctness, compatibility, maintainability, documentation, or test issues and tie each suggestion to the code under review.
+Do not speculate about whether or how AI was used; that disclosure belongs to the author.
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index c1120001e..7ccd58b46 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -1,22 +1,19 @@
-## Which lane? *(check one — see [Contributing Guide](https://github.com/kornia/kornia/blob/main/CONTRIBUTING.md#which-lane-is-your-contribution))*
-- [ ] 🟢 **Green lane** — test-first bug fix / verified docs fix / [`help wanted`](https://github.com/kornia/kornia/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22help%20wanted%22) issue / benchmark results. No prior issue needed.
-- [ ] 🟠 **Discuss-first** — feature or behavior change; a maintainer confirmed the scope on the linked issue.
+## What does this pull request do?
-**Fixes/Relates to:** # *(issue number, if any)*
+<!-- Explain the problem and the change. A few clear sentences are enough. -->
-## What does this PR do?
+## Related issue or discussion
-<!-- A few sentences. For bug fixes: which test fails on main without this fix? -->
+<!-- Link one if it exists, for example: Fixes #123. This is optional. -->
-## Test log
+## What did you check?
-<!-- Paste your local test run (required for functional changes): -->
+<!-- List the tests, examples, or manual checks you ran, and include useful results. -->
+```text
+$ pixi run test-module tests/...
```
-$ pixi run test tests/...
-```
-## AI Usage Disclosure *(pick the closest — the 🟡/🔴 line is fuzzy and only deception is sanctioned; none of these is a bad answer, see [AI_POLICY.md](https://github.com/kornia/kornia/blob/main/AI_POLICY.md))*
-- [ ] 🟢 **Human-written**
-- [ ] 🟡 **AI-assisted** — AI helped; I reviewed the resulting change and ran the relevant tests
-- [ ] 🔴 **AI-generated** — an agent wrote most of it; I verified the result and can address reviewer questions
+## How did AI help?
+
+<!-- If you used AI, briefly say what it helped with and what you checked or changed afterward. Otherwise, leave this blank. -->
diff --git a/.github/workflows/codeflash.yml b/.github/workflows/codeflash.yml
deleted file mode 100644
index a2e88a9ff..000000000
--- a/.github/workflows/codeflash.yml
+++ /dev/null
@@ -1,39 +0,0 @@
-name: Codeflash Optimization
-
-on:
- pull_request:
- paths:
- - 'kornia/**'
- workflow_dispatch:
-
-concurrency:
- # Any new push to the PR will cancel the previous run, so that only the latest code is optimized
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
-
-
-jobs:
- optimize:
- name: Optimize new Python code
- # Don't run codeflash on codeflash-ai[bot] commits, prevent duplicate optimizations
- if: ${{ github.actor != 'codeflash-ai[bot]' }}
- runs-on: ubuntu-latest
- env:
- CODEFLASH_API_KEY: ${{ secrets.CODEFLASH_API_KEY }}
-
- steps:
- - name: 🛎️ Checkout
- uses: actions/checkout@v7
- with:
- fetch-depth: 0
- - name: 🐍 Set up Python
- uses: actions/setup-python@v7
- with:
- python-version: '3.12'
- - name: 📦 Install Dependencies
- run: |
- python -m pip install --upgrade pip
- pip install -e ".[dev,x]"
- pip install codeflash
- - name: ⚡️Codeflash Optimization
- run: codeflash
diff --git a/.github/workflows/issue-triage.yml b/.github/workflows/issue-triage.yml
deleted file mode 100644
index 6ae0bd029..000000000
--- a/.github/workflows/issue-triage.yml
+++ /dev/null
@@ -1,62 +0,0 @@
-name: Issue Triage
-
-on:
- issues:
- types: [opened]
-
-permissions:
- issues: write
- contents: read
-
-jobs:
- triage:
- name: Triage New Issue
- runs-on: ubuntu-latest
- steps:
- - name: Triage new issue
- uses: actions/github-script@v9
- with:
- script: |
- const author = context.payload.issue.user.login;
-
- // The triage label and wait-for-assignment message exist to route
- // external contributors; maintainers (write access or above)
- // triage their own issues.
- let isMaintainer = false;
- try {
- const { data: perm } = await github.rest.repos.getCollaboratorPermissionLevel({
- owner: context.repo.owner,
- repo: context.repo.repo,
- username: author
- });
- isMaintainer = ['admin', 'maintain', 'write'].includes(perm.permission);
- } catch (error) {
- core.warning(`Could not determine permission for @${author}: ${error.message}`);
- }
-
- if (isMaintainer) {
- core.info(`@${author} has write access or above; skipping triage label and welcome message.`);
- return;
- }
-
- await github.rest.issues.addLabels({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.issue.number,
- labels: ['triage']
- });
-
- const welcomeMessage = '## 👋 Thanks for opening an issue!\n\n' +
- 'A maintainer will take a look. If you want to contribute a fix, here is how it works:\n\n' +
- '- **Bug you can reproduce?** You do not need to wait for anyone: send a PR with a test ' +
- 'that fails on `main` plus your fix — that failing test is your permission slip (🟢 green lane).\n' +
- '- **Feature or behavior change?** Please wait for a maintainer to confirm the scope on this ' +
- 'issue before writing code (🟠 discuss-first lane) — it protects you from building something we cannot merge.\n\n' +
- 'See [Which lane is your contribution?](https://github.com/kornia/kornia/blob/main/CONTRIBUTING.md#which-lane-is-your-contribution) for details.';
-
- await github.rest.issues.createComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.issue.number,
- body: welcomeMessage
- });
diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml
deleted file mode 100644
index 70d5a5f74..000000000
--- a/.github/workflows/pr-validation.yml
+++ /dev/null
@@ -1,165 +0,0 @@
-name: PR Validation
-
-on:
- pull_request_target:
- types: [opened, synchronize, reopened, edited]
-
-permissions:
- pull-requests: write
- issues: read
- contents: read
-
-jobs:
- validate:
- name: Validate PR Requirements
- runs-on: ubuntu-latest
- steps:
- - name: Checkout repository
- uses: actions/checkout@v7
-
- - name: Validate PR requirements
- uses: actions/github-script@v9
- with:
- script: |
- const pr = context.payload.pull_request;
- const prBody = pr.body || '';
- const prAuthor = pr.user.login;
-
- // Extract issue numbers from PR description
- // Matches patterns like: Fixes #123, Closes #456, Relates to #789, and the
- // template's own label form "**Fixes/Relates to:** #123".
- const issuePattern = /(?:fixes?|closes?|resolves?|relates?\s+to|see|refs?)[\s:*]*#(\d+)/gi;
- const matches = [...prBody.matchAll(issuePattern)];
- const issueNumbers = [...new Set(matches.map(m => parseInt(m[1])))];
-
- const warnings = [];
-
- // The assignment/triage guardrails exist for external contributors;
- // maintainers (write access or above) open PRs from their own judgment.
- let isMaintainer = false;
- try {
- const { data: perm } = await github.rest.repos.getCollaboratorPermissionLevel({
- owner: context.repo.owner,
- repo: context.repo.repo,
- username: prAuthor
- });
- isMaintainer = ['admin', 'maintain', 'write'].includes(perm.permission);
- if (isMaintainer) {
- core.info(`@${prAuthor} has ${perm.permission} access; skipping contributor guardrails.`);
- }
- } catch (error) {
- core.warning(`Could not determine permission for @${prAuthor}: ${error.message}`);
- }
-
- // Two-lane model (CONTRIBUTING.md#which-lane-is-your-contribution):
- // green lane needs no issue; discuss-first needs a linked, scope-confirmed issue.
- const greenLane = /-\s*\[x\]\s*🟢\s*\*\*Green lane/i.test(prBody);
- const discussLane = /-\s*\[x\]\s*🟠\s*\*\*Discuss-first/i.test(prBody);
-
- // Referenced issues should exist and be open regardless of lane.
- const checkIssueExists = async (issueNumber) => {
- try {
- const issue = await github.rest.issues.get({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: issueNumber
- });
- if (issue.data.state === 'closed') {
- warnings.push(`⚠️ **Issue #${issueNumber} is closed**: The linked issue #${issueNumber} is already closed. Please ensure you're linking to the correct issue.`);
- }
- return issue;
- } catch (error) {
- if (error.status === 404) {
- warnings.push(`❌ **Issue #${issueNumber} not found**: The linked issue #${issueNumber} does not exist. Please check the issue number.`);
- } else {
- warnings.push(`⚠️ **Error checking issue #${issueNumber}**: ${error.message}`);
- }
- return null;
- }
- };
-
- if (isMaintainer) {
- // no warnings: fall through so any stale warning comment gets deleted
- } else if (greenLane && discussLane) {
- // Checkboxes are not mutually exclusive on GitHub; don't guess a lane.
- warnings.push('ℹ️ **Both lanes are checked**: please keep exactly one — 🟢 green lane (test-first bug fix, verified docs fix, `help wanted` issue, benchmark results) or 🟠 discuss-first (features and behavior changes). See the [Contributing Guide](https://github.com/kornia/kornia/blob/main/CONTRIBUTING.md#which-lane-is-your-contribution).');
- for (const issueNumber of issueNumbers) {
- await checkIssueExists(issueNumber);
- }
- } else if (greenLane && !discussLane) {
- // Green lane: no issue link or assignment required. Only sanity-check
- // any issues the author chose to reference.
- for (const issueNumber of issueNumbers) {
- await checkIssueExists(issueNumber);
- }
- } else {
- if (!greenLane && !discussLane) {
- warnings.push('ℹ️ **Pick a lane**: Please check one of the lane boxes in the PR description — 🟢 green lane (test-first bug fix, verified docs fix, `help wanted` issue, benchmark results: no issue needed) or 🟠 discuss-first (features and behavior changes: linked, scope-confirmed issue required). See the [Contributing Guide](https://github.com/kornia/kornia/blob/main/CONTRIBUTING.md#which-lane-is-your-contribution).');
- }
- if (issueNumbers.length === 0) {
- warnings.push('❌ **No linked issue found**: Features and behavior changes need a linked issue where a maintainer confirmed the scope (use "Fixes #123" or "Closes #123"). If this PR is actually a test-first bug fix, verified docs fix, `help wanted` item, or benchmark contribution, check the 🟢 green-lane box instead — no issue needed.');
- } else {
- for (const issueNumber of issueNumbers) {
- const issue = await checkIssueExists(issueNumber);
- if (issue && issue.data.labels.map(l => l.name).includes('triage')) {
- warnings.push(`ℹ️ **Issue #${issueNumber} is still in triage**: A maintainer has not yet confirmed the scope of this issue. For features and behavior changes, please get a scope confirmation on the issue before investing significant work — it protects you from building something we cannot merge.`);
- }
- }
- }
- }
-
- // Post comment if there are warnings
- if (warnings.length > 0) {
- const commentBody = '## ⚠️ PR Validation Warnings\n\n' +
- warnings.join('\n\n') + '\n\n' +
- '---\n\n' +
- '**Note**: This PR can remain open, but please address these issues to ensure a smooth review process. For more information, see our [Contributing Guide](https://github.com/kornia/kornia/blob/main/CONTRIBUTING.md).';
-
- // Check if we already posted a comment
- const comments = await github.rest.issues.listComments({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: pr.number
- });
-
- const botComment = comments.data.find(
- c => c.user.type === 'Bot' && c.body.includes('PR Validation Warnings')
- );
-
- if (botComment) {
- // Update existing comment
- await github.rest.issues.updateComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- comment_id: botComment.id,
- body: commentBody
- });
- } else {
- // Create new comment
- await github.rest.issues.createComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: pr.number,
- body: commentBody
- });
- }
- } else {
- // Remove any existing warning comments if validation passes
- const comments = await github.rest.issues.listComments({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: pr.number
- });
-
- const botComment = comments.data.find(
- c => c.user.type === 'Bot' && c.body.includes('PR Validation Warnings')
- );
-
- if (botComment) {
- await github.rest.issues.deleteComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- comment_id: botComment.id
- });
- }
- }
diff --git a/.github/workflows/pr_test_cpu.yml b/.github/workflows/pr_test_cpu.yml
index d11a2812b..41ef867e1 100644
--- a/.github/workflows/pr_test_cpu.yml
+++ b/.github/workflows/pr_test_cpu.yml
@@ -4,11 +4,6 @@ on:
pull_request:
branches: [main]
types: [opened, reopened, synchronize, ready_for_review]
- paths-ignore:
- - 'docs/**'
- - '*.md'
- - 'LICENSE'
- - 'COPYRIGHT'
workflow_dispatch:
permissions:
@@ -19,7 +14,42 @@ concurrency:
cancel-in-progress: true
jobs:
+ changes:
+ runs-on: ubuntu-latest
+ outputs:
+ run-tests: ${{ steps.filter.outputs.run-tests }}
+ steps:
+ - uses: actions/checkout@v7
+ with:
+ fetch-depth: 0
+
+ - name: Check whether code tests are needed
+ id: filter
+ env:
+ BASE_SHA: ${{ github.event.pull_request.base.sha }}
+ run: |
+ if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
+ echo "run-tests=true" >> "$GITHUB_OUTPUT"
+ exit 0
+ fi
+
+ changed=$(git diff --no-renames --name-only "${BASE_SHA}...HEAD")
+ if grep -Eqv '^(docs/|.*\.md$|LICENSE$|COPYRIGHT$)' <<< "$changed"; then
+ echo "run-tests=true" >> "$GITHUB_OUTPUT"
+ else
+ # Must stay the first command here: it captures the `if` condition's
+ # exit status (1 = docs-only, anything else = grep itself failed).
+ grep_status=$?
+ if [[ "$grep_status" -eq 1 ]]; then
+ echo "run-tests=false" >> "$GITHUB_OUTPUT"
+ else
+ exit "$grep_status"
+ fi
+ fi
+
pre-tests:
+ needs: [changes]
+ if: needs.changes.outputs.run-tests == 'true'
runs-on: ubuntu-latest
outputs:
hash: ${{ steps.hashid.outputs.weights-hash }}
@@ -133,7 +163,7 @@ jobs:
uses: ./.github/workflows/tutorials.yml
collector:
- needs: [tests, dynamo, typecheck]
+ needs: [changes, pre-tests, tests, dynamo, typecheck]
if: always()
runs-on: ubuntu-latest
steps:
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
index 5d8487cbf..868c849ff 100644
--- a/.github/workflows/stale.yml
+++ b/.github/workflows/stale.yml
@@ -16,11 +16,11 @@ jobs:
steps:
- uses: actions/stale@v11
with:
- stale-pr-message: "This pull request has been quiet for a while, so we're marking it stale to keep the queue readable. If you're still working on it, any comment or push resets the clock. If you're waiting on *us* (a review or an answer), say so — a maintainer will add the `awaiting-review` label, which stops this timer. Otherwise it will be closed in 7 days; you can reopen anytime."
- close-pr-message: "Closed for inactivity to keep the queue readable — this is bookkeeping, not a rejection. Feel free to reopen whenever you're ready to continue."
+ stale-pr-message: "This pull request has been quiet for a while, so we're marking it stale to keep the queue readable. If you want to keep it open, leave a comment or push an update. Maintainers can add the `pinned` label to exempt it from the stale sweep. Otherwise it will be closed in 7 days. This is housekeeping, not a rejection, and you can reopen it whenever you want to continue."
+ close-pr-message: "Closed for inactivity to keep the queue readable — this is housekeeping, not a rejection. Feel free to reopen whenever you're ready to continue."
days-before-pr-stale: 15
days-before-pr-close: 7
stale-pr-label: "stale"
- exempt-pr-labels: "pinned,work-in-progress,on-hold,awaiting-review"
+ exempt-pr-labels: "pinned"
days-before-issue-stale: -1
days-before-issue-close: -1
diff --git a/.gitignore b/.gitignore
index ac77a1bc4..248d615a1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,6 +32,8 @@ weights/
# uv
.uv_cache/
+.venv/
+.venv-py*/
.python-version
diff --git a/AGENTS.md b/AGENTS.md
new file mode 100644
index 000000000..d2112778b
--- /dev/null
+++ b/AGENTS.md
@@ -0,0 +1,101 @@
+# Agent guide for kornia
+
+This file gives coding agents practical context for working in this repository.
+
+## Project shape
+
+kornia is a differentiable computer vision library built on PyTorch. Most code lives in subpackages under `kornia/`; reusable test support lives in `testing/`, not under `tests/`.
+
+Important areas include:
+
+- `kornia/geometry/`: transforms, cameras, epipolar geometry, stereo, and 3D
+- `kornia/filters/`: filtering and edge operators
+- `kornia/augmentation/`: differentiable augmentation pipelines
+- `kornia/feature/` and `kornia/models/`: feature and model implementations
+- `kornia/onnx/`: ONNX loading, execution, composition, and export
+- `kornia/core/`: shared tensor, module, and ONNX mixins
+
+Import order in `kornia/__init__.py` matters: `filters` and `geometry` are loaded before modules that depend on them. Check for circular imports when changing package exports.
+
+## Environment and commands
+
+Use Pixi for project tasks and environment selection. The tasks call `uv`, and Python tests run in the repository `.venv` or a versioned `.venv-py*`; do not assume packages in `.pixi` are the versions under test.
+
+```bash
+pixi install
+pixi run install
+pixi install -e py312
+pixi run -e py312 install
+pixi install -e py313
+pixi run -e py313 install
+pixi run -e cuda install
+pixi run test-module tests/path/to/test_file.py
+KORNIA_TEST_OPTIMIZER=inductor pixi run test-module tests/path/to/test_file.py
+pixi run test-quick
+pixi run test-slow
+pixi run lint
+pixi run pre-commit-all
+pixi run typecheck
+pixi run doctest
+pixi run build-docs
+```
+
+The `py312` and `py313` features select isolated `.venv-py312` and `.venv-py313` project environments automatically for install and test tasks.
+
+Select devices and dtypes with pytest options or environment variables:
+
+```bash
+pixi run test-module tests/geometry --device=cpu --dtype=float32,float64
+KORNIA_TEST_DEVICE=cuda KORNIA_TEST_DTYPE=float32 pixi run test-module tests/geometry
+```
+
+Supported fixtures include CPU, CUDA, MPS, and TPU when available, and `float16`, `bfloat16`, `float32`, and `float64`. Run focused checks first and expand them in proportion to the change.
+
+Use `KORNIA_TEST_RUNSLOW=true` to include slow tests. `KORNIA_TEST_OPTIMIZER=inductor` enables the dynamo and compile tests, which are deselected when the variable is unset. Before presenting a code change as finished, run the full pre-commit command above together with focused tests and other relevant checks; `pixi run lint` runs only the Ruff hooks.
+
+### Precision and device details
+
+- For focused CPU half-precision coverage, add `--dtype=float16,bfloat16` to a `test-module` run. `pixi run test-half` runs the whole CPU test suite.
+- CUDA `float16`/`bfloat16` tests need per-test subprocess isolation; use `pixi run -e cuda test-cuda-half` or pytest's `--isolate-half-precision` option.
+- MPS does not support float64 gradcheck. MPS autocast can also change the effective dtype; inspect nearby tests before changing tolerances or skips.
+- TF32 matmul is disabled by default; `--tf32` enables it. cuDNN convolutions still use PyTorch's TF32 default.
+- Preserve device and dtype rather than creating implicit CPU or default-dtype tensors. Use the injected `device` and `dtype` fixtures in tests.
+
+## Library preferences
+
+- Search for an existing `kornia` operation before building the same operation from raw PyTorch.
+- Follow nearby batching, broadcasting, shape-validation, dtype, and device conventions.
+- Use `BaseTester` from `testing.base`, injected `device`/`dtype` fixtures, and `self.assert_close()` for tensor comparisons. Its dtype-specific tolerances are intentional.
+- Follow [TESTING.md](TESTING.md) for test mechanisms. Use `self.gradcheck()` for gradient checks and the injected `torch_optimizer` fixture for `torch.compile` coverage. Include smoke, exception, shape/cardinality, numerical, gradient, and compile tests when they apply; not every change needs every kind.
+- Keep numerical correctness tests self-contained. For expected values produced by an optional reference library, prefer a hardcoded literal plus the small generation snippet and source. Optional-dependency integration tests, including ONNX tests, may still use `pytest.importorskip`.
+- For a new algorithm, name the source that defines it, such as a paper or a reference implementation in PyTorch, OpenCV, or scikit-image.
+- Public APIs need type hints, docstrings, and exports.
+- The codebase keeps a 120-character line length and Apache 2.0 source headers. Ruff and `ty` enforce the current style and types.
+- JIT-compatible modules have stricter typing constraints. Follow nearby annotations and use `torch.Tensor` directly where TorchScript expects it.
+- For non-JIT modules, use `from __future__ import annotations`.
+- Avoid new runtime dependencies. If a dependency is genuinely useful, explain why the existing stack is insufficient and consider its install, build, and platform cost.
+
+## Documentation and generated examples
+
+- Add every new public class or function to the corresponding `docs/source/*.rst` page so it appears in the rendered API reference.
+- When adding a feature detector or descriptor, update the `responses` list in `docs/generate_examples.py` and add the matching branch that renders its heatmap or score visualization. Follow the existing `DISK`, `ALIKED`, and `XFeat` examples and preserve the expected `(B, 3, H, W)` image shapes.
+
+## Benchmarks
+
+Follow the methodology contract and new-benchmark checklist in [benchmarks/README.md](benchmarks/README.md), using the helpers in `benchmarks/common.py`. Benchmark public kornia APIs rather than embedding a replacement implementation. For performance changes, run the same benchmark on the relevant base revision and changed branch.
+
+## ONNX work
+
+ONNX support is a real subsystem, not a generic export afterthought. Inspect `kornia/onnx/`, its mixins in `kornia/core/`, and existing ONNX tests before changing export behavior. Development uses the optional `onnx`, `onnxruntime`, and `onnxscript` packages. Test both graph construction/export and runtime behavior when the change affects both.
+
+## Helping users diagnose problems
+
+Start with a minimal reproduction and the narrowest relevant test. Do not claim a failure is pre-existing until you have compared against the relevant base revision safely.
+
+Ask only for environment details that help the diagnosis: kornia, PyTorch, and Python versions; OS family; device backend; CUDA availability/version; and GPU model when relevant. Prefer the same privacy-conscious command used by the bug template:
+
+```bash
+python -W ignore -c "import kornia, platform, sys, torch; gpu=torch.cuda.get_device_name(0) if torch.cuda.is_available() else 'none'; backend=torch.version.cuda or getattr(torch.version, 'hip', None); print(f'kornia {kornia.__version__} | torch {torch.__version__} | python {sys.version.split()[0]} | OS {platform.platform()} | CUDA/ROCm {backend} (available={torch.cuda.is_available()}, GPU={gpu}) | MPS={torch.backends.mps.is_available()}')"
+```
+
+Before asking a user to share broader diagnostic output, tell them to preview and redact it. Do not request usernames, home or project paths, environment variables, tokens, internal hostnames, or names of private data and models.
diff --git a/AI_POLICY.md b/AI_POLICY.md
index 34dece700..70ce32c85 100644
--- a/AI_POLICY.md
+++ b/AI_POLICY.md
@@ -1,147 +1,10 @@
-# 🤖 Kornia AI & Authorship Policy
+# AI and contributions
-**Version:** 2.0
-**Applies to:** every pull request, human or bot.
+AI tools are welcome in kornia development, and maintainers use them too.
-## Why this policy exists — the honest version
+Our policy is the social contract at the beginning of
+[CONTRIBUTING.md](CONTRIBUTING.md#our-social-contract): tell us how AI helped and treat the resulting
+work with care. We do not classify contributions by how much AI was involved, and
+there is no separate set of rules for work made with AI.
-AI tools can now produce code that looks right in seconds. Some of it is genuinely
-good. A lot of it compiles, reads confidently, and is quietly wrong — and reviewing it
-costs a volunteer maintainer far more time than generating it cost the submitter.
-Around application deadlines (GSoC and similar) we have received whole waves of these.
-
-At the same time, let's be honest about ourselves: **Kornia maintainers use AI tools
-heavily** — including entire agent-written pull requests. Banning "AI-generated code"
-would be hypocritical, and it would also miss the point. What we have learned by
-working this way is that the difference between an excellent AI-built PR and a useless
-one is never the tool. It is whether every claim was **executed and verified**, and
-whether a **human stands behind the result** and can explain it.
-
-So this policy does not gate on how much AI you used. It gates on two things:
-
-1. **Verification** — did you actually run it, and can you show us?
-2. **Accountability** — do you understand it, and will you answer for it?
-
-Unverified code is a problem. Code nobody stands behind is a problem. AI is neither.
-
-## The rules
-
-### Rule 1 — Show us the evidence
-
-Code that "looks correct" is not enough, no matter who or what wrote it. And one
-honest caveat about our own favorite kind of evidence: **"fails on `main`, passes
-with the fix" proves the behavior *changed* — not that the new behavior is
-*correct*.** A generated test can encode the same wrong assumption as generated
-code, and a pasted log can in principle be fabricated. So evidence is ranked,
-strongest first:
-
-1. **A test backed by a credible oracle** — a reference implementation (OpenCV,
- scipy, a paper — embedded as a hardcoded literal with its generation snippet), a
- documented contract, or a mathematical invariant (`warp(H⁻¹) ∘ warp(H) ≈ id`).
- For numerical and geometry claims this is the bar.
-2. **A failing-test-first repro** — fails on `main`, passes with the fix. Your fast
- lane past most of our process — see the green lane in
- [CONTRIBUTING.md](CONTRIBUTING.md#which-lane-is-your-contribution).
-3. **CI reproduction** — the suite runs your test where everyone can see it.
-4. **Pasted local logs** — required as provenance on every functional change
- (e.g. `pixi run test tests/...`), but the weakest evidence on its own.
-
-New implementations additionally name their reference (PyTorch, OpenCV,
-scikit-image, a paper) in the PR description, so reviewers can check the algorithm
-is real and not hallucinated.
-
-### Rule 2 — Don't reinvent kornia
-
-AI tools love writing helpers that already exist. Search `kornia` first and use the
-existing utility; if you genuinely can't, say why in the PR. Writing a new
-`def warp_affine...` when kornia already has one is grounds for immediate rejection.
-
-### Rule 3 — Own it, and be able to defend it
-
-If a reviewer asks how a function works, you can walk them through it — the math, the
-shapes, the edge cases, the design decisions. This is what being the author means
-here: not that you typed every character, but that you **own** every line.
-
-Humane interpretation, both directions: written answers are fine, imperfect English
-is fine, "let me check and get back to you" is fine. Reviewers commit to asking
-targeted questions — about algorithms, shapes, edge cases, trade-offs — not to
-running oral exams. What ends a review is disengagement or unresolved substance:
-"that's what the AI wrote" as a final answer, or a correctness concern that never
-gets addressed. The bar is resolved concerns, not eloquence.
-
-A special mention for comments: hallucinated or redundant comments ("this returns the
-input tensor", comments explaining code that was deleted) are the fastest tell of an
-unreviewed PR, and they trigger a request for a full manual rewrite.
-
-### Rule 4 — Tell us how it was made
-
-Fill in the AI disclosure in the PR template honestly:
-
-- 🟢 **Human-written** — no AI involved.
-- 🟡 **AI-assisted** — AI helped (autocomplete, refactoring, drafts); you reviewed the
- resulting change and ran the relevant tests.
-- 🔴 **AI-generated** — an agent produced most of the code or the PR.
-
-**None of these is a bad answer — and the 🟡/🔴 boundary is fuzzy, which is fine.**
-Autocomplete, agent edits, generated tests, and human restructuring form a continuum
-with no objective line; pick the closest label and add a sentence of detail if
-unsure. We will never close a PR over an arguable classification, and we have no
-interest in authorship-taxonomy debates — authorship was never the quality gate.
-What we sanction is **demonstrable deception**: verification that never ran,
-fabricated logs, denying AI use against direct evidence — and AI use is never
-*inferred* from writing or code style; poor code is a quality problem, not a
-disclosure problem. A 🔴 PR with thorough verification is welcome here — some of our
-own most heavily reviewed PRs are exactly that. An honest 🔴 beats a dishonest 🟡
-every time.
-
-## What we do on our side
-
-Policies that only demand things are no fun, so here is our half of the deal:
-
-- **We gate on evidence, not permission.** Evidence-bearing contributions (test-first
- bug fixes, verified docs fixes, `help wanted` issues with acceptance criteria,
- benchmark results) need no assignment and no waiting — see
- [CONTRIBUTING.md](CONTRIBUTING.md#which-lane-is-your-contribution).
-- **We verify before we reject.** Review findings — including those from our AI
- reviewers — are checked by execution, not vibes. Automated closures only ever happen
- on objective criteria (missing test logs, missing issue link where one is required),
- never on a bot's opinion of your code quality.
-- **Maintainers: same evidence bar, different governance authority — stated
- honestly.** Maintainer PRs — agent-built ones included — carry pasted execution
- logs, honest disclosure, and review like everyone else's. What maintainers do
- *not* do is ask themselves for permission: they hold the scope-setting authority
- the discuss-first gate exists to route to, so the lane/issue guardrails skip them
- (the validation workflow says so in code). Requiring maintainers to grant
- themselves an issue would be theater; letting them skip the evidence bar would be
- corrosion. We do the first openly and refuse the second — hold us to it.
-
-## This policy is an experiment
-
-AI changed the economics of contribution; this policy is our current best response,
-not scripture. We will revisit it after a full contribution season against real
-metrics — green-lane merge rate, disclosure disputes, duplicate work on
-first-PR-wins issues, time to first review, maintainer load — and change what the
-data says is wrong.
-
-## Instructions for AI Reviewers (Copilot / CodeRabbit)
-
-If you are an AI agent (GitHub Copilot, CodeRabbit, etc.) reviewing a PR for Kornia,
-you must follow the repository's dedicated reviewer instructions.
-
-The **canonical and up-to-date instructions for AI reviewers** are maintained in
-[`.github/copilot-instructions.md`](.github/copilot-instructions.md). That document
-defines:
-
-- The expected reviewer persona and responsibilities
-- The checks to perform on PR descriptions, code, tests, and comments
-- The required enforcement of the rules defined in this `AI_POLICY.md`
-
-Any other document (including this one) should treat `copilot-instructions.md` as the
-single source of truth for AI reviewer behaviour. When updating reviewer logic, update
-`copilot-instructions.md` first and, if needed, adjust references here.
-
-## Additional Resources
-
-For comprehensive guidance on contributing to Kornia, including development workflows,
-code quality standards, testing practices, and AI-assisted development best practices,
-see the [Best Practices section](CONTRIBUTING.md#best-practices) in `CONTRIBUTING.md`.
+The technical guidelines in `CONTRIBUTING.md` apply to all contributions, however they were made.
diff --git a/CLAUDE.md b/CLAUDE.md
index d4229ebaa..ee0aa9cef 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -1,176 +1,16 @@
-# CLAUDE.md
+# Claude guide for kornia
-This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
-## About Kornia
+The operational guide is [AGENTS.md](AGENTS.md); the line above imports it for Claude Code.
-Kornia is a differentiable computer vision library built on PyTorch. It provides differentiable image processing, geometric vision algorithms, augmentation pipelines, and pre-trained AI models (feature detection/matching, segmentation, etc.).
+When helping a user in this repository:
-## Development Environment
+- Start from the smallest relevant code path and run focused checks before making broad claims.
+- Prefer existing kornia utilities and nearby patterns over introducing a parallel abstraction.
+- Preserve tensor device, dtype, batch semantics, gradients, and `torch.compile` behavior when they apply.
+- Treat float16, bfloat16, MPS, CUDA, JIT, and ONNX as distinct compatibility surfaces; do not assume a CPU float32 result covers them.
+- Explain what you verified and what remains unverified.
+- Ask before gathering broad environment information. Request only useful versions and hardware details, and remind users to redact paths, usernames, tokens, hostnames, and private data names.
-The project uses [pixi](https://pixi.sh) for environment management and `uv` for Python package management.
-
-```bash
-# Set up development environment (Python 3.11 default)
-pixi install
-
-# For specific Python versions
-pixi install -e py312
-pixi install -e py313
-
-# For CUDA development
-pixi run -e cuda install
-```
-
-## Common Commands
-
-```bash
-# Run all tests
-pixi run test
-
-# Run a specific test file
-pixi run test tests/test_geometry_transform.py
-
-# Run tests with pytest options (dtype: bfloat16, float16, float32, float64, all; device: cpu, cuda, mps, tpu, all)
-pixi run test tests/test_geometry_transform.py --dtype=float32,float64 --device=all
-
-# Run quick tests (excludes jit, grad, nn)
-pixi run test-quick
-
-# Linting (ruff via pre-commit)
-pixi run lint
-
-# Type checking (uses `ty`)
-pixi run typecheck
-
-# Doctests
-pixi run doctest
-
-# Build documentation
-pixi run build-docs
-
-# Run tests with specific device/dtype via env vars
-KORNIA_TEST_DEVICE=cuda KORNIA_TEST_DTYPE=float32 pixi run test
-KORNIA_TEST_RUNSLOW=true pixi run test-slow
-```
-
-## Code Architecture
-
-The library is structured as submodules under `kornia/`:
-
-- **`kornia/filters/`** — Image filtering (Gaussian, Sobel, Median, Canny, etc.). Imported first in `__init__.py` as it's core.
-- **`kornia/geometry/`** — Geometric transformations (affine, homography, camera models, stereo, 3D). Also core, imported first.
-- **`kornia/augmentation/`** — Augmentation pipeline (`AugmentationSequential`, `RandomAffine`, etc.)
-- **`kornia/color/`** — Color space conversions (RGB, HSV, grayscale, etc.)
-- **`kornia/feature/`** — Feature detection and description (SIFT, HardNet, DISK, DeDoDe, LoFTR, LightGlue, etc.)
-- **`kornia/enhance/`** — Image enhancement (histogram equalization, CLAHE, gamma correction)
-- **`kornia/losses/`** — Loss functions (SSIM, PSNR, Dice, Hausdorff, etc.)
-- **`kornia/models/`** — Pre-trained AI models (YuNet face detection, SAM segmentation, etc.)
-- **`kornia/morphology/`** — Morphological operations (dilation, erosion, etc.)
-- **`kornia/onnx/`** — ONNX export and inference (`ONNXSequential`)
-- **`kornia/contrib/`** — Experimental/contributed modules
-- **`kornia/core/`** — Base classes (`ImageModule`, `ImageSequential`, `TensorWrapper`, ONNX mixins)
-- **`kornia/transpiler/`** — Multi-framework support via ivy (JAX, TensorFlow, NumPy backends)
-- **`testing/`** — Test utilities (not tests). `testing/base.py` contains `BaseTester` and `assert_close`.
-
-**Import order matters**: `filters` and `geometry` must be imported before other modules to avoid circular dependencies (see `kornia/__init__.py`).
-
-## Testing Patterns
-
-All tests should inherit from `BaseTester` (from `testing.base`):
-
-```python
-from testing.base import BaseTester
-
-
-class TestMyFunction(BaseTester):
- def test_smoke(self, device, dtype): ... # Basic run with all arg combinations
- def test_exception(self, device, dtype): ... # Exception cases
- def test_cardinality(self, device, dtype): ... # Output shapes
- def test_feature(self, device, dtype): ... # Correctness / numerical accuracy
- def test_gradcheck(self, device): ... # Gradient checking via self.gradcheck()
- def test_dynamo(self, device, dtype, torch_optimizer): ... # torch.compile compat
-```
-
-The `device` and `dtype` fixtures are injected automatically. Use `self.assert_close()` for tensor comparisons. Test configurations are driven by env vars `KORNIA_TEST_DEVICE` and `KORNIA_TEST_DTYPE`, or by `--device`/`--dtype` pytest args.
-
-Tests actually run under the repo `.venv` (`pixi run test`/`test-quick`/etc. all shell out to `uv run pytest`, which uses `.venv`) — the separate `.pixi` conda environment is not what test invocations use and its package versions should not be assumed to match `.venv`.
-
-## Coding Standards
-
-- **Python >= 3.11** with `from __future__ import annotations` for non-JIT modules
-- **Line length**: 120 characters (ruff enforced)
-- **Type hints required** on all function inputs and outputs; use `torch.Tensor` directly (not string annotations for tensor types in JIT-compatible code)
-- **Only PyTorch** as a third-party dependency — no other libraries
-- **Use existing `kornia` utilities** rather than reimplementing with raw PyTorch
-- **Docstrings**: Follow existing codebase style; all public APIs need docstrings
-- Every source file must start with the Apache 2.0 license header (managed by `add-license-header`)
-
-## Benchmarks
-
-Scripts under `benchmarks/` measure the speed and/or quality of existing kornia functions, modules, or models. Each benchmark must:
-
-- Report **CPU and CUDA timings** in a table.
-- Include **quality metrics** where applicable (see `benchmarks/feature/` for an example with local-feature matching scores).
-- Record the **date, hardware description, and git commit hash** being evaluated at the top of the output or in a results file.
-- Benchmark **only the public kornia API** — no custom reimplementations or alternative snippets inside the script.
-
-### Workflow for performance PRs
-
-1. Check out `main` (or the relevant release tag) and run the benchmark to establish a baseline.
-2. Apply your changes on a new branch and run the same benchmark again.
-3. Include both result tables in the PR description so reviewers can compare before and after.
-
-## Pre-commit Hooks
-
-Install hooks with `pre-commit install`. CI enforces ruff formatting, linting, and docformatter.
-
-**Always run `pixi run lint` before pushing** to catch ruff errors (formatting, style, ambiguous Unicode characters, etc.) that will cause CI to fail. Fix any reported issues before committing.
-
-## Documentation and Visualizations
-
-**Every public class or function added to a `kornia/` submodule must also be listed in the corresponding `docs/source/*.rst` file** — otherwise it will not appear in the rendered docs. Check the relevant `.rst` after adding any public API symbol and add an `.. autoclass::` or `.. autofunction::` directive if it is missing.
-
-When adding a new feature detector or descriptor to `kornia/feature/`:
-- Add an `.. autoclass::` entry to `docs/source/feature.rst` in the appropriate section (Detectors, Descriptors, or Local Features).
-- Add an entry to the `responses` list in `docs/generate_examples.py` with a corresponding `elif` block that produces a heatmap/score visualization (`(B, 3, H, W)` BGR image in `img_in`, `(B, 3, H, W)` response map in `out`).
-- See existing entries (`DISK`, `ALIKED`, `XFeat`) for the expected pattern.
-
-## PR Requirements
-
-All PRs must:
-- Declare a lane (CONTRIBUTING.md "Which lane is your contribution?"): green lane (test-first bug fix, verified docs fix, `help wanted` issue, benchmark results — no prior issue needed) or discuss-first (features/behavior changes — linked issue with maintainer scope confirmation, `Fixes #123`)
-- Include pasted local test log output as proof of execution (`pixi run test ...`); bug fixes include a test that fails on `main`
-- Reference an algorithm source (PyTorch, OpenCV, scikit-image, paper, etc.) for any new implementation
-
-**Comments**: No redundant or ghost comments (e.g., "this returns the input tensor", or comments explaining deleted code). Violation triggers mandatory manual rewrite request.
-
-## Test-First Debugging
-
-**Always run the relevant tests before answering a question about a bug or test failure.**
-Do not assume a failure is pre-existing or unrelated to recent changes without running it:
-
-```bash
-# Run the failing test(s) first, then investigate
-pixi run -e default uv run pytest <failing_test_file> -q --dtype=float32,float64
-```
-
-If the test passes on the current branch, verify on `main` with `git stash` before concluding it is pre-existing.
-
-## Hardcoded Reference Values in Tests
-
-**Never use `pytest.importorskip` to gate correctness tests on optional third-party libraries** (OpenCV, scipy, etc.). Instead, compute the expected output once offline and embed it as a hardcoded tensor literal, following the pattern used in `tests/geometry/epipolar/test_fundamental.py`:
-
-```python
-# Snippet used to generate expected (requires numpy only):
-# import numpy as np
-# ... run the reference algorithm ...
-# expected = result # <-- print and paste below
-
-expected = torch.tensor([[...]], dtype=dtype, device=device)
-self.assert_close(actual, expected, atol=1e-4, rtol=1e-4)
-```
-
-Leave a comment above the literal showing the generation snippet so it can be reproduced. This makes tests self-contained, deterministic, and runnable without optional dependencies.
-
-See `AI_POLICY.md` for the full contribution policy, including AI usage disclosure requirements.
+If you help prepare a contribution, summarize what you changed and checked so the user can reuse that information in the pull request.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 57650ecbc..5066faadb 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,21 +1,27 @@
-# Contributing to Kornia
+# Contributing to kornia
-Welcome! This guide will help you contribute to Kornia.
+## Our social contract
-## Policies and Guidelines
+We (maintainers) develop kornia for ourselves and the computer vision community.
+If kornia is useful to you in any way — to import, to prototype, to use as a reference for your agent — that makes us happy.
+You are welcome to help us improve kornia: report a bug, implement a feature, propose an idea, answer a question, or simply tell others about the project.
+We try to do our best to accept your help — by reviewing PRs, fixing bugs, and so on — but we do not promise to review every PR, let alone quickly.
+We have jobs, families, health problems, and holidays, just like everyone else.
-- **Two lanes**: small evidence-bearing fixes need no permission — just send the PR. Features and behavior changes need discussion first. See [Which lane is your contribution?](#which-lane-is-your-contribution).
+You may use AI to do the work — so do we. There are no approved or disapproved amounts of AI use. Tell us how AI helped; we do the same.
+Above all, we ask you to care. Good work done with care makes the world better; sloppy work makes the world worse.
-- **AI Policy & Authorship**: See [AI_POLICY.md](AI_POLICY.md) for the complete policy. Short version: we don't care how much AI you used (our maintainers use it heavily too) — we care that you **verified** everything and can **explain** everything. That means:
- - **Show us it runs**: PRs include pasted local test logs; bug fixes arrive with a test that fails on `main`.
- - **Don't reinvent kornia**: use existing `kornia` utilities instead of writing new ones.
- - **Own it**: you can explain any line during review; disclose AI use honestly in the PR template.
+The rest of this guide contains practical and technical guidance so nobody has to guess. If you have experience with open source, you probably already know most of it.
-- **15-Day Rule**: PRs waiting on their **author** for 15+ days may be closed to keep the queue readable — reopen anytime when you're back. Time spent waiting on *us* shouldn't count against you — but honestly, the stale bot can't tell who's waiting on whom, so this runs on a manual mechanism: if you're blocked on a review, say so and a maintainer will add the `awaiting-review` label, which pauses the timer.
+## Practical guidelines
-- **Transparency**: All discussions must be public.
-
-We're all volunteers. These policies exist so review time goes to real contributions.
+- Search existing issues and pull requests before starting. Focused fixes and documentation improvements are welcome as pull requests. For a new public API, a behavior change, or a large piece of work, an early issue or discussion can save everyone time. A conversation helps us align; it is not a promise that somebody will review or merge the result.
+- Check the part you changed and tell us what you ran. A bug fix is easier to trust when it includes a test that fails without the fix. Numerical work is easier to review when expected values come from a reference implementation, a paper, or a mathematical invariant.
+- Look for an existing `kornia` utility before adding another implementation. Keep changes focused, follow nearby code, and update the documentation when public behavior changes.
+- Read your own contribution and stay part of the conversation about it. You do not need perfect English or an immediate answer; we care that questions and technical concerns are treated seriously.
+- If you are contributing as part of an application, remember that we read the work and review conversation, not pull request counts.
+- Keep project decisions and review discussions in public GitHub issues, discussions, or pull requests so others can find and learn from them.
+- Pull requests are marked stale after 15 quiet days and may be closed 7 days later to keep the queue usable. Comment or push an update to keep yours active; maintainers can add `pinned` when a pull request should remain open without activity. This is housekeeping, not a judgment: reopen one or make a new pull request whenever you want to continue.
## Ways to Contribute
@@ -33,22 +39,22 @@ We're all volunteers. These policies exist so review time goes to real contribut
3. **Fix bugs or add features:**
- Check [help wanted issues](https://github.com/kornia/kornia/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22help%20wanted%22) for starting points.
- Follow the [development setup](#developing-kornia) below.
- - See [Pull Request](#pull-request) section for PR requirements.
+ - See the [Pull Request](#pull-request) section for practical guidance.
4. **Donate resources:**
- [Open Collective](https://opencollective.com/kornia)
- [GitHub Sponsors](https://github.com/sponsors/kornia)
- We're looking for CUDA server donations for testing.
-# Developing Kornia
+## Developing kornia
-## Setup
+### Setup
1. **Fork** the [repository](https://github.com/kornia/kornia/fork)
2. **Clone your fork** and add upstream:
```bash
- $ git clone [email protected]:<your Github username>/kornia.git
+ $ git clone [email protected]:<your GitHub username>/kornia.git
$ cd kornia
$ git remote add upstream https://github.com/kornia/kornia.git
```
@@ -80,20 +86,25 @@ We're all volunteers. These policies exist so review time goes to real contribut
**Set up the development environment:**
```bash
- # Install all dependencies (defaults to Python 3.11)
+ # Create the default Pixi environment, then install development dependencies
pixi install
+ pixi run install
# For specific Python versions
pixi install -e py312 # Python 3.12
+ pixi run -e py312 install
pixi install -e py313 # Python 3.13
+ pixi run -e py313 install
# For CUDA development (requires reinstall of PyTorch)
pixi run -e cuda install
```
+ The `py312` and `py313` environments use isolated `.venv-py312` and `.venv-py313` project environments automatically.
+
**Available tasks:**
- Kornia provides several tasks via pixi for common development workflows:
+ kornia provides several tasks via pixi for common development workflows:
```bash
# Installation
@@ -106,14 +117,19 @@ We're all volunteers. These policies exist so review time goes to real contribut
pixi run test-f64 # Run tests with float64
pixi run test-slow # Run slow tests
pixi run test-quick # Run quick tests (excludes jit, grad, nn)
+ pixi run test-module tests/<path> # Run a focused test path
+ pixi run test-half # Run CPU float16/bfloat16 tests
# CUDA testing (requires cuda environment)
pixi run -e cuda test-cuda # Run tests on CUDA
pixi run -e cuda test-cuda-f32 # Run CUDA tests with float32
pixi run -e cuda test-cuda-f64 # Run CUDA tests with float64
+ pixi run -e cuda test-cuda-half # Run isolated CUDA float16/bfloat16 tests
# Code quality
pixi run lint # Run ruff linting
+ pixi run pre-commit-all # Run all repository pre-commit checks
+ pixi run pre-commit-install # Install the pre-commit Git hook
pixi run typecheck # Run type checking with ty
pixi run doctest # Run doctests
@@ -142,7 +158,7 @@ We're all volunteers. These policies exist so review time goes to real contribut
pixi run test
```
- **Dependencies:** Defined in `pyproject.toml`. Update it and run `pixi install`.
+ **Dependencies:** Defined in `pyproject.toml`. Update it and run `pixi run install`.
**CUDA:** The CUDA environment uses PyTorch with CUDA 12.1. Run `pixi run -e cuda install` to set it up.
@@ -154,26 +170,26 @@ We're all volunteers. These policies exist so review time goes to real contribut
pixi run test
# Run specific test file
- pixi run test tests/<TEST_TO_RUN>.py
+ pixi run test-module tests/<TEST_TO_RUN>.py
# For specific test with pytest options
- pixi run test tests/<TEST_TO_RUN>.py --dtype=float32,float64 --device=all
+ pixi run test-module tests/<TEST_TO_RUN>.py --dtype=float32,float64 --device=all
```
**dtype options:** `bfloat16`, `float16`, `float32`, `float64`, `all`
**device options:** `cpu`, `cuda`, `tpu`, `mps`, `all`
- We use [pre-commit](https://pre-commit.com) for code quality. Install it with `pre-commit install`. See [coding standards](#coding-standards) below.
+ We use [pre-commit](https://pre-commit.com) for code quality. Install its Git hook with `pixi run pre-commit-install`. See [coding standards](#coding-standards) below.
-# Contributing to Documentation
+## Contributing to Documentation
1. Set up your development environment (see [above](#developing-kornia))
2. Edit files in `docs/`
-3. Build docs: `make build-docs`
+3. Build docs: `pixi run build-docs`
4. Preview: `open docs/build/html/index.html`
5. Submit a PR following the [Pull Request](#pull-request) guidelines
-# Coding Standards
+## Coding Standards
- **Write small incremental changes:**
- Commit small, logical changes
@@ -283,8 +299,8 @@ We're all volunteers. These policies exist so review time goes to real contribut
- Follow [PEP8](https://www.python.org/dev/peps/pep-0008/)
- Use f-strings: [PEP 498](https://peps.python.org/pep-0498/)
- Line length: 120 characters
- - Comments must be written in English and verified by a human with a good understanding of the code
- - Obvious or redundant comments are not allowed (see [Best Practices](#best-practices) for comment guidelines)
+ - Write comments in English so they are useful to the whole community
+ - Prefer comments that explain why; remove comments that merely repeat the code or no longer match it
- W504 (line break after binary operator) is sometimes acceptable. Example:
```python
@@ -292,36 +308,35 @@ We're all volunteers. These policies exist so review time goes to real contribut
A[:, :, 0:1, 1:2] * A[:, :, 1:2, 0:1])
```
-- **Third-party libraries:** Not allowed. Only PyTorch.
+- **Dependencies:** Avoid adding runtime dependencies. If one is useful, explain why existing dependencies are not enough and discuss the trade-off first.
-# Best Practices
+## Best Practices
-This section provides guidance for contributing to Kornia, with a focus on Python and PyTorch best practices, performance, and maintainability.
+This section provides guidance for contributing to kornia, with a focus on Python and PyTorch best practices, performance, and maintainability.
-## Before You Start
+### Before You Start
-1. **Know Your Lane**: Fixes that carry their own evidence (failing test + fix, verified docs corrections, `help wanted` issues) can go straight to a PR. For features and behavior changes, discuss first — Discord is a fine place for the conversation, but capture the outcome in a GitHub issue with maintainer scope confirmation, since that issue is what your PR links to. See [Which lane is your contribution?](#which-lane-is-your-contribution).
+1. **Start Small**: If you're new to the project, a small bug fix or documentation improvement is a good way to learn the codebase and contribution process.
-2. **Start Small**: If you're new to the project, start with small bug fixes or documentation improvements to familiarize yourself with the codebase and contribution process.
+2. **Understand the Codebase**: Take time to explore existing code patterns, architecture, and conventions before implementing new features.
-3. **Understand the Codebase**: Take time to explore existing code patterns, architecture, and conventions before implementing new features.
+3. **Review Existing Utilities**: Before implementing new functionality, search the codebase for existing utilities in `kornia`.
-4. **Review Existing Utilities**: Before implementing new functionality, search the codebase for existing utilities in `kornia`. This aligns with the AI Policy's Hallucination & Redundancy Ban (see [Policies and Guidelines](#policies-and-guidelines)).
-
-## Development Workflow
+### Development Workflow
1. **Keep PRs Focused**: Each PR should address a single concern. If you're working on multiple features, create separate PRs for each.
-2. **Test Locally First**: Always run all relevant tests locally before submitting (see [Pull Request](#pull-request) for requirements):
+2. **Test Locally**: Run the checks that are relevant to your change:
```bash
- pixi run lint # Check formatting and linting
- pixi run test # Run all tests
- pixi run typecheck # Verify type checking
+ pixi run lint # Run the Ruff hooks
+ pixi run pre-commit-all # Run the full repository checks
+ pixi run test # Run all tests
+ pixi run typecheck # Verify type checking
```
3. **Update Documentation**: When adding new features or changing behavior, update docstrings for public APIs. For documentation contributions, see [Contributing to Documentation](#contributing-to-documentation).
-## Code Quality
+### Code Quality
1. **Performance Considerations**:
- Prefer in-place operations when possible (e.g., `tensor.add_(other)` vs `tensor = tensor.add(other)`)
@@ -338,12 +353,12 @@ This section provides guidance for contributing to Kornia, with a focus on Pytho
- Avoid over-engineering; start simple and refactor when needed
3. **Tensor Operations**:
- - Use `kornia` utilities instead of reimplementing common operations (see [AI Policy](#policies-and-guidelines))
+ - Use `kornia` utilities instead of reimplementing common operations
- Ensure operations are device-agnostic (work on CPU, CUDA, MPS, etc.)
- Support multiple dtypes (float32, float64, float16, bfloat16) when applicable
- Handle batched and non-batched inputs consistently
-## Testing Best Practices
+### Testing Best Practices
- Write tests for happy paths, error cases, edge conditions, boundary conditions, and integration scenarios
- Use `BaseTester` from `testing.base` for consistent test structure (see [Coding Standards](#coding-standards) for examples)
@@ -351,123 +366,41 @@ This section provides guidance for contributing to Kornia, with a focus on Pytho
- Make tests deterministic, fast, and independent
- Use descriptive test names; test both forward pass and gradients when applicable
-## Review Process
+### Review Process
-- Review your own PR first: check for typos/formatting, verify tests pass, ensure documentation is updated, and confirm AI policy compliance
-- Respond promptly to review feedback
+- Review your own PR first: check for typos and formatting, run relevant tests, and update affected documentation
+- Respond to review feedback when you can
- Be open to feedback and explain your decisions when questioned
-- See [Pull Request](#pull-request) section for review requirements
-
-## AI-Assisted Development
-
-- Own the code you submit: understand it and be ready to address reviewer questions about it (see [AI Policy](#policies-and-guidelines))
-- Review AI output thoroughly: check for unnecessary complexity, verify it follows project conventions, ensure it uses existing utilities, and test it
-- Be transparent in PR descriptions about what was AI-assisted and what you manually reviewed (see [Pull Request](#pull-request) for AI Usage Disclosure requirements)
-- **AI Usage Disclosure in PR Template**: When completing the PR template's "AI Usage Disclosure" section:
- - Mark as **🟢 Human-written** if you wrote all code manually without AI assistance
- - Mark as **🟡 AI-assisted** if AI tools (Copilot, Cursor, etc.) helped with boilerplate/refactoring/drafts and you reviewed the resulting change and ran the relevant tests
- - Mark as **🔴 AI-generated** if an agent produced most of the code or the PR
- - **None of these is a bad answer, and the 🟡/🔴 line is fuzzy — pick the closest** — well-verified 🔴 PRs are welcome (our maintainers ship them too). Only demonstrable deception (verification that never ran, fabricated logs) closes PRs; arguable classifications are never litigated. See [AI_POLICY.md](AI_POLICY.md).
-
-## Communication
-
-- Write clear, concise PR descriptions (see [Pull Request](#pull-request) for requirements)
-- Always link to related issues or discussions in your PR description
-- Ask questions in Discord or PR comments if unsure; it's better to clarify early than to rework later
-
-# Pull Request
-
-## Which lane is your contribution?
-
-First, the honest context: AI has made pull requests cheap to produce and expensive to
-review, and we are a small volunteer team. We used to require maintainer approval and
-assignment before *any* work. That slowed down exactly the people we want most — someone
-who spotted a real bug and has an hour to fix it properly — while barely slowing down
-low-effort submissions at all. So we changed the deal: **we gate on evidence, not
-permission.** Pick your lane:
-
-### 🟢 Green lane — just send the PR (no issue, no assignment, no waiting)
-
-For contributions that carry their own evidence:
-
-- **Bug fixes, test-first**: your PR contains a test that **fails on `main`** and passes
- with your fix, plus pasted test logs. That failing test *is* your permission slip —
- it shows the bug is real, and it takes us minutes to verify. One honest caveat: it
- proves the behavior *changed*, not that the new behavior is *correct* — for
- numerical/geometry fixes, back the expected values with a reference or invariant
- (see the evidence ranking in [AI_POLICY.md](AI_POLICY.md)).
-- **Documentation fixes** where the PR description shows the snippet you ran to verify
- the corrected claim.
-- **[`help wanted` issues](https://github.com/kornia/kornia/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22help%20wanted%22)**:
- these are pre-approved, with acceptance criteria written in the issue. No assignment,
- no "can I work on this?" — the **first PR that meets the criteria wins**. (Interim
- honesty note: some older issues inherited this label from our previous templates —
- while we finish auditing them, check that the issue actually states acceptance
- criteria or has explicit maintainer confirmation before starting.) Please do
- check for an already-open PR on the same issue before starting; and to be fair about
- what "wins" means: starting first creates no entitlement — if duplicates land,
- maintainers merge the best-supported implementation, not the earliest timestamp.
-- **Benchmark results** from your hardware, via the `--contribute` flow in `benchmarks/`.
-
-### 🟠 Discuss-first lane — open an issue before writing code
-
-For contributions that change what kornia *means* or where it is going:
-
-- New features and new public APIs
-- **Any change to behavior, defaults, or conventions — even ones that look obviously
- wrong.** In a geometry library, changing a default silently breaks everyone who
- adapted to it. We have a specific protocol for fixing shipped conventions; propose
- the change in an issue and we will route it.
-- New models or integrations (mostly frozen — see the project direction in the README)
-- Large refactors
-
-Why discuss first? Because for this kind of work, the design conversation *is* the
-work — and skipping it means we sometimes have to reject finished code, which is
-painful for everyone. A maintainer confirming scope on the issue is your green light;
-formal assignment is optional.
-
-One honest asymmetry, stated openly: **maintainers skip the lane guardrails** — they
-hold the scope-setting authority these gates exist to route to, so making them ask
-themselves for permission would be theater. Their PRs still meet the same evidence,
-disclosure, and review bar (see [AI_POLICY.md](AI_POLICY.md)).
-
-### Application seasons (GSoC and similar)
-
-Around application deadlines we receive a large wave of first-time PRs. During
-announced application windows, first-time contributions are accepted from the green
-lane only. One well-verified green-lane PR helps your application far more than five
-hasty ones — we read review threads, not PR counts.
-
-## PR requirements
-
-- Pass all local tests before submission, and paste the test log in the PR description
- (this is how we know it ran — especially important for first-time contributors)
-- Green lane: state which green-lane category applies; for bug fixes, include the
- failing-test-on-`main` evidence
-- Discuss-first lane: link the issue (use "Closes #123" or "Fixes #123") where a
- maintainer confirmed the scope
-- Fill the [pull request template](.github/pull_request_template.md)
-- **AI Policy**: comply with [AI_POLICY.md](AI_POLICY.md) — use existing `kornia`
- utilities, be able to explain all submitted code, and complete the AI disclosure
- honestly (an honest 🔴 is fine; a dishonest 🟡 is not)
-- 15-Day Rule: PRs waiting on the author for 15+ days may be closed (reopen anytime)
-- Transparency: keep discussions public
-
-**Code review:**
-- By default, GitHub Copilot will check the PR against the AI Policy and the coding standards.
-- Code must be reviewed by the repository owner or a senior contributor, who have the final say on the quality and acceptance of the PR.
-
-**Note:** Tickets may be closed during cleanup. Feel free to reopen if you plan to finish the work.
-
-**CI checks:**
-- All tests pass
-- Test coverage maintained
-- Type checking (ty)
-- Documentation builds successfully
-- Code formatting (ruff, docformatter via pre-commit)
-
-Fix any failing checks before your PR will be considered.
-
-# License
+- Remember that review is done by people with limited time and may not happen quickly
+
+### Working with AI
+
+- AI tools are welcome. Read their output, check it in the same way you would check your own work, and tell us briefly how they helped.
+- Useful details include what the tool did, what you changed afterward, and what you checked yourself. We do not need a percentage or an authorship category.
+
+### Communication
+
+- Write a clear, concise pull request description
+- Link related issues or discussions when they exist
+- Ask questions in Discord, GitHub Discussions, or pull request comments when useful
+
+## Pull Request
+
+Fill in the [pull request template](.github/pull_request_template.md) with enough context for another person to understand the change. Link related issues or discussions when they exist, say what you checked, and tell us how AI helped if you used it.
+
+For bug fixes, a regression test that fails before the fix is especially helpful. For numerical or geometry changes, say where the expected behavior comes from. For new public APIs or behavior changes, an issue or discussion before a large implementation can uncover compatibility and design concerns early.
+
+Reviewers may ask for changes, tests, documentation, or a smaller scope. They may also decide that a contribution does not fit the project. We will try to explain why, but review is not guaranteed. Pull requests that have been quiet for a while may be closed and can be reopened later.
+
+**PR checks and merge requirements:**
+- Code changes run the CPU test matrix, dynamo/compile tests, and type checking with `ty`
+- Pre-commit checks formatting, linting, license headers, spelling, and repository file hygiene
+- Documentation changes run the documentation build
+- Every non-draft pull request gets an automated Copilot review when opened or marked ready and needs one maintainer approval
+- Pull requests are squash-merged
+
+If a check fails because of your change, please fix it or explain what you found.
+
+## License
By contributing, you agree to license your contributions under the Apache License. See [LICENSE](./LICENSE).
diff --git a/README.md b/README.md
index 9cd4a4691..9af63a820 100644
--- a/README.md
+++ b/README.md
@@ -148,8 +148,9 @@ For development, Kornia uses [pixi](https://pixi.sh) for fast Python package man
# Install pixi (if not already installed)
curl -fsSL https://pixi.sh/install.sh | bash
- # Install dependencies and set up the development environment
+ # Create the Pixi environment and install development dependencies
pixi install
+ pixi run install
# Run tests
pixi run test
@@ -159,7 +160,7 @@ For development, Kornia uses [pixi](https://pixi.sh) for fast Python package man
pixi run -e cuda test-cuda
```
-This will set up a complete development environment with all dependencies. For more details on dependency management and available tasks, see [CONTRIBUTING.md](CONTRIBUTING.md).
+These commands set up a complete development environment with all dependencies. For more details on dependency management and available tasks, see [CONTRIBUTING.md](CONTRIBUTING.md).
#### From Github url (latest version)
@@ -252,18 +253,18 @@ tf_kornia = kornia.to_tensorflow()
## Call For Contributors
-Are you passionate about computer vision, AI, and open-source development? Join us in shaping the future of Kornia! We are actively seeking contributors to help strengthen the library — making it more correct, faster, and better specified. Whether you're an experienced developer or just starting, there's a place for you in our community.
+If kornia is useful to you and you would like to help, contributions of many kinds are welcome: code, bug reports, benchmarks, documentation, questions, answers, and examples. The maintainers have limited time, so we cannot promise that every proposal or pull request will be reviewed or merged.
### Strengthen the Core (Priority)
Kornia's differentiated value is its geometry core: warping and sampling, homographies, cameras, epipolar geometry, rotations and Lie groups, and geometry-consistent augmentation. The highest-impact contributions make that core more trustworthy — see the [Roadmap](ROADMAP.md) for the full picture. Great entry points:
-- **Benchmark results from your hardware** *(green lane — just send the PR)*: run the benchmark suite with `--contribute` and send the JSON — CUDA numbers from diverse GPUs are especially wanted.
-- **Convention pinning tests and conformance vectors** for core geometry ops *(green lane once curated into a `help wanted` issue with acceptance criteria)*.
-- **Corrective error messages** *(same curation rule)*: upgrade bare shape asserts into errors that state what was wrong, what was expected, and which convention applies.
-- **Classical vision in the core domain** *(discuss-first — open an issue)*: camera intrinsic calibration, fiducial markers (ArUco/ChArUco), classical tracking, dense stereo, Hough transforms.
+- **Benchmark results from your hardware**: run the benchmark suite with `--contribute` and send the JSON — CUDA numbers from diverse GPUs are especially useful.
+- **Convention pinning tests and conformance vectors** for core geometry operations.
+- **Corrective error messages**: upgrade bare shape assertions into errors that state what was wrong, what was expected, and which convention applies.
+- **Classical vision in the core domain**: camera intrinsic calibration, fiducial markers (ArUco/ChArUco), classical tracking, dense stereo, and Hough transforms. An early design discussion can be useful for work of this size.
-See the [Roadmap's contributor areas](ROADMAP.md#areas-seeking-contributors) for how each of these routes through the contribution lanes.
+See the [Roadmap's contributor areas](ROADMAP.md#areas-seeking-contributors) for more project context.
### AI Models
@@ -289,18 +290,13 @@ If you are using kornia in your research-related documents, it is recommended th
## Contributing
-We appreciate all contributions, and we are honest about the world we operate in: AI makes code cheap to write, and volunteer review time is our scarcest resource. So our process gates on **evidence, not permission**:
-
-- **Small, evidence-bearing fixes go straight to a PR** — a bug fix with a test that fails on `main`, a docs fix with a verification snippet, or any [`help wanted`](https://github.com/kornia/kornia/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22help%20wanted%22) issue (pre-approved, no assignment needed — the best-supported PR wins).
-- **Features and behavior changes need a conversation first** — open an issue and get the scope confirmed before writing code. In a geometry library, changed defaults break users silently, so these get extra care.
-- **AI use is fine — including fully agent-written PRs.** Our own maintainers work this way. What we require is that *you* verified everything (pasted test logs, evidence-backed tests), can answer questions about the code during review, and disclose AI use honestly. What closes PRs is unverified work or unresolved correctness concerns — regardless of how the code was made.
-
-See [CONTRIBUTING.md](./CONTRIBUTING.md) for the details and [AI_POLICY.md](AI_POLICY.md) for the full policy. Participation is subject to the [Code of Conduct](./CODE_OF_CONDUCT.md).
+See [CONTRIBUTING.md](./CONTRIBUTING.md) for our social contract, development setup, and technical guidelines. Participation is subject to the [Code of Conduct](./CODE_OF_CONDUCT.md).
## Community
-- **Discord:** Join our workspace to keep in touch with our core contributors, get latest updates on the industry and be part of our community. [JOIN HERE](https://discord.gg/HfnywwpBnD)
-- **GitHub Issues:** bug reports, feature requests, install issues, RFCs, thoughts, etc. [OPEN](https://github.com/kornia/kornia/issues/new/choose)
-- **Forums:** discuss implementations, research, etc. [GitHub Forums](https://github.com/kornia/kornia/discussions)
+
+- **Discord:** talk with people who use and develop kornia. [Join the server](https://discord.gg/HfnywwpBnD)
+- **GitHub Issues:** report bugs and propose concrete changes. [Open an issue](https://github.com/kornia/kornia/issues/new/choose)
+- **GitHub Discussions:** ask questions and discuss implementations, research, and ideas. [Join a discussion](https://github.com/kornia/kornia/discussions)
<a href="https://github.com/Kornia/kornia/graphs/contributors">
<img src="https://contrib.rocks/image?repo=Kornia/kornia" width="60%" />
diff --git a/README_zh-CN.md b/README_zh-CN.md
index dae77987b..6b33710ba 100644
--- a/README_zh-CN.md
+++ b/README_zh-CN.md
@@ -90,8 +90,9 @@
# 安装 pixi(如果尚未安装)
curl -fsSL https://pixi.sh/install.sh | bash
- # 安装依赖并设置开发环境
+ # 创建 Pixi 环境并安装开发依赖
pixi install
+ pixi run install
# 运行测试
pixi run test
@@ -101,7 +102,7 @@
pixi run -e cuda test-cuda
```
- 这将设置一个包含所有依赖的完整开发环境。有关依赖管理和可用任务的更多详细信息,请参阅 [CONTRIBUTING.md](CONTRIBUTING.md)。
+ 这些命令将设置一个包含所有依赖的完整开发环境。有关依赖管理和可用任务的更多详细信息,请参阅 [CONTRIBUTING.md](CONTRIBUTING.md)。
#### 通过源码安装(从GIT自动下载最新代码):
@@ -139,24 +140,12 @@
```
## 贡献
-我们感谢所有的贡献者为改进和提升 Kornia 所作出的努力。您可以直接修复一个已知的BUG而无需进一步讨论;如果您想要添加一个任何新的或者扩展功能,请务必先通过提交一个Issue来与我们讨论。详情请阅读 [贡献指南](https://github.com/kornia/kornia/blob/main/CONTRIBUTING.md)。开源项目的参与者请务必了解如下 [规范](https://github.com/kornia/kornia/blob/main/CODE_OF_CONDUCT.md)。
-
-### AI 政策
-
-Kornia 接受 AI 辅助的代码,但严格拒绝提交者仅作为代理的 AI 生成贡献。所有贡献者必须是每一行代码的**唯一责任作者**。在提交 pull request 之前,请查看我们的 [AI 政策](AI_POLICY.md)。主要要求包括:
-
-- **验证证据**:PR 必须包含本地测试日志以证明代码已执行
-- **事前讨论**:所有 PR 在实施前必须在 Discord 或通过 GitHub issue 进行讨论
-- **库引用**:实现必须基于现有库引用(PyTorch、OpenCV 等)
-- **使用现有工具**:使用现有的 `kornia` 工具,而不是重新发明轮子
-- **解释能力**:您必须能够解释您提交的任何代码
-
-自动化 AI 审查工具(例如 GitHub Copilot)将根据这些政策检查 PR。完整详情请参阅 [AI_POLICY.md](AI_POLICY.md)。
+我们(维护者)为自己和计算机视觉社区开发 kornia。如果它对您有用,或者您愿意通过代码、错误报告、文档、问题或想法来帮助改进它,我们都会很高兴。维护者的时间有限,因此我们无法承诺审查或合并每一项提议。详情请阅读 [贡献指南](https://github.com/kornia/kornia/blob/main/CONTRIBUTING.md)。参与本项目时也请遵守 [行为准则](https://github.com/kornia/kornia/blob/main/CODE_OF_CONDUCT.md)。
## 社区
-- **论坛:** 讨论代码实现,学术研究等。[GitHub Forums](https://github.com/kornia/kornia/discussions)
-- **GitHub Issues:** bug reports, feature requests, install issues, RFCs, thoughts, etc. [OPEN](https://github.com/kornia/kornia/issues/new/choose)
-- **Slack:** 加入我们的Slack社区,与我们的核心贡献者保持联系。 [JOIN HERE](https://join.slack.com/t/kornia/shared_invite/zt-csobk21g-2AQRi~X9Uu6PLMuUZdvfjA)
+- **GitHub Discussions:** 提问,并讨论代码实现、研究和想法。[参与讨论](https://github.com/kornia/kornia/discussions)
+- **GitHub Issues:** 报告错误和提出具体更改。[提交 Issue](https://github.com/kornia/kornia/issues/new/choose)
+- **Discord:** 加入我们的 Discord 社区,与使用和开发 kornia 的人交流。[加入](https://discord.gg/HfnywwpBnD)
- 常见信息请访问我们的网站 www.kornia.org
## 中文社区
diff --git a/ROADMAP.md b/ROADMAP.md
index 15259855b..b7faf3ff4 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -5,10 +5,9 @@ high-impact work, to show users the direction of the project, and to make our
priorities legible to the wider community.
It is a living document. Dates are intentions, not commitments, and priorities shift
-as the ecosystem does. If you want to work on something here, check which
-contribution lane it falls into first (see
-[CONTRIBUTING.md](CONTRIBUTING.md)): small evidence-bearing fixes can go straight to
-a PR; features and behavior changes need a discussion on an issue first.
+as the ecosystem does. If you want to work on something here, the technical guidelines
+and social contract are in [CONTRIBUTING.md](CONTRIBUTING.md). For large features or
+behavior changes, an early conversation may save work and surface compatibility concerns.
**Where Kornia is going.** Kornia is becoming the **reference implementation and
executable specification** for differentiable computer vision and geometry in the
@@ -98,8 +97,8 @@ Four engineering north stars shape the roadmap below.
and hand-written Triton kernels are reserved for the small set of ops `inductor`
structurally cannot fuse.
-A fifth theme, **breadth**, is community-driven and runs through the discuss-first
-lane. One boundary is stated openly: **model-zoo expansion is frozen.** No new model
+A fifth theme, **breadth**, is community-driven. One boundary is stated openly:
+**model-zoo expansion is frozen.** No new model
or VLM/VLA integrations while maintainer bandwidth concentrates on the core; shipped
wrappers (LoFTR, LightGlue, DISK, DeDoDe, SAM, XFeat, ALIKED, Kimi-VL, …) remain
available and maintained under a *usable-or-deleted* rule. The single exception
@@ -126,9 +125,8 @@ and finish under the rules they started under.
- **CI truthfulness.** Every advertised CI matrix axis must actually reach the code
under test; first repair is the unused pytorch-version axis
([#3930](https://github.com/kornia/kornia/issues/3930)).
-- **Contribution policy v2** ([#3932](https://github.com/kornia/kornia/pull/3932)):
- the two-lane model (green lane / discuss-first), verification-based AI policy, and
- minimized templates.
+- **Contribution documentation:** keep the social contract, technical guidance, and
+ project automation consistent and easy to understand.
- **Progressively enable more `ruff` rule sets** to raise code health
([#2445](https://github.com/kornia/kornia/issues/2445)).
- **Docs modernization** — evaluate the migration to MkDocs
@@ -139,8 +137,8 @@ and finish under the rules they started under.
resolved; newly found maintenance work gets a current tracking issue with
acceptance criteria — no new integrations.
- **`help wanted` label audit.** Older issue templates auto-applied the label;
- re-triage the open `help wanted` issues so the label only marks genuinely
- pre-approved work with acceptance criteria, as the green lane requires.
+ re-triage open issues so the label points to current, well-described work where
+ outside help would be useful.
## Medium term — ~6 months
@@ -161,9 +159,9 @@ and finish under the rules they started under.
(`warp(inv(H), warp(H, img)) ≈ img`, `project(unproject(d, K), K) ≈ uv`,
`R @ R.T ≈ I`), and publish a docs page: *validate your (hand-written or
LLM-generated) geometry code against Kornia*.
-- **The agent knowledge layer.** `llms.txt` / `llms-full.txt` are live and
- benchmark-fed; after the final convention batch, ship `AGENTS.md` and a small set
- of validated skills (image warping & homographies, batched differentiable
+- **The agent knowledge layer.** `AGENTS.md` is live; `llms.txt` and `llms-full.txt` are live
+ and benchmark-fed. After the final convention batch, ship a small set of validated
+ skills (image warping & homographies, batched differentiable
augmentation with transform tracking, camera/epipolar conventions, feature
matching) — all derived from the canonical docs, never duplicating them.
- **The compile / export spine.** *In progress — much of the augmentation surface now
@@ -230,15 +228,12 @@ and finish under the rules they started under.
## Areas seeking contributors
-We especially welcome help in these areas. Curated
-[`help wanted`](https://github.com/kornia/kornia/labels/help%20wanted) issues with
-explicit acceptance criteria are green-lane entry points. While the legacy-label
-audit (short-term work above) is pending, check that the issue actually contains
-those criteria or an explicit maintainer confirmation before starting. No
-assignment needed — and if duplicate PRs land, maintainers merge the
-best-supported implementation, not the earliest. For anything feature-shaped,
-open or comment on an issue first (discuss-first lane, see
-[CONTRIBUTING.md](CONTRIBUTING.md)).
+We especially welcome help in these areas. The
+[`help wanted`](https://github.com/kornia/kornia/labels/help%20wanted) label is one
+place to look, although some older issues still need to be checked for current scope
+and context. Search for related issues and pull requests before investing substantial
+work, and see [CONTRIBUTING.md](CONTRIBUTING.md) for the social contract and technical
+guidelines.
**Classical vision in the core domain (highest priority):** these strengthen exactly
the geometry/camera surface the project is built around.
@@ -255,22 +250,20 @@ the geometry/camera surface the project is built around.
**Reference-core contributions:**
-- **Benchmark results from your hardware** (unconditionally green lane) — run the
+- **Benchmark results from your hardware** — run the
suite with `--contribute` and send the JSON; CUDA numbers from diverse GPUs are
especially wanted.
-- **Good candidates for curated `help wanted` issues** — convention pinning tests
- and conformance vectors for core geometry ops; corrective error messages
- (upgrading bare shape asserts into errors that state what was wrong, what was
- expected, which convention applies, and the likely fix). These become green-lane
- once a maintainer has written acceptance criteria into a `help wanted` issue —
- pinning behavior and changing raised errors are contract-adjacent edits, so they
- need that curation step first.
+- **Convention pinning tests and conformance vectors** for core geometry operations,
+ and **corrective error messages** (upgrading bare shape asserts into errors that
+ state what was wrong, what was expected, which convention applies, and the likely
+ fix). Because these changes can define or alter public behavior, sharing the
+ intended contract early is useful.
-**Augmentation parity** — low-priority, community-driven, discuss-first: Kornia does
+**Augmentation parity** — low-priority and community-driven: Kornia does
not compete on generic augmentation breadth (the differentiated value is
-differentiability, GPU batching, and transform tracking), but well-motivated parity
-transforms are accepted through the discuss-first lane: dropout-family transforms
-(CoarseDropout, GridDropout), grid/optical distortion, weather effects (fog, sun-flare),
+differentiability, GPU batching, and transform tracking). Ideas in this area include
+dropout-family transforms (CoarseDropout, GridDropout), grid/optical distortion,
+weather effects (fog, sun-flare),
noise variants (ISO noise), and additional compression transforms.
**Learned models — frozen (see the guiding themes):**
@@ -296,9 +289,7 @@ noise variants (ISO noise), and additional compression transforms.
## How to contribute
-See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, guidelines, and the two-lane
-model: **green lane** (test-first bug fixes, verified docs fixes, `help wanted`
-issues, benchmark results — just send the PR) and **discuss-first** (features and
-behavior changes — align on scope in an issue before writing code). Include local
-test output in your PR and cite a reference (paper, OpenCV, PyTorch, etc.) for any
-new algorithm.
+See [CONTRIBUTING.md](CONTRIBUTING.md) for the social contract, development setup,
+and technical guidelines. Tell us what you checked and how AI helped, if you used it.
+For a new algorithm, a reference such as a paper, OpenCV, or PyTorch makes the idea
+and implementation easier to understand.
diff --git a/TESTING.md b/TESTING.md
index 93740a6f5..3d2cd8179 100644
--- a/TESTING.md
+++ b/TESTING.md
@@ -11,16 +11,16 @@ Kornia uses [pixi](https://pixi.sh) to manage the test environment.
pixi run test
# Specific file
-pixi run test tests/geometry/test_boxes.py
+pixi run test-module tests/geometry/test_boxes.py
# Specific device and dtype
-pixi run test tests/ --device=cuda --dtype=float32
+pixi run test-module tests/ --device=cuda --dtype=float32
# All devices and dtypes
-pixi run test tests/ --device=all --dtype=all
+pixi run test --device=all --dtype=all
# Skip slow tests (default); include them with --runslow
-pixi run test tests/ --runslow
+pixi run test --runslow
# Quick tests (excludes jit, grad, nn markers)
pixi run test-quick
@@ -34,7 +34,7 @@ pixi run test-quick
| `--dtype` | `KORNIA_TEST_DTYPE` | `float32` | `float32`, `float64`, `float16`, `bfloat16`, or `all` |
| `--runslow` | `KORNIA_TEST_RUNSLOW` | off | Include `@pytest.mark.slow` tests |
| `--tf32` | `KORNIA_TEST_TF32` | off | Enable TF32 mode (see below) |
-| `--optimizer` | `KORNIA_TEST_OPTIMIZER` | `inductor` | `torch.compile` backend for dynamo tests |
+| `--optimizer` | `KORNIA_TEST_OPTIMIZER` | CLI: `inductor`; env: unset | Select the backend. Only setting the environment variable enables dynamo/compile collection; the CLI option alone does not. |
| `--isolate-half-precision` | `KORNIA_TEST_ISOLATE_HALF` | off | Run float16/bfloat16 CUDA tests each in a fresh `subprocess.run` process (no shared CUDA state) |
## Test Structure
@@ -199,7 +199,7 @@ If you write a new function that calls SVD, use `_torch_svd_cast` rather than ca
```bash
# Standard CI — all devices, float32 and float64 only
-pixi run test tests/ --dtype=float32,float64
+pixi run test --dtype=float32,float64
# Half-precision — run separately, per directory or file
pytest tests/color/ --dtype=float16,bfloat16
@@ -225,7 +225,7 @@ pytest tests/geometry/ --device=cuda --dtype=all --isolate-half-precision
# Via pixi tasks
pixi run test-half # float16 + bfloat16, CPU
-pixi run test-cuda-half # float16 + bfloat16, CUDA, with isolation
+pixi run -e cuda test-cuda-half # float16 + bfloat16, CUDA, with isolation
```
Without `--isolate-half-precision`, float16/bfloat16 CUDA tests are **skipped** (safe default for combined runs).
diff --git a/benchmarks/augmentation/README.md b/benchmarks/augmentation/README.md
index 2c91723f2..56d605c57 100644
--- a/benchmarks/augmentation/README.md
+++ b/benchmarks/augmentation/README.md
@@ -21,8 +21,8 @@ python benchmarks/augmentation/flagship.py --batches 1,8,32 --size 256 --device
python benchmarks/augmentation/pipeline.py --batch 32 --size 224 --device cuda --compile
```
-Each script prints the git commit, platform, and (on CUDA) the device name, per the benchmark
-guidelines in the root `CLAUDE.md`. Optional libraries that are not installed are reported as a
+Each script prints the git commit, platform, and (on CUDA) the device name, per the methodology
+contract in [`benchmarks/README.md`](../README.md). Optional libraries that are not installed are reported as a
skip line rather than failing the run.
## The regimes — why the numbers are not apples-to-apples
diff --git a/docs/source/_extra/llms.txt b/docs/source/_extra/llms.txt
index 18c687591..fd7bf2122 100644
--- a/docs/source/_extra/llms.txt
+++ b/docs/source/_extra/llms.txt
@@ -41,5 +41,5 @@ For the full self-contained reference with runnable examples, fetch [llms-full.t
- [Models](https://kornia.readthedocs.io/en/latest/models.html): pre-trained model wrappers (SAM, RT-DETR, YuNet, ...)
- [Benchmarks](https://github.com/kornia/kornia/tree/main/benchmarks): reproducible cross-library performance harness with current, honest numbers (where Kornia wins and loses)
- [GitHub repository](https://github.com/kornia/kornia): source, issue tracker
-- [Contributing guide](https://github.com/kornia/kornia/blob/main/CONTRIBUTING.md): contribution protocol
-- [AI usage policy](https://github.com/kornia/kornia/blob/main/AI_POLICY.md): rules for AI-assisted contributions
+- [Contributing guide](https://github.com/kornia/kornia/blob/main/CONTRIBUTING.md): social contract and technical guidelines
+- [AI and contributions](https://github.com/kornia/kornia/blob/main/AI_POLICY.md): short pointer to the contribution social contract
diff --git a/docs/source/applications/intro.rst b/docs/source/applications/intro.rst
index 3729e393c..440810c10 100644
--- a/docs/source/applications/intro.rst
+++ b/docs/source/applications/intro.rst
@@ -20,4 +20,4 @@ that can be used across different domains such as Robotics, Industrial applicati
.. admonition:: We are looking for contributors !!
- If you have any suggestion, proposal or just want to give us a hand - join our `Slack <https://join.slack.com/t/kornia/shared_invite/zt-csobk21g-2AQRi~X9Uu6PLMuUZdvfjA>`_
+ If you have a suggestion, proposal, or simply want to help, join our `Discord <https://discord.gg/HfnywwpBnD>`_.
diff --git a/docs/source/community/contribute.rst b/docs/source/community/contribute.rst
index b53426146..ecdd6c833 100644
--- a/docs/source/community/contribute.rst
+++ b/docs/source/community/contribute.rst
@@ -1,28 +1,21 @@
-Contribute to Kornia
+Contribute to kornia
====================
-Everyone is welcomed to get involved with the project. There are different ways in how you can put your two cents:
+We develop kornia for ourselves and the computer vision community. If the library is
+useful to you, that makes us happy, and you are welcome to help in whatever way suits
+you: report a bug, propose an idea, send code or documentation, answer a question, or
+tell others about the project.
-1. Ask/Answer questions in the #kornia tag in `Kornia Discuss <https://github.com/kornia/kornia/discussions>`_:
- - Please, don't use GitHub issues for Q&A.
+Maintainers review and respond when they can, but we cannot promise that every issue
+or pull request will be reviewed or merged. Our social contract, development setup,
+and technical guidelines are in the
+`Contributing guide <https://github.com/kornia/kornia/blob/main/CONTRIBUTING.md>`_.
-2. Report bugs through GitHub issues:
- - Do a quick search first to see whether others reported a similar issue.
- - In case you find an unreported bug, please open a new ticket.
- - Try to provide as much information as possible.
+Community links
+---------------
-3. Join our Slack `[HERE] <https://join.slack.com/t/kornia/shared_invite/zt-csobk21g-2AQRi~X9Uu6PLMuUZdvfjA>`_
-
-4. Fix a bug or develop a feature from the roadmap:
- - We will always have an open ticket showing the current roadmap.
- - Pick an unassigned feature (or potentially propose new one) or an open bug ticket.
- - Follow the instructions from `Developing Kornia <https://github.com/kornia/kornia/blob/main/CONTRIBUTING.md#developing-kornia>`_ to set up your development environment and start coding.
- - Checkout our coding conventions. See more details below.
- - Run the test framework locally and make sure all works as expected before sending a pull request.
- - Open a Pull Request, get the green light from the CI and get your code merged.
-
-5. Donate resources to the project through `GitHub Sponsor <https://github.com/sponsors/edgarriba>`_ or `Open Collective <https://opencollective.com/kornia>`_ !
-
-For more information about our development process, see our `Developers corner <https://github.com/kornia/kornia/blob/main/CONTRIBUTING.md#developing-kornia>`_.
-
-**Happy coding !**
+- Ask questions and discuss ideas in `GitHub Discussions <https://github.com/kornia/kornia/discussions>`_.
+- Report bugs and propose concrete changes in `GitHub Issues <https://github.com/kornia/kornia/issues/new/choose>`_.
+- Talk with people who use and develop kornia on `Discord <https://discord.gg/HfnywwpBnD>`_.
+- Support the project through `GitHub Sponsors <https://github.com/sponsors/kornia>`_
+ or `Open Collective <https://opencollective.com/kornia>`_.
diff --git a/docs/source/get-started/governance.rst b/docs/source/get-started/governance.rst
index 2143f84bd..c7478e7cc 100644
--- a/docs/source/get-started/governance.rst
+++ b/docs/source/get-started/governance.rst
@@ -28,9 +28,9 @@ How to contribute ?
- Make a donation to the organization via:
- `Open Collective <https://opencollective.com/kornia>`_
- - `Github sponsors <https://github.com/sponsors/kornia>`_
+ - `GitHub Sponsors <https://github.com/sponsors/kornia>`_
- Join the community and help us to maintain the library and its ecosystem projects.
- - `Kornia Slack <https://join.slack.com/t/kornia/shared_invite/zt-csobk21g-2AQRi~X9Uu6PLMuUZdvfjA>`_
+ - `Kornia Discord <https://discord.gg/HfnywwpBnD>`_
- Help us to organize events such as workshops, meetups related to Computer Vision and robotics.
- Help us to write blog posts, tutorials, and other educational material to promote the use of Kornia and its ecosystem projects in the industry and academia.
diff --git a/docs/source/get-started/precision.rst b/docs/source/get-started/precision.rst
index c24b00b7f..d2ee0f216 100644
--- a/docs/source/get-started/precision.rst
+++ b/docs/source/get-started/precision.rst
@@ -176,7 +176,7 @@ corrupting the CUDA context and causing unrelated float32 tests to fail.
.. code-block:: bash
# Standard precision — default CI
- pixi run test tests/ --dtype=float32,float64
+ pixi run test --dtype=float32,float64
# Half-precision — run in isolation, per directory
pytest tests/color/ --dtype=float16,bfloat16
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 91215ef67..a53533a00 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -89,7 +89,7 @@ Join the community
- Join our social network communities with 1.8k+ members:
- `Twitter <https://twitter.com/kornia_foss>`_: we share recent research and news with our community.
- - `Slack <https://join.slack.com/t/kornia/shared_invite/zt-csobk21g-2AQRi~X9Uu6PLMuUZdvfjA>`_: come to us and chat with our engineers and mentors to get support and resolve your questions.
+ - `Discord <https://discord.gg/HfnywwpBnD>`_: talk with people who use and develop kornia.
- Subscribe to our `YouTube channel <https://www.youtube.com/channel/UCI1SE1Ij2Fast5BSKxoa7Ag>`_ to get the latest video demos.
----
@@ -171,7 +171,7 @@ Join the community
:hidden:
Issue tracker <https://github.com/kornia/kornia/issues>
- Slack community <https://join.slack.com/t/kornia/shared_invite/zt-csobk21g-2AQRi~X9Uu6PLMuUZdvfjA>
+ Discord community <https://discord.gg/HfnywwpBnD>
LibreCV community <https://librecv.org>
Twitter @kornia_foss <https://twitter.com/kornia_foss>
community/chinese
diff --git a/pixi.lock b/pixi.lock
index c6a0df2c0..40f06bdb2 100644
--- a/pixi.lock
+++ b/pixi.lock
@@ -71,51 +71,6 @@ environments:
- conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2025c-h8577fbf_0.conda
- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/uv-0.9.18-haeed4ea_0.conda
- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/zstd-1.5.7-h85ac4a6_6.conda
- osx-64:
- - conda: https://conda.anaconda.org/conda-forge/noarch/_python_abi3_support-1.0-hd8ed1ab_2.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-64/bzip2-1.0.8-h500dc9f_8.conda
- - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2025.11.12-hbd8a1cb_0.conda
- - conda: https://conda.anaconda.org/conda-forge/noarch/cpython-3.11.14-py311hd8ed1ab_2.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-64/icu-78.1-h14c5de8_0.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-64/libcxx-21.1.8-h3d58e20_0.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-64/libexpat-2.7.3-heffb93a_0.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-64/libffi-3.5.2-h750e83c_0.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-64/liblzma-5.8.1-hd471939_2.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-64/libsqlite-3.51.1-hd09e2f1_1.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-64/libzlib-1.3.1-hd23fc13_2.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-64/ncurses-6.5-h0622a9a_3.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-64/openssl-3.6.0-h230baf5_0.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-64/python-3.11.14-h74c2667_2_cpython.conda
- - conda: https://conda.anaconda.org/conda-forge/noarch/python-gil-3.11.14-hd8ed1ab_2.conda
- - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.11-8_cp311.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-64/readline-8.3-h68b038d_0.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-64/tk-8.6.13-hf689a15_3.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-64/tombi-0.7.11-ha9c3995_0.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-64/ty-0.0.9-h3e8ffd6_0.conda
- - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2025c-h8577fbf_0.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-64/uv-0.9.18-h3315dae_0.conda
- osx-arm64:
- - conda: https://conda.anaconda.org/conda-forge/noarch/_python_abi3_support-1.0-hd8ed1ab_2.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-arm64/bzip2-1.0.8-hd037594_8.conda
- - conda: https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2025.11.12-hbd8a1cb_0.conda
- - conda: https://conda.anaconda.org/conda-forge/noarch/cpython-3.11.14-py311hd8ed1ab_2.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libcxx-21.1.8-hf598326_0.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libexpat-2.7.3-haf25636_0.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libffi-3.5.2-he5f378a_0.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-arm64/liblzma-5.8.1-h39f12f2_2.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libsqlite-3.51.1-h1b79a29_1.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-arm64/libzlib-1.3.1-h8359307_2.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-arm64/ncurses-6.5-h5e97a16_3.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-arm64/openssl-3.6.0-h5503f6c_0.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-arm64/python-3.11.14-h18782d2_2_cpython.conda
- - conda: https://conda.anaconda.org/conda-forge/noarch/python-gil-3.11.14-hd8ed1ab_2.conda
- - conda: https://conda.anaconda.org/conda-forge/noarch/python_abi-3.11-8_cp311.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-arm64/readline-8.3-h46df422_0.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-arm64/tk-8.6.13-h892fb3f_3.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-arm64/tombi-0.7.11-h6fdd925_0.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-arm64/ty-0.0.9-ha73ee7d_0.conda
- - conda: https://conda.anaconda.org/conda-forge/noarch/tzdata-2025c-h8577fbf_0.conda
- - conda: https://conda.anaconda.org/conda-forge/osx-arm64/uv-0.9.18-h1bde295_0.conda
win-64:
- conda: https://conda.anaconda.org/conda-forge/noarch/_python_abi3_support-1.0-hd8ed1ab_2.conda
- conda: https://conda.anaconda.org/conda-forge/win-64/bzip2-1.0.8-h0ad9c76_8.conda
diff --git a/pixi.toml b/pixi.toml
index 62a82500d..f849d0fe4 100644
--- a/pixi.toml
+++ b/pixi.toml
@@ -43,9 +43,12 @@ test-f32 = { cmd = "uv run pytest -v tests/", env = { KORNIA_TEST_DTYPE = "float
test-f64 = { cmd = "uv run pytest -v tests/", env = { KORNIA_TEST_DTYPE = "float64" } }
test-slow = { cmd = "uv run pytest -v tests/", env = { KORNIA_TEST_RUNSLOW = "true" } }
test-quick = { cmd = "uv run pytest -v -m 'not (jit or grad or nn)' tests/" }
+test-half = { cmd = "uv run pytest -v tests/", env = { KORNIA_TEST_DTYPE = "float16,bfloat16" }, description = "Run CPU half-precision tests" }
test-module = { cmd = "uv run pytest -v", description = "Run tests for a specific module (usage: pixi run test-module tests/<module_path>, e.g., pixi run test-module tests/contrib/)" }
# Quality
lint = { cmd = "uv run pre-commit run ruff-check --all-files && uv run pre-commit run ruff-format --all-files" }
+pre-commit-all = { cmd = "uv run pre-commit run --all-files", description = "Run all repository pre-commit checks" }
+pre-commit-install = { cmd = "uv run pre-commit install", description = "Install the pre-commit Git hook" }
typecheck = { cmd = "ty check kornia" }
doctest = { cmd = "uv run pytest -v --doctest-modules kornia/" }
toml-fmt = { cmd = "tombi format", description = "Format TOML files" }
@@ -55,7 +58,7 @@ build-docs = { cmd = "uv run python -m sphinx -W -b html docs/source docs/build/
"install-docs"
] }
# Utility
-clean = { cmd = "find . -type f -name '*.pyc' -delete && find . -type d -name '__pycache__' -delete && rm -rf .venv" }
+clean = { cmd = "find . -type f -name '*.pyc' -delete && find . -type d -name '__pycache__' -delete && rm -rf .venv .venv-py312 .venv-py313" }
# ------------------------------------------------------------------------------
# Restrict CUDA feature to supported platforms only
@@ -75,7 +78,6 @@ install-docs = { cmd = "uv sync --extra dev --extra docs --extra x && uv pip ins
test-cuda = { cmd = "uv run pytest -v tests/", env = { KORNIA_TEST_DEVICE = "cuda" }, description = "Run tests on CUDA" }
test-cuda-f32 = { cmd = "uv run pytest -v tests/", env = { KORNIA_TEST_DEVICE = "cuda", KORNIA_TEST_DTYPE = "float32" } }
test-cuda-f64 = { cmd = "uv run pytest -v tests/", env = { KORNIA_TEST_DEVICE = "cuda", KORNIA_TEST_DTYPE = "float64" } }
-test-half = { cmd = "uv run pytest -v tests/", env = { KORNIA_TEST_DTYPE = "float16,bfloat16" }, description = "Run half-precision tests (CPU; use test-cuda-half for CUDA isolation)" }
test-cuda-half = { cmd = "uv run pytest -v tests/ --isolate-half-precision", env = { KORNIA_TEST_DEVICE = "cuda", KORNIA_TEST_DTYPE = "float16,bfloat16" }, description = "Run half-precision CUDA tests with per-test subprocess isolation" }
# ------------------------------------------------------------------------------
@@ -88,5 +90,11 @@ python = "3.11.*"
[feature.py312.dependencies]
python = "3.12.*"
+[feature.py312.activation.env]
+UV_PROJECT_ENVIRONMENT = ".venv-py312"
+
[feature.py313.dependencies]
python = "3.13.*"
+
+[feature.py313.activation.env]
+UV_PROJECT_ENVIRONMENT = ".venv-py313"
diff --git a/pr_body.txt b/pr_body.txt
deleted file mode 100644
index 8d47aaa2e..000000000
--- a/pr_body.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-> Description: This PR introduces Google-style structural docstrings to the kornia.losses.dice module, resolving the missing D101, D102, and D103 Ruff violations.
-
-Related Issue: Fixes #3083
-Verification: 12 passed, 43 warnings (local Windows test-bed).
-AI Disclosure: ?? AI-assisted via GitHub Copilot CLI; verified by Siddharth Jaspal.
diff --git a/pyproject.toml b/pyproject.toml
index e3221b18a..5a19d5cee 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -79,13 +79,6 @@ docs = [
requires = ["hatchling"]
build-backend = "hatchling.build"
-[tool.codeflash]
-module-root = "kornia"
-tests-root = "tests"
-test-framework = "pytest"
-ignore-paths = []
-formatter-cmds = ["disabled"]
-
# =============================================================================
# uv configuration
# =============================================================================