glam v0.33.6 breaks `Vec3A`
Mantenedores costumam responder em até 1 dia
@Firestar99 já está trabalhando nisso.
Desde 22/9/2026.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
PR https://github.com/bitshifter/glam-rs/pull/786 changed the definition of Vec3A to make it bytemuck::Pod:
#[repr(align(16))]
#[repr(C)]
#[cfg_attr(target_arch = "spirv", rust_gpu::vector::v1)]
pub struct Vec3A {
pub x: f32,
pub y: f32,
pub z: f32,
+ _w: f32,
}
So from rust-gpu's perspective, this is now a vector with 4 floats instead of 3 floats, breaking a lot of safety assumptions in our codebase.
Observed Fallout
- breaks rust-gpu's
Matrix4x3layout, causing certain raytracing-related intrinsics to miscompile into invalid spirv. See compiletestray_query_get_intersection_object_to_world_khrbreaking after glam update, as seen in this CI of PR https://github.com/Rust-GPU/rust-gpu/pull/630 - This CI of PR https://github.com/Rust-GPU/rust-gpu/pull/646 shows compiletest
sample_gradientfailing, showing potential higher fallout:
error: error:0:0 - Expected Image Operand Grad dx to have 3 components, but given 4
%38 = OpImageSampleDrefExplicitLod %float %37 %32 %float_1 Grad %33 %34
Mitigation
Problems:
- glam v0.33.6 is a breaking change for rust-gpu
- glam added
_w: f32member to getimpl bytemuck::Pod for Vec3A, so reverting this is a breaking change for regular glam users - don't want
impl Podnot to be impl on spirv
Ideas:
- hack something in the compiler to special case
glam::Vec3A- how do we know if a type is
Vec3A? This will be a hack and not really sustainable
- how do we know if a type is
- PR https://github.com/Rust-GPU/rust-gpu/pull/646 adjusts
Matrix4x3to useVec3instead ofVec3A. The layout of that special type is screwed up anyway, so we don't really care about it changing.- not a full mitigation!
Strategy:
- short term fix
- special case spirv to not have
_w: f32member and not implPod, - release glam v0.33.9, fixing rust-gpu
- long term fix
glam::Vec3A:- remove short term fix
- change attribute to
#[spirv::vector::v1(3, f32)]to overwrite rust-gpu vector type - release glam v0.34.0
- rust-gpu:
- adjust
#[spirv::vector::v1]attribute to take params to overwrite vector type - make rust-gpu support glam v0.34.0
- release rust-gpu?
- adjust
will update this description as I go
- Linguagem predominante
- Rust
- Estrelas
- 3.4k
- Forks
- 132
- Merge médio
- 1d 58min
- PRs com merge (30d)
- 12
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de Rust-GPU/rust-gpu
-
enhancement
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 68/100
Rust-GPU/rust-gpu#209 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
Rust-GPU/rust-gpu#665 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
Rust-GPU/rust-gpu#659 · 6 comentários ·
Mantenedores costumam responder em até 1 dia
-
Adhere to Rust floating-point semanticsTalvez já em andamento @Firestar99 assumiu há 26 dias. Abertaenhancement
Rust-GPU/rust-gpu#643 · 6 comentários · 1 reação · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
Rust-GPU/rust-gpu#608 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de Rust-GPU/rust-gpu
Issues semelhantes
-
bug user-priority/P2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
t8y2/dbx#11718 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
rescript-lang/rescript#8765 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
nautechsystems/nautilus_trader#5287 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
farion1231/cc-switch#8072 ·
Mantenedores costumam responder em até 1 dia
-
Python 3.15 supportTalvez já em andamento @amnesiaof assumiu hoje. AbertaL: python L: python:uv
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
dependabot/dependabot-core#16524 · 1 comentário ·
Mantenedores costumam responder em até 1 dia