Repository navigation
fix: Accept any integer index dtype in VertexNormalsExtension - #86
Open
kylebarron wants to merge 1 commit into
Open
kylebarron wants to merge 1 commit into
kylebarron wants to merge 1 commit into
Conversation
`encode` casts indices to uint32, but `VertexNormalsExtension` passed them straight to the Cython `add_vertex_normals` helper, which only accepts uint32. Indices built with `np.array([...])` are int64 by default, so passing the same indices to both, as the README example does, raised `ValueError: Buffer dtype mismatch, expected 'uint32_t' but got 'long'`. This happens with numpy 1.26 too. Cast indices to uint32 in `compute_vertex_normals`, matching `encode`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kylebarron
added this pull request to stack #91
October 5, 2026 21:52
This branch has not been deployed
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.
Note
This PR was written by Claude (Claude Code), not by @kylebarron.
Fixes
VertexNormalsExtensionrejecting the default integer index dtype.The bug
encodecasts indices touint32, butVertexNormalsExtensionpassed them straight to the Cythonadd_vertex_normalshelper, which only acceptsuint32. Indices built withnp.array([...])areint64by default. Passing the same indices to both, as the README example does, raised:This happens on numpy 1.26 too.
Fix
Cast indices to
uint32incompute_vertex_normals, asencodedoes.Tests
test_vertex_normals_extension_index_dtypefails without the fix and passes with it.🤖 Written by Claude Code