Conversation
Summary of ChangesHello @tattn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors the project's architecture by introducing a dedicated Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new VRMKitRuntime module to centralize common types, protocols, and extensions from VRMRealityKit and VRMSceneKit, aiming to improve code reuse and maintainability. While this refactoring is a positive architectural improvement, several critical security vulnerabilities were identified. Specifically, mathematical operations on SIMD vectors (normalization and cross products) lack proper input validation, which can result in NaN propagation and lead to crashes in rendering or physics engines. Furthermore, the loader is missing explicit bounds checks when accessing GLTF data structures, making it susceptible to runtime traps and Denial of Service when processing malformed VRM files.
This pull request introduces a new
VRMKitRuntimetarget to centralize and share runtime types and utility extensions across both the RealityKit and SceneKit implementations. The main focus is on deduplicating common code such as blend shape types, SIMD extensions, and Unity transform helpers, which are now moved from the individual frameworks into the new runtime module. This change simplifies maintenance and improves consistency across the codebase.Key changes include:
Runtime module introduction and dependency updates
VRMKitRuntimetarget, moved shared types and extensions into it, and updatedVRMRealityKitandVRMSceneKittargets to depend onVRMKitRuntime. UpdatedPackage.swiftaccordingly.Deduplication and centralization of core types and extensions
BlendShapeKeyandBlendShapePresetenums, SIMD math extensions, and Unity transform helpers intoSources/VRMKitRuntimefrom both RealityKit and SceneKit implementations. Removed their previous definitions fromSources/VRMRealityKit/CustomType/BlendShape.swift,Sources/VRMSceneKit/CustomType/BlendShape.swift, and related extension files. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Refactoring and code cleanup
VRMKitRuntimeinstead of their local copies. This includesBlendShapeKey,BlendShapePreset, SIMD extensions, and Unity transform helpers. [1] [2] [3] [4] [5] [6] [7] [8] [9]GLTF protocol and extension adjustments
GLTFTextureInfoProtocolprotocol and its extensions to the runtime module and updated access control. Removed the duplicate protocol from SceneKit. [1] [2]Example app update
RealityKitViewController.swift) to use the new sharedExpressiontype instead of the localRKExpressionenum, and removed the now-unnecessary local enum definition. [1] [2] [3] [4]