block / block/ghost

Explore alternatives to magic constants in compare distance weights

Open
#177 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
31
Forks
7
Avg merge
1d 1h
Merged PRs (30d)
35

Description

## 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.