Repository navigation
feat(math): Milestone 2 Phase 1 — spawn-math spatial primitives, f64 WorldPos, reversed-Z, and libm det subset - #10
Merged
Merged
Conversation
…ldPos, reversed-Z, and libm det subset
…try_mul_transform and try_inverse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requirements covered
F3D-FR-01(spawn-mathspatial & localf32primitives:Vec2,Vec3,Vec4, column-majorMat3/Mat4,Quat,Transform,Aabb,Ray,Plane,Sphere, right-handed Y-up-Zforward, radians, meters)F3D-FR-02(distinctf64world coordinatesWorldPos&DVec3, explicitcamera_relative_f32conversion, reversed-Z finite & infinite-far Vulkan projections with single-site NDC Y-flip preservinga > 0CCW front faces)F3D-FR-03(libmdeterministic math subsetdetinf32/f64, clamped inverse trig, yaw/pitch quaternion & basis helpers)ADR-0010(Math library conventions & precision hierarchy) andADR-0009(typed locatedMathErrorMATH-0001..MATH-0005with snapshot tests)What changed
crates/spawn-math(#![forbid(unsafe_code)], zerospawn-*dependencies, zero third-party types in public API, zero non-testunwrap/expect/panic!/todo!).Transform::try_mul_transform+Transform::mul_mat4(symmetric withtry_inverse+inverse_mat4), and right-handedSO(3)orthonormality + reconstruction validation inQuat::try_from_mat3/Mat4::try_to_scale_rotation_translation/Transform::try_from_mat4(rejecting sheared matrices while preserving negative-scale reflection TRS round-trips).F3D-T01..F3D-T04and Phase 1F3D-T13math hygiene audit.AGENTS.md,crates/spawn-math/AGENTS.md,docs/DEPENDENCIES.md, anddocs/first-3d/{PLAN,VERIFICATION}.md.Tests run
Platforms tested
spawn-mathverification + full./scripts/check.shworkspace gates). Windows CI runs on PR via.github/workflows/ci.yml.Invariants touched
SPN-INV-003(genre-free engine infrastructure),SPN-INV-004(zerospawn-*dependencies inspawn-math),SPN-INV-009(headless compilation & tests),SPN-INV-011(zero third-party types in public API)SPN-INV-020,SPN-INV-021,SPN-INV-023(approved dependencies & license check)SPN-INV-030,SPN-INV-031,SPN-INV-032,SPN-INV-033(no panics on caller input, typed locatedMathError,#![forbid(unsafe_code)], clippy clean)SPN-INV-044(detpure-Rustlibmsubset & IEEEsqrt, explicit FMA policy)SPN-INV-050,SPN-INV-051,SPN-INV-052,SPN-INV-053,SPN-INV-054(spatial conventions, distinctf64WorldPos, explicitcamera_relative_f32, reversed-Z + single-site Vulkan Y-flip)SPN-INV-084(nobuild.rs),SPN-INV-100,SPN-INV-101(SCAFFOLD->EXISTSstatus sync)Dependencies added/changed (Gate G2)
libm0.2.16spawn-math)default-features = false)glam0.34.3spawn-math)F3D-T01/F3D-T02proptest1.12.0spawn-math)insta1.49.0spawn-math)MathErrordiagnostic reportsAll four are pre-approved in
docs/DEPENDENCIES.md(In usecolumn updated toYes (spawn-math)).Known limitations
SIMDoptimization remainsPLANNEDperADR-0010until profiling demonstrates a bottleneck).PLANNED).