{"record":{"id":"53354778ca7d9af3","repo":"NationalSecurityAgency/ghidra","slug":"no-thresholds-have-been-established","errorCode":null,"errorMessage":"No thresholds have been established","messagePattern":"No thresholds have been established","errorType":"validation","errorClass":"LSHException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/ExecutableComparison.java","lineNumber":424,"sourceCode":"\t * Perform scoring between all registered executables.\n\t * @throws LSHException for any connection issues during the process\n\t * @throws CancelledException if the monitor reports cancellation\n\t */\n\tpublic void performScoring() throws LSHException, CancelledException {\n\t\tmaxHitCount = 0;\n\t\texceedCount = 0;\n\t\tscorer.populateExecutableIndex();\n\t\tif (singleMd5 != null) {\n\t\t\tscorer.setSingleExecutable(singleMd5);\n\t\t}\n\t\tpullVectorsForScoringSet();\n\t\tscorer.initializeScores();\n\n\t\tmonitor.setMessage(\"Processing similar functions\");\n\t\tint maxSize = baseIds.size();\n\t\tmonitor.initialize(maxSize);\n\t\tif (scorer.simThreshold < 0.0) {\n\t\t\tthrow new LSHException(\"No thresholds have been established\");\n\t\t}\n\t\twhile (!baseIds.isEmpty()) {\n\t\t\tList<VectorResult> vectors = new ArrayList<VectorResult>();\n\t\t\tint hitcount = buildCluster(vectors, scorer.simThreshold, scorer.sigThreshold);\n\t\t\tif (hitcount == 0) {\t// Zero is possible, if all vectors in cluster are below sig threshold\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if (hitcount > maxHitCount) {\t\t// Keep track of biggest hitcount\n\t\t\t\tmaxHitCount = hitcount;\n\t\t\t}\n\t\t\tif (!scorer.checkPreliminaryPairThreshold(hitcount, hitCountThreshold)) {\t\t// Cluster is too big\n\t\t\t\texceedCount += 1;\t\t\t\t\t// Count the occurrence\n\t\t\t\tcontinue;\t\t\t\t\t\t\t// Don't score with this cluster\n\t\t\t}\n\t\t\tList<DescriptionManager> vec2Functions = vectorToFunctions(vectors);\n\t\t\tif (!scorer.scoreCluster(vectorFactory, vec2Functions, vectors, hitcount,\n\t\t\t\thitCountThreshold)) {\n\t\t\t\texceedCount += 1;","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/ExecutableComparison.java#L406-L442","documentation":"Thrown by ExecutableComparison.performScoring when scorer.simThreshold is negative (< 0.0), meaning no similarity threshold was configured before scoring began. The scorer requires a positive similarity threshold to build and evaluate clusters; without it, scoring is undefined.","triggerScenarios":"Calling performScoring() without first establishing thresholds via the scorer (e.g., via setThresholds, configureScorer, or loading a DatabaseInformation whose settings populate the threshold). isConfigured() returns false when simThreshold <= 0.0.","commonSituations":"Forgetting to configure the ExecutableScorer before calling performScoring; loading a database whose metadata lacks threshold settings; programmatic use that skips the configuration step.","solutions":["Configure the scorer with a valid positive similarity threshold before calling performScoring (e.g., via the comparison API that sets thresholds from DatabaseInformation).","Call isConfigured() / check scorer.simThreshold > 0 before performing scoring.","Ensure pullConnectionInfo() succeeded, as it informs the scorer of settings."],"exampleFix":"// before\ncmp.performScoring(); // simThreshold < 0\n// after\nif (cmp.getScorer().simThreshold <= 0.0) {\n    cmp.getScorer().setThresholds(0.7, 0.0); // set similarity + signature thresholds\n}\ncmp.performScoring();","handlingStrategy":"validation","validationCode":"if (!comparison.isConfigured()) { // simThreshold <= 0.0\n    throw new IllegalStateException(\"Configure similarity threshold before scoring\");\n}","typeGuard":null,"tryCatchPattern":"catch (LSHException e) { if (e.getMessage().contains(\"No thresholds\")) { /* set thresholds, then retry performScoring */ } }","preventionTips":["Always configure the scorer thresholds before calling performScoring.","Use isConfigured() as a guard.","Ensure pullConnectionInfo() runs successfully so settings propagate to the scorer."],"tags":["bsim","configuration","scoring","state"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}