Skip to content

Use f64 everywhere in animation logic - #392

Merged
Loirooriol merged 1 commit into
servo:mainfrom
Loirooriol:animation-f64
Jun 15, 2026
Merged

Loirooriol merged 1 commit into
servo:mainfrom
Loirooriol:animation-f64

Conversation

@Loirooriol

@Loirooriol Loirooriol commented Jun 14, 2026 •

Copy link
Copy Markdown
Collaborator

We were previously using a mix of f32 and f64. Then it could happen that we would first check that a < b in f64, but when converting to f32, they might become equal due to the precision loss. Thus this could break invariants in the logic, making a debug_unreachable!() reachable.

Servo PR: servo/servo#45682

We were previously using a mix of f32 and f64. Then it could happen that
we would first check that `a < b` in f64, but when converting to f32,
they might become equal due to the precision loss. Thus this could break
invariants in the logic, making a `debug_unreachable!()` reachable.

Co-authored-by: Martin Robinson <[email protected]>
Signed-off-by: Oriol Brufau <[email protected]>
@Loirooriol
Loirooriol requested a review from mrobinson June 14, 2026 15:34
@Loirooriol
Loirooriol added this pull request to the merge queue Jun 15, 2026
Merged via the queue into servo:main with commit c3e18f3 Jun 15, 2026
5 checks passed
@Loirooriol
Loirooriol deleted the animation-f64 branch June 15, 2026 09:39
nicoburns pushed a commit to nicoburns/servo that referenced this pull request Jun 15, 2026
Bumps Stylo to servo/stylo#392

This avoids potential assert failures due to the precision loss of
converting f64 into f32.

Testing: Adds a crashtest. Since the problem was dependent on timing, it
would only fail intermittently. With the fix it should never fail.
Fixes: servo#45008

Signed-off-by: Oriol Brufau <[email protected]>
Co-authored-by: Martin Robinson <[email protected]>
TG199 pushed a commit to TG199/servo that referenced this pull request Jun 21, 2026
Bumps Stylo to servo/stylo#392

This avoids potential assert failures due to the precision loss of
converting f64 into f32.

Testing: Adds a crashtest. Since the problem was dependent on timing, it
would only fail intermittently. With the fix it should never fail.
Fixes: servo#45008

Signed-off-by: Oriol Brufau <[email protected]>
Co-authored-by: Martin Robinson <[email protected]>
Loirooriol added a commit that referenced this pull request Jul 1, 2026
We were previously using a mix of f32 and f64. Then it could happen that
we would first check that `a < b` in f64, but when converting to f32,
they might become equal due to the precision loss. Thus this could break
invariants in the logic, making a `debug_unreachable!()` reachable.

Servo PR: servo/servo#45682

Signed-off-by: Oriol Brufau <[email protected]>
Co-authored-by: Martin Robinson <[email protected]>
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.

3 participants