Skip to content

test(filters): clamp luminance to avoid threshold rounding failures - #145

Open
wesleydanieell wants to merge 1 commit into
artcraft-android:mainfrom
wesleydanieell:fix/plugin-filter-test-threshold
Open

wesleydanieell wants to merge 1 commit into
artcraft-android:mainfrom
wesleydanieell:fix/plugin-filter-test-threshold

Conversation

@wesleydanieell

Copy link
Copy Markdown
Contributor

This PR fixes two GPU-based filter tests that fail at a zero cut-off threshold.

The test shader calculates darkness from RGB luminance. Floating-point rounding can produce a value slightly below zero for pure white, causing step(0.0, dark) to incorrectly discard a pixel. Clamping darkness to the valid [0.0, 1.0] range makes the expected behavior stable.

Only the test shader fixture changes; production filter behavior is unchanged.

Testing

  • cargo fmt --all --check
  • cargo test -p procraft-core — 712 passed, 0 failed, 15 ignored.

bearinmindcat added a commit that referenced this pull request Nov 11, 2026
…white never rounds below zero (#145)

Co-authored-by: Wesley <danielwesley266@gmail.com>
@bearinmindcat

Copy link
Copy Markdown
Contributor

4922ba7

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.

2 participants