From 8872b326c22bdb6148df72392b42a1dd7670fa6b Mon Sep 17 00:00:00 2001 From: "Sergey \"Shnatsel\" Davidoff" Date: Tue, 16 Jun 2026 20:58:40 +0100 Subject: [PATCH 1/4] Document the motivation for custom transmute wrappers They've grown to be more than just 'bytemuck at home' --- fearless_simd/src/transmute.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/fearless_simd/src/transmute.rs b/fearless_simd/src/transmute.rs index f28e079e..c22b46eb 100644 --- a/fearless_simd/src/transmute.rs +++ b/fearless_simd/src/transmute.rs @@ -1,10 +1,17 @@ // Copyright 2026 the Fearless_SIMD Authors // SPDX-License-Identifier: Apache-2.0 OR MIT -//! We have bytemuck at home +//! This all serves a small set of checked transmute and cast functions. //! -//! This all serves a small set of checked transmute and cast functions; -//! if we find this growing in complexity we should probably just use the real bytemuck +//! It fulfills the purpose of both safe_unaligned_simd and bytemuck crates. +//! The implementation is bytemuck-like, but far smaller than either of those crates, +//! mostly by virtue of supporting less features (e.g. no by-value transmute). +//! +//! Unlike bytemuck, this verifies that sizes match at compile time, +//! so we won't accidentally ship always-panicking code even if it's not covered by tests. +//! +//! It's not possible to get rid of `unsafe` here enitrely, even if we were to use external crates, +//! because we need to implement Pod for wrappers like Aligned512 which cannot be safely derived. use core::mem::{align_of, size_of}; From cfaad1f3382505dfd5541eda31d32e985a6558d9 Mon Sep 17 00:00:00 2001 From: "Sergey \"Shnatsel\" Davidoff" Date: Tue, 16 Jun 2026 21:00:21 +0100 Subject: [PATCH 2/4] placate clippy --- fearless_simd/src/transmute.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fearless_simd/src/transmute.rs b/fearless_simd/src/transmute.rs index c22b46eb..b6d5cbf2 100644 --- a/fearless_simd/src/transmute.rs +++ b/fearless_simd/src/transmute.rs @@ -3,7 +3,7 @@ //! This all serves a small set of checked transmute and cast functions. //! -//! It fulfills the purpose of both safe_unaligned_simd and bytemuck crates. +//! It fulfills the purpose of both `safe_unaligned_simd` and `bytemuck` crates. //! The implementation is bytemuck-like, but far smaller than either of those crates, //! mostly by virtue of supporting less features (e.g. no by-value transmute). //! From 6da669d2ffec38e45dee6c1393f1314195d21159 Mon Sep 17 00:00:00 2001 From: "Sergey \"Shnatsel\" Davidoff" Date: Tue, 16 Jun 2026 21:13:53 +0100 Subject: [PATCH 3/4] fix typo well at least you know it's not AI slop --- fearless_simd/src/transmute.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fearless_simd/src/transmute.rs b/fearless_simd/src/transmute.rs index b6d5cbf2..7cfd27a8 100644 --- a/fearless_simd/src/transmute.rs +++ b/fearless_simd/src/transmute.rs @@ -10,7 +10,7 @@ //! Unlike bytemuck, this verifies that sizes match at compile time, //! so we won't accidentally ship always-panicking code even if it's not covered by tests. //! -//! It's not possible to get rid of `unsafe` here enitrely, even if we were to use external crates, +//! It's not possible to get rid of `unsafe` here entirely, even if we were to use external crates, //! because we need to implement Pod for wrappers like Aligned512 which cannot be safely derived. use core::mem::{align_of, size_of}; From b01d7e73510b192638c239804fbc4d642810ac8f Mon Sep 17 00:00:00 2001 From: "Sergey \"Shnatsel\" Davidoff" Date: Tue, 16 Jun 2026 21:29:05 +0100 Subject: [PATCH 4/4] Better top-line description --- fearless_simd/src/transmute.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fearless_simd/src/transmute.rs b/fearless_simd/src/transmute.rs index 7cfd27a8..63c2654a 100644 --- a/fearless_simd/src/transmute.rs +++ b/fearless_simd/src/transmute.rs @@ -1,9 +1,9 @@ // Copyright 2026 the Fearless_SIMD Authors // SPDX-License-Identifier: Apache-2.0 OR MIT -//! This all serves a small set of checked transmute and cast functions. +//! Safe wrappers for SIMD loads/stores and reference casts. //! -//! It fulfills the purpose of both `safe_unaligned_simd` and `bytemuck` crates. +//! This fulfills the purpose of both `safe_unaligned_simd` and `bytemuck` crates. //! The implementation is bytemuck-like, but far smaller than either of those crates, //! mostly by virtue of supporting less features (e.g. no by-value transmute). //!