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

bitshifter / glam-rs / 34947735101
99%

Build:
DEFAULT BRANCH: main
Ran 15 Sep 2026 08:35AM 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

15 Sep 2026 08:34AM UTC coverage: 99.025% (-0.03%) from 99.052%
34947735101

push

github

web-flow
feat(mat): add row constructors and set_row to the matrix types (#790)

# Objective

- Fixes #639.
- The matrix types have `row()` for reading, but no way to build a
matrix from rows or write one back. Row major is what you usually get
out of file formats and other math libraries, so everyone ends up
writing the same transpose glue themselves.

Adds the functions from the issue to `Mat2`, `Mat3`, `Mat3A`, `Mat4` and
the `DMat` equivalents:

- `from_rows`
- `from_rows_array`
- `from_rows_slice`
- `to_rows_array`
- `set_row`

## Solution

You mentioned in the issue you were fine with these as long as they
carry a doc comment reminding people glam stores columns and that rows
cost more, so each one says that and links to the column equivalent to
use instead when you don't need rows.

On the overhead itself, it turned out to be cheaper than expected. The
array and slice constructors are just an index permutation into the
existing `Self::new`, and `to_rows_array` permutes `to_cols_array`, so
none of them actually call `transpose` and all four stay `const` like
their column counterparts. `set_row` writes straight into the columns,
so it's the only one that can't be const.

I left out `from_rows_array_2d` and `to_rows_array_2d` since they
weren't in the issue, happy to add them if you want the mirror to be
complete.

## Code generation

Yes. Everything is in `templates/mat.rs.tera` and the generator was run,
which is where the 19 generated matrix files in the diff come from.

## Testing and linting

Added a `test_matN_rows` test to `tests/mat2.rs`, `tests/mat3.rs` and
`tests/mat4.rs`, so it runs for every type variant including `Mat3A` and
the `DMat` ones. They cover:

- the row major array round trip through `from_rows_array` /
`to_rows_array` / `from_rows_slice`
- that `to_rows_array()` agrees with `transpose().to_cols_array()`
- `from_rows` rebuilding a matrix from its own `row()` values
- `set_row` round tripping with `row()`
- the const paths, so constn... (continued)

581 of 612 new or added lines in 16 files covered. (94.93%)

93236 of 94154 relevant lines covered (99.03%)

123539.56 hits per line

Uncovered Changes

Lines Coverage ∆ File
9
98.91
-0.81% src/f32/coresimd/mat4.rs
6
97.59
-0.87% src/f32/mat3.rs
6
97.2
-0.82% src/f32/neon/mat3a.rs
5
98.08
-1.15% src/f32/neon/mat2.rs
5
98.77
-1.23% src/f32/sse2/mat2.rs
Jobs
ID Job ID Ran Files Coverage
1 scalar_math-ubuntu-latest - 34947735101.1 15 Sep 2026 08:35AM UTC 121
98.9
GitHub Action Run
2 core_simd-ubuntu-latest - 34947735101.2 15 Sep 2026 08:36AM UTC 121
98.87
GitHub Action Run
3 native_simd-macos-latest - 34947735101.3 15 Sep 2026 08:36AM UTC 122
98.86
GitHub Action Run
4 native_simd-ubuntu-latest - 34947735101.4 15 Sep 2026 08:35AM UTC 122
98.92
GitHub Action Run
Source Files on build 34947735101
  • Tree
  • List 154
  • Changed 16
  • Source Changed 16
  • Coverage Changed 16
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #34947735101
  • 15971997 on github
  • Prev Build on main (#34946346050)
  • Next Build on main (#35022667298)
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