• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bitshifter / glam-rs / 36109957285
99%

Build:
DEFAULT BRANCH: main
Ran 25 Sep 2026 07:55AM UTC
Jobs 4
Files 154
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Sep 2026 07:53AM UTC coverage: 98.994% (-0.03%) from 99.028%
36109957285

push

github

web-flow
feat: add `lerp_monotonic` for float vector types (#854)

# Objective

- Fixes #823.

`lerp` keeps the form `self * (1 - s) + rhs * s` because that is the
linear blend used by GLSL and WGSL. It is exact at `s == 1` even for
inputs that differ greatly in magnitude, but it is not monotonic in `s`
for nearly equal inputs and does not preserve equal inputs exactly,
which causes jitter when interpolating between values that are at rest.

## Solution

- Add `lerp_monotonic` to `Vec2`/`Vec3`/`Vec3A`/`Vec4` and
`DVec2`/`DVec3`/`DVec4`, using the monotonic form `self + (rhs - self) *
s`.
- Use a fused multiply-add on SIMD back-ends where available: SSE2 via
`m128_mul_add` (when the target has FMA) and NEON via `vfmaq_f32`.
- Leave `lerp` unchanged so existing callers keep the current rounding;
#823 is addressed by opting into `lerp_monotonic`.
- Change `FloatExt::lerp` to the form used by the vector methods. This
changes `remap`/`inverse_lerp` for infinite `t` from infinite to NaN.
- Document the form used by both methods and when to prefer each.

`lerp_monotonic` preserves equal inputs exactly and is monotonic in `s`.
Because `rhs - self` is evaluated first, it is less accurate when the
inputs differ greatly in magnitude and overflows for opposite-sign
extremes.

Quaternions are unchanged. Normalisation already removes the equal-input
jitter, and a monotone blend measured no benefit for `Quat`/`DQuat`.

## Tests

- `test_lerp_monotonic` covers the endpoints, exact preservation of
equal inputs, monotonicity in `s`, and both tradeoffs above.
- Added `FloatExt::lerp` big-difference coverage and updated
`test_remap`.

65 of 65 new or added lines in 15 files covered. (100.0%)

56 existing lines in 10 files now uncovered.

93249 of 94197 relevant lines covered (98.99%)

123508.2 hits per line

Coverage Regressions

Lines Coverage ∆ File
13
94.4
-2.6% src/f32/neon/quat.rs
7
96.17
-1.41% src/f32/coresimd/quat.rs
7
95.99
-1.48% src/f32/scalar/quat.rs
6
95.08
-1.97% src/f32/affine3.rs
6
98.23
-0.71% src/f32/coresimd/vec3a.rs
5
92.96
-7.04% src/coresimd.rs
3
98.04
-1.96% src/bool/bvec4.rs
3
95.62
-2.19% src/bool/coresimd/bvec3a.rs
3
99.23
0.51% src/f32/coresimd/mat2.rs
3
98.87
-0.33% src/f32/sse2/vec3a.rs
Jobs
ID Job ID Ran Files Coverage
1 native_simd-ubuntu-latest - 36109957285.1 25 Sep 2026 07:55AM UTC 122
98.89
GitHub Action Run
2 native_simd-macos-latest - 36109957285.2 25 Sep 2026 07:56AM UTC 122
98.86
GitHub Action Run
3 core_simd-ubuntu-latest - 36109957285.3 25 Sep 2026 07:55AM UTC 121
98.86
GitHub Action Run
4 scalar_math-ubuntu-latest - 36109957285.4 25 Sep 2026 07:55AM UTC 121
98.87
GitHub Action Run
Source Files on build 36109957285
  • Tree
  • List 154
  • Changed 49
  • Source Changed 20
  • Coverage Changed 49
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #36109957285
  • 82c01f68 on github
  • Prev Build on main (#36058042299)
  • Next Build on main (#36113729294)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc