News for hackers. Stuff that matters.
Re:Don't "optimize" conditional moves in shaders with mix()+... by Dylan16807 on Tuesday February 11, 2025 @07:43PM (#43020348)
> Not any.

Just about any. It's pretty difficult to write code where changing the rounding of the last couple bits breaks it (as happens if you use wider types during the calculation), but other changes don't break it.

What real code have you seen with that behavior?

Re:Don't "optimize" conditional moves in shaders with mix()+... by chrisjj on Friday February 14, 2025 @08:31AM (#43048082)
> but other changes don't break it.

Why should that be a requirement? Obviously the driver can make other changes that can break any code.

Re:Don't "optimize" conditional moves in shaders with mix()+... by Dylan16807 on Friday February 14, 2025 @02:20PM (#43052007)
> Why should that be a requirement?

Originally I said "the premise is that any difference breaks the code".

You replied with "Not any."

That is where the requirement comes from, your own words. This is your scenario, and you said not all differences would break the hypothetical code.

This is your choice. Are we talking about code where any change breaks it (like a seeded/reproducible RNG), or are we talking about code where there are minor changes that don't break it but using extra precision breaks it? (I expect this category to be super duper rare)

Re:Don't "optimize" conditional moves in shaders with mix()+... by chrisjj on Sunday February 16, 2025 @06:31AM (#43067276)
> Originally I said "the premise is that any difference breaks the code".

> You replied with "Not any."

> That is where the requirement comes from, your own words.

I wasn't stating a requirement. I was disputing your report of the premise.

> or are we talking about code where there are minor changes that don't break it but using extra precision breaks it?

Yup.

Re:Don't "optimize" conditional moves in shaders with mix()+... by Dylan16807 on Tuesday February 18, 2025 @10:04PM (#43098100)
> > or are we talking about code where there are minor changes that don't break it but using extra precision breaks it?

> Yup

Then I will ask again, have you ever seen code that falls into this category? I haven't. And an RNG would not fall into this category.