Repository navigation
Prim generation phase 9: delete what meshoptimizer replaced - #573
Merged
Merged
Conversation
LLVCacheVertexData, LLVCacheTriangleData, find_vertex_score, LLVCacheFIFO and LLVCacheLRU are what is left of the vertex cache optimizer meshoptimizer replaced; nothing calls them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nothing calls it. It was the only caller of LLVolumeFace::optimize. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its one caller, LLModel::optimizeVolumeFaces, is gone, and the uploader compacts its levels of detail through meshoptimizer since the simplifier change. The members only it used go with it: getVertexData, VertexData::compareNormal, both pushVertex overloads, pushIndex and swapData. VertexMapData stays for the DAE loader's weld. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
remap welds an uploaded face through meshoptimizer's 32-bit entry points, with its scratch from the thread's arena, in place of LLMeshOptimizer's U16 wrappers. The weld is the same for every valid face: the same streams, the same unique count, and each corner given back its vertex. An upload's indices are untrusted, so the check stays: an index past the face's vertices is taken as vertex 0, with the same warning. The index buffer is now remapped through the checked indices too. Before, only the weld saw them, and the remap went through the unchecked ones, which is why its table was sized by the larger of the index and vertex counts. An index past both read beyond the table: the new test, with an index of 65535, crashed there against the old code. An index below the index count took the first vertex the weld numbered instead of vertex 0. The table is now one entry a vertex, as meshoptimizer documents it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its last callers were LLVolumeFace::remap, now on meshoptimizer's own entry points, and the arena setup. Everything else in llmath and the viewer already calls meshoptimizer directly, at 32 bits. LLVector4a::initClass, the llmath startup the viewer already makes, installs ALScratchArena as meshoptimizer's allocator, at the same point in LLAppViewer::init where LLMeshOptimizer::initClass did. The tests and the benchmark that put meshoptimizer on the arena for a scope install it the same way. llmeshoptimizer_test's case moves to llvector4a_test as a test of initClass, run on a thread of its own so the floating-point mode initClass sets stays off the test thread. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 9 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Oct 25, 2026
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.
Phase 9 of the prim generation plan: delete what meshoptimizer replaced. One commit per removal. Nothing in the tree calls any of it, tests and benchmarks included, and neither do #570, #571 or #572.
Changes
LLVCacheVertexData,LLVCacheTriangleData,find_vertex_score,LLVCacheFIFOandLLVCacheLRU.LLModel::optimizeVolumeFacesgoes. It was the only caller ofLLVolumeFace::optimize.LLVolumeFace::optimizegoes, and with it the members only it used:getVertexData,VertexData::compareNormal, bothpushVertexoverloads,pushIndexandswapData.VertexMapDatastays for the DAE loader's weld.LLVolumeFace::remapcalls meshoptimizer itself, through its 32-bit entry points, with its scratch from the thread's arena. Its table now has one entry a vertex, as meshoptimizer documents it.LLMeshOptimizergoes.LLVector4a::initClass, the llmath startup the viewer already calls, now installsALScratchArenaas meshoptimizer's allocator, at the same point inLLAppViewer::init. Tests that put meshoptimizer on the arena for a scope install the same pair themselves.llmeshoptimizer_test's case moves tollvector4a_testas a test ofinitClass, on a thread of its own so the floating-point modeinitClasssets stays off the test thread.One behaviour change: out-of-range upload indices
remapruns on uploads, so its indices are untrusted, and it keeps its check: an index past the face's vertices is taken as vertex 0, with the same warning. On develop, though, only the weld saw the checked indices. The index buffer was remapped through the unchecked ones, which is why the table was sized by the larger of the index and vertex counts.remap.Every corner now goes through the checked indices. Valid faces weld exactly as before.
Testing
Windows, RelWithDebInfo, against a build of develop:
llmath_tests: 460 cases, develop's 458 plus the two newremaptests. 458 pass, with develop's one skip and one expected failure.[almeshsimplifier]is 18 cases and 509 assertions on both.[llvolume], which holds thecacheOptimizetests, goes from 71 to 73 cases. Its assertions grow by 35, exactly the two new tests.llprimitive_tests(49),llprimitive_test(11), andsimd_tests_baseline,simd_tests_v2andsimd_tests_v4(32 each): the same as develop.llmeshoptimizer_test's own entry.llvolume_bench: all 53 arena and heap allocation rows are identical. ThecacheOptimizetimings stay within run-to-run noise: both builds swing about 20% from run to run.remap, and theinitClasstest fails with the allocator line removed.llappviewer.cppcompiles against the viewer PCH.🤖 Generated with Claude Code