Skip to content

fix(deficiency): interpolate between severity matrices#274

Open
spokodev wants to merge 1 commit into
Evercoder:mainfrom
spokodev:fix/deficiency-severity-interpolation
Open

fix(deficiency): interpolate between severity matrices#274
spokodev wants to merge 1 commit into
Evercoder:mainfrom
spokodev:fix/deficiency-severity-interpolation

Conversation

@spokodev

@spokodev spokodev commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

filterDeficiency* documents a continuous severity in [0, 1] and the code has a blend between the Machado 0.1-step matrices, but the blend was dead code so severity snapped to the nearest tabulated step. Math.round(tt % 0.1) is always 0 because tt % 0.1 is in [0, 0.1), so the interpolation branch never ran. Severities in [0, 0.05) produced the identity (no effect), and 0.05 to 0.14 all equaled the 0.1 matrix.

This computes the matrix index and blend weight with floor and the fractional part, so adjacent matrices are interpolated as intended. Endpoints and the documented 0.5 example are unchanged. The one existing 0.55 snapshot encoded the previous snapped output and is updated to the interpolated values; a new test asserts the halfway blend at severity 0.05.

The interpolation weight was computed with Math.round on the sub-step
remainder, which is always zero, so the blend between neighboring
matrices never ran and the severity snapped to the nearest tabulated
step. Map severity onto the matrix index and use the fractional part as
the blend weight.
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.

1 participant