Skip to content

Add smoothstep node#4189

Open
benstockil wants to merge 2 commits into
GraphiteEditor:masterfrom
benstockil:feat/smoothstep-node
Open

Add smoothstep node#4189
benstockil wants to merge 2 commits into
GraphiteEditor:masterfrom
benstockil:feat/smoothstep-node

Conversation

@benstockil
Copy link
Copy Markdown

Add smoothstep node, as per OpenGL reference.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new smoothstep node in the math library to perform smooth Hermite interpolation. The review feedback points out a documentation error where edge_max is incorrectly described as mapping values above it to 0 instead of 1. Additionally, the feedback identifies a potential division-by-zero/NaN propagation issue when edge_min equals edge_max, and notes that the indentation of the new code should be updated to use tabs instead of spaces.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread node-graph/nodes/math/src/lib.rs Outdated
Comment thread node-graph/nodes/math/src/lib.rs Outdated
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 1 file

Confidence score: 3/5

  • There is a concrete regression risk in node-graph/nodes/math/src/lib.rs: when edge_min == edge_max, the denominator becomes 0.0, yielding NaN that can propagate through clamp and downstream math.
  • Given the severity (7/10) and high confidence, this is user-impacting behavior rather than a cosmetic issue, so merge risk is moderate until guarded.
  • A secondary issue in node-graph/nodes/math/src/lib.rs is documentation mismatch for edge_max (docs say outputs map to 0, while smoothstep behavior maps above the upper edge to 1).
  • Pay close attention to node-graph/nodes/math/src/lib.rs - add a zero-width-edge guard and align edge_max docs with actual smoothstep output.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread node-graph/nodes/math/src/lib.rs Outdated
Comment thread node-graph/nodes/math/src/lib.rs Outdated
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