Skip to content

Add unit test and benchmark for mesh loading + BVH generation (#691) - #800

Draft
kimjune01 wants to merge 1 commit into
KaijuEngine:masterfrom
kimjune01:fix-691-bvh-benchmark
Draft

Add unit test and benchmark for mesh loading + BVH generation (#691)#800
kimjune01 wants to merge 1 commit into
KaijuEngine:masterfrom
kimjune01:fix-691-bvh-benchmark

Conversation

@kimjune01

Copy link
Copy Markdown

Summary

  • Adds TestKaijuMeshLoadAndGenerateBVH covering the serialize-deserialize-BVH-RayIntersect roundtrip
  • Adds BenchmarkKaijuMeshLoadAndGenerateBVH measuring combined deserialize + BVH generation on a 50K mesh
  • Ray geometry uses origin inside the triangle and direction perpendicular to the face
  • Benchmark uses a fresh Deserialize per iteration to avoid cache distortion

Addresses #691

Test plan

  • go test ./editor/cache/assets/loaders/kaiju_mesh/... passes
  • go test -bench=. ./editor/cache/assets/loaders/kaiju_mesh/... runs benchmark
  • go vet ./... passes clean

…ngine#691)

Implements the request from issue KaijuEngine#691 to create a unit test and
benchmark for loading a mesh and generating its BVH structure.

- TestKaijuMeshLoadAndGenerateBVH: validates that a loaded mesh can
  generate a BVH and correctly perform ray intersection queries
- BenchmarkKaijuMeshLoadAndGenerateBVH: measures performance of
  deserializing a 50K vertex mesh and generating its BVH

The test follows the existing pattern from TestKaijuMeshSerializePreservesBVH
but adds explicit BVH generation and ray intersection validation.
@kimjune01
kimjune01 marked this pull request as draft May 22, 2026 21:28
@kimjune01

Copy link
Copy Markdown
Author

Cannot validate on current setup, so drafting. Please close or take it over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant