Fix terminal foliage dispatch on frond branches

Generate authored terminal leaves independently of frond activation, matching the recovered last-level dispatch. This prevents three umbrella-thorn copies from expanding leaf cards into full frond nodes and hitting the node budget.

Add an active-frond regression with 17500 terminal cards and record verification: all 606 resources generate without truncation, SDK and client targeted tests pass, and corpus ASan/UBSan checks pass.
This commit is contained in:
shen
2026-10-12 18:52:02 -07:00
parent 66992b3024
commit 62a5f5ad11
3 changed files with 40 additions and 2 deletions
+11
View File
@@ -132,6 +132,17 @@ void leafTests() {
"terminal cards limited by node/16-bit budget");
check(full->GetGenerationStats().nodes_by_level[0]==1 && full->GetGenerationStats().nodes_by_level[1]==0,
"terminal cards counted as branch nodes");
// Regression for umbrella-thorn: active fronds do not turn terminal leaves
// into complete branch/frond nodes, even with more cards than the node guard.
dense.u(13000);dense.u(13002);dense.u(0);dense.u(13003);dense.u(0);
dense.u(13004);dense.u(1);dense.u(13007);dense.data.push_back(1);dense.u(13001);
auto flowering=SpeedTreeModel::CreateFromMemory(dense.data.data(),dense.data.size(),"frondFlowers",1000,0);
check(flowering && !flowering->WasGenerationTruncated(),"frond terminal leaves hit branch budget");
check(flowering->GetTrunkMesh().vertices.empty() && !flowering->GetFrondMeshes().empty()
&& flowering->GetFrondMeshes()[0].vertices.size()==10,"frond terminal path emitted extra fronds");
check(flowering->GetLeafMesh().vertices.size()==70000
&& flowering->GetGenerationStats().terminal_leaf_calls==17500
&& flowering->GetGenerationStats().nodes_by_level[1]==0,"frond lost terminal flowers");
}
void lodTests() {