From f47c539aeb5ec66a022d0e3c8e58811156279473 Mon Sep 17 00:00:00 2001 From: Agustina Aldasoro Date: Thu, 18 Jun 2026 14:46:48 -0300 Subject: [PATCH] =?UTF-8?q?fix(oom-rc4):=20RC1+RC3=20combined=20=E2=80=94?= =?UTF-8?q?=20single=20endPointToGeneList=20call=20+=20skip=20re-init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- .../AbstractProbabilistic400EndpointModel.kt | 6 ++++++ .../classifier/probabilistic/InputEncoderUtilWrapper.kt | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/core/src/main/kotlin/org/evomaster/core/problem/rest/classifier/probabilistic/AbstractProbabilistic400EndpointModel.kt b/core/src/main/kotlin/org/evomaster/core/problem/rest/classifier/probabilistic/AbstractProbabilistic400EndpointModel.kt index dbf1972f6a..bc52e2665d 100644 --- a/core/src/main/kotlin/org/evomaster/core/problem/rest/classifier/probabilistic/AbstractProbabilistic400EndpointModel.kt +++ b/core/src/main/kotlin/org/evomaster/core/problem/rest/classifier/probabilistic/AbstractProbabilistic400EndpointModel.kt @@ -82,6 +82,12 @@ abstract class AbstractProbabilistic400EndpointModel( return } + if (modelKeys != null && dimension != null) { + require(warmup > 0) { "Warmup must be positive" } + initialized = true + return + } + val encoder = InputEncoderUtilWrapper(input, encoderType = encoderType) val allParamsPathsAndEncodedValues = encoder.getAllParamsPathsAndEncodedValues() diff --git a/core/src/main/kotlin/org/evomaster/core/problem/rest/classifier/probabilistic/InputEncoderUtilWrapper.kt b/core/src/main/kotlin/org/evomaster/core/problem/rest/classifier/probabilistic/InputEncoderUtilWrapper.kt index ede4265ec5..51f85a75e8 100644 --- a/core/src/main/kotlin/org/evomaster/core/problem/rest/classifier/probabilistic/InputEncoderUtilWrapper.kt +++ b/core/src/main/kotlin/org/evomaster/core/problem/rest/classifier/probabilistic/InputEncoderUtilWrapper.kt @@ -127,8 +127,9 @@ class InputEncoderUtilWrapper( */ fun getAllParamsPathsAndEncodedValues(): Map { - val paramPaths = endPointToGeneList().map { it.paramPath } - val encodedValues = encode() + val geneList = endPointToGeneList() + val paramPaths = geneList.map { it.paramPath } + val encodedValues = encode(geneList) return paramPaths.zip(encodedValues).toMap() } @@ -186,10 +187,10 @@ class InputEncoderUtilWrapper( * * @return a list of doubles representing the encoded feature vector */ - fun encode(): List { + fun encode(geneList: List = endPointToGeneList()): List { val sentinel = -1e6 // for null handling val neutral = 0.0 // for handling unsupported genes - val listGenes = endPointToGeneList().map { it.gene } + val listGenes = geneList.map { it.gene } val rawEncodedFeatures = mutableListOf() for (g in listGenes) {