Skip to content

Comments

fix: improve floating-point precision handling in bernstein function#1388

Merged
yiiqii merged 1 commit intodevfrom
fix/ffd-comp
Feb 4, 2026
Merged

fix: improve floating-point precision handling in bernstein function#1388
yiiqii merged 1 commit intodevfrom
fix/ffd-comp

Conversation

@ChengYi996
Copy link
Collaborator

问题:
部分 GPU(如 Adreno 740)在边界计算时产生微小浮点误差,
导致顶点被错误判定为越界。

解决方案:
使用 clamp() 容忍浮点精度误差,并添加参数有效性检查。

之前:
// ❌ 不处理(假设精度完美)
if(t > 1.0) return 0.0; // 1.0000002 会被拒绝

现在:
// ✅ 处理(容忍精度误差)
t = clamp(t, 0.0, 1.0); // 1.0000002 修正为 1.0
if(k < 0 || k > n) return 0.0;

@ChengYi996 ChengYi996 requested a review from yiiqii January 30, 2026 09:35
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 30, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • plugin-packages/ffd/src/shader/vertex.glsl is excluded by !**/*.glsl

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/ffd-comp

Tip

🧪 Unit Test Generation v2 is now available!

We have significantly improved our unit test generation capabilities.

To enable: Add this to your .coderabbit.yaml configuration:

reviews:
  finishing_touches:
    unit_tests:
      enabled: true

Try it out by using the @coderabbitai generate unit tests command on your code files or under ✨ Finishing Touches on the walkthrough!

Have feedback? Share your thoughts on our Discord thread!


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@yiiqii yiiqii changed the base branch from main to dev February 4, 2026 07:24
@yiiqii yiiqii merged commit 5615b5e into dev Feb 4, 2026
2 checks passed
@yiiqii yiiqii deleted the fix/ffd-comp branch February 4, 2026 07:24
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