kornia/kornia-rs

Clean up #1111 scaffolding: TEMP test name/comment and lightweight_vio reference in public rustdoc

Open

#1,120 opened on Aug 19, 2026

 (1 comment) (0 reactions) (0 assignees)Rust (188 forks)auto 404
crate: pnpdocumentationgood first issuetriage

Repository metrics

Stars
 (675 stars)
PR merge metrics
 (Avg merge 3d 9h) (39 merged PRs in 30d)

Description

📝 Description

#1111 merged with some development scaffolding still in place in crates/kornia-3d/src/pnp/refine.rs. Two items, both reaching a public surface.

1. Temporary test left in the suite. The test is a genuinely useful regression check — it demonstrates that Huber suppresses a 300px outlier (no_robust_vs_clean_rmse=81.2 vs huber_vs_clean_rmse=1.49) — but it is named and commented as disposable:

// TEMP verification test (Claude): checks that `robust: Huber` actually
// suppresses a gross outlier's influence on the LM solve, vs. plain L2.
// Not part of the requested scaffold — delete or keep at your discretion.
#[test]
fn temp_huber_suppresses_outlier_influence() -> Result<(), PnPError> {

Suggested: keep the test, drop the comment, rename to something durable such as huber_suppresses_gross_outlier_influence, and consider replacing the bare println! with the assertion messages already present.

2. Reference to an unrelated external codebase in published rustdoc. The doc comment on LMRefineParams::robust reads:

/// M-estimator kernel applied per-residual (pixel-space, unlike
/// lightweight_vio's chi-square-whitened residuals — this crate's
/// `ReprojectionFactor` residual is raw pixel error). `Identity`
/// collapses to plain L2 (today's behavior, so this field is
/// backward-compatible).

lightweight_vio is not part of this workspace and means nothing to a reader of kornia's docs; this text renders into published rustdoc for a public field. The useful half of the comment is the units statement, which is worth keeping on its own terms — ReprojectionFactor's residual is raw pixel error, so robust_scale_sq is in px², unlike the whitened-residual convention used elsewhere. BaParams::robust at ba.rs:236 is a good model for the phrasing.

Also minor, same file: the two adjacent use kornia_algebra::optim::{...} statements introduced by the PR can be merged into one.

✅ Expected behaviour

Public docs and test names in main should not carry authoring artifacts or point at codebases outside the workspace.

📎 Context

Follow-up to #1111. Companion issues: #1117 (NaN loss parameter), #1118 (shared step tolerance), #1119 (Tukey inconsistency).

Contributor guide