Skip to content

Explore alternatives to magic constants in compare distance weights #177

Description

@chailandau

Context

The compare function uses hand-tuned magic constants for distance weighting:

  • oklchDistance weights: 0.5/2/0.3
  • Dimension WEIGHTS (palette-heavy)
  • Overall threshold: distance > 0.5 gates CI exit code

These are hand-tuned with no tests pinning their exact values to specific perceptual outcomes — they encode taste. Retuning them silently shifts every downstream gate and cluster boundary.

Problem

As an OSS project, this raises questions:

  • Who decides taste / these constants?
  • Is there an impartial, evidence-based way to keep things correlated rather than relying on subjective tuning?
  • Any retune is high-leverage and least-guarded — no tests catch drift in perceptual outcomes.

Exploration areas

  • Could we derive weights from empirical data (e.g., perceptual studies, A/B testing against human judgment)?
  • Could weights be configurable per-fingerprint rather than global constants?
  • Could we add regression tests that pin perceptual outcomes to specific inputs, so weight changes are at least visible?
  • Literature review: are there established approaches for combining perceptual color distance + set/embedding distances with principled weighting?

Track

Track 1 (The Fingerprint) — making the artifact extensible and evidence-driven.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions