Skip to content

Conversation

@swoods-nv
Copy link
Contributor

No description provided.

@swoods-nv swoods-nv requested a review from kaizhangNV August 6, 2025 18:06
Copy link
Contributor

@csyonghe csyonghe left a comment

Choose a reason for hiding this comment

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

I think it maybe useful to add one or more concrete slang code snippets to demonstrate how to solve that particular problem in each section.

@swoods-nv
Copy link
Contributor Author

I think it maybe useful to add one or more concrete slang code snippets to demonstrate how to solve that particular problem in each section.

I am going to need assistance on this part.

@swoods-nv
Copy link
Contributor Author

I think it maybe useful to add one or more concrete slang code snippets to demonstrate how to solve that particular problem in each section.

I am going to need assistance on this part.

Okay, I've constructed some very basic sample snippets, but please check them to make sure they're illustrative, correct, and a sane way to address the specified issues.

float denomStable = denominator.p + epsilon;
// Clamp gradients to prevent explosion when denominator is very small
float dNumerator = clamp(dOut / denomStable, -maxGradient, maxGradient);
float dDenominator = clamp(-dOut * numerator / (denomStable * denomStable), -maxGradient, maxGradient);
Copy link
Contributor

Choose a reason for hiding this comment

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

numerator.p

@csyonghe csyonghe merged commit 3b9b850 into shader-slang:main Aug 8, 2025
@swoods-nv swoods-nv deleted the custom-diffs-take2 branch August 10, 2025 22:10
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