From 81a2f83a2c642062575905d0d36bf448583a675a Mon Sep 17 00:00:00 2001 From: Paul Koch Date: Wed, 25 Dec 2024 14:02:15 -0800 Subject: [PATCH] add debug check for increasing cut indexes --- shared/libebm/PartitionOneDimensionalBoosting.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/shared/libebm/PartitionOneDimensionalBoosting.cpp b/shared/libebm/PartitionOneDimensionalBoosting.cpp index bfc0210cd..9817eaeff 100644 --- a/shared/libebm/PartitionOneDimensionalBoosting.cpp +++ b/shared/libebm/PartitionOneDimensionalBoosting.cpp @@ -350,6 +350,16 @@ static ErrorEbm Flatten(BoosterShell* const pBoosterShell, EBM_ASSERT(bNominal || pSplit == cSlices - 1 + pInnerTermUpdate->GetSplitPointer(iDimension)); +#ifndef NDEBUG + UIntSplit prevDebug = 0; + for(size_t iDebug = 0; iDebug < cSlices - 1; ++iDebug) { + UIntSplit curDebug = pInnerTermUpdate->GetSplitPointer(iDimension)[iDebug]; + EBM_ASSERT(prevDebug < curDebug); + prevDebug = curDebug; + } + EBM_ASSERT(prevDebug < cBins); +#endif + LOG_0(Trace_Verbose, "Exited Flatten"); return Error_None; }