glam v0.33.6 breaks `Vec3A`
Maintainer antworten meist innerhalb von 1 Tag
@Firestar99 arbeitet bereits daran.
Seit 22.9.2026.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
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
- Vorherrschende Sprache
- Rust
- Sterne
- 3.4k
- Forks
- 132
- Ø Merge
- 1 T. 58 Min.
- Gemergte PRs (30 T.)
- 12
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus Rust-GPU/rust-gpu
-
bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 68/100
Rust-GPU/rust-gpu#209 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
Rust-GPU/rust-gpu#665 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
Rust-GPU/rust-gpu#659 · 7 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Adhere to Rust floating-point semanticsEvtl. wieder frei @Firestar99 hat das vor 28 Tagen übernommen, und es ist kein Pull Request offen. Offenenhancement
Rust-GPU/rust-gpu#643 · 6 Kommentare · 1 Reaktion · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in Rust-GPU/rust-gpu
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
swc-project/swc#12516 ·
Maintainer antworten meist innerhalb von 1 Tag
-
mls-rs-crypto-awslc: exact aws-lc-rs =1.16.3 pin blocks rustls security updateEvtl. vergeben @muscariello hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
[work-item] adam-adae-worsening-emergence: conform spec.yaml to the specification style contract (REQ-1280)Evtl. vergeben @muse-yamaa-bot hat das heute übernommen. Offenwork-item
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
Possible memory leak: message iterators from pactffi_pact_handle_get_*message_iter are never deletedOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
pact-foundation/pact-go#652 ·
Maintainer antworten meist innerhalb von 1 Tag