Skip to content

feat: multiplicative quality normalization and propagation across transform chains#265

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/implement-quality-propagation
Draft

feat: multiplicative quality normalization and propagation across transform chains#265
Copilot wants to merge 2 commits intomainfrom
copilot/implement-quality-propagation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 8, 2026

Transform quality was accepted as an unclamped f32, allowing invalid values outside [0.0, 1.0], and TransformPath had no direct unit tests for its multiplicative quality computation.

Changes

Quality normalization — TransformEdge::new()

  • Clamps the quality argument to [0.0, 1.0] at construction time, enforcing the invariant regardless of caller input
// Before: quality stored as-is (could be negative or > 1.0)
Self { from, to, cost, quality }

// After: silently clamped to valid range
Self { from, to, cost, quality: quality.clamp(0.0, 1.0) }

Quality propagation tests — pathfinding.rs

Added a #[cfg(test)] module directly on TransformPath::from_steps() covering:

  • Single-step quality and cost identity
  • Two-step multiplicative product (0.9 × 0.8 = 0.72)
  • Three-step chain propagation (0.9 × 0.8 × 0.7 = 0.504)
  • Perfect-quality path (1.0 × 1.0 = 1.0)
  • Zero-quality edge collapsing entire path quality to 0.0

Normalization boundary tests — transform_edge.rs

Explicit tests for values above 1.0, below 0.0, and at exact boundaries.

Copilot AI changed the title [WIP] Implement quality propagation across transformation chains feat: multiplicative quality normalization and propagation across transform chains Apr 8, 2026
Copilot AI requested a review from szmyty April 8, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🧬 Model quality as multiplicative degradation across transforms

2 participants