@@ -293,6 +293,7 @@ static ErrorEbm Flatten(BoosterShell* const pBoosterShell,
293
293
deltaStepMax);
294
294
}
295
295
296
+ EBM_ASSERT (pUpdateScore < aUpdateScore + cScores * cSlices);
296
297
*pUpdateScore = static_cast <FloatScore>(updateScore);
297
298
++pUpdateScore;
298
299
@@ -322,6 +323,20 @@ static ErrorEbm Flatten(BoosterShell* const pBoosterShell,
322
323
done:;
323
324
EBM_ASSERT (cSamplesTotalDebug == cSamplesExpectedDebug);
324
325
326
+ EBM_ASSERT (bNominal || pUpdateScore == aUpdateScore + cScores * cSlices);
327
+
328
+ EBM_ASSERT (bNominal || pSplit == cSlices - 1 + pInnerTermUpdate->GetSplitPointer (iDimension));
329
+
330
+ #ifndef NDEBUG
331
+ UIntSplit prevDebug = 0 ;
332
+ for (size_t iDebug = 0 ; iDebug < cSlices - 1 ; ++iDebug) {
333
+ UIntSplit curDebug = pInnerTermUpdate->GetSplitPointer (iDimension)[iDebug];
334
+ EBM_ASSERT (prevDebug < curDebug);
335
+ prevDebug = curDebug;
336
+ }
337
+ EBM_ASSERT (prevDebug < cBins);
338
+ #endif
339
+
325
340
EBM_ASSERT (nullptr == pMissingValueTreeNode || nullptr != pMissingBin);
326
341
if (nullptr != pMissingBin) {
327
342
EBM_ASSERT (bMissing);
@@ -347,18 +362,6 @@ static ErrorEbm Flatten(BoosterShell* const pBoosterShell,
347
362
} while (pGradientPairEnd != pGradientPair);
348
363
}
349
364
350
- EBM_ASSERT (bNominal || pSplit == cSlices - 1 + pInnerTermUpdate->GetSplitPointer (iDimension));
351
-
352
- #ifndef NDEBUG
353
- UIntSplit prevDebug = 0 ;
354
- for (size_t iDebug = 0 ; iDebug < cSlices - 1 ; ++iDebug) {
355
- UIntSplit curDebug = pInnerTermUpdate->GetSplitPointer (iDimension)[iDebug];
356
- EBM_ASSERT (prevDebug < curDebug);
357
- prevDebug = curDebug;
358
- }
359
- EBM_ASSERT (prevDebug < cBins);
360
- #endif
361
-
362
365
LOG_0 (Trace_Verbose, " Exited Flatten" );
363
366
return Error_None;
364
367
}
@@ -379,6 +382,7 @@ static ErrorEbm Flatten(BoosterShell* const pBoosterShell,
379
382
if (cBins == iEdge) {
380
383
// This cut would isolate the missing bin, but missing already has a cut.
381
384
// We still need to find the missing bin though in the tree, so continue.
385
+ bDone = true ;
382
386
break ;
383
387
}
384
388
}
0 commit comments