DSE Statistics & Fixes#1586
Open
agusaldasoro wants to merge 4 commits into
Open
Conversation
Collaborator
|
Is this ready for review? It seems to be failing... |
Collaborator
Author
@jgaleotti The changes are ready and working, but there seems to be an out of memory issue that I can not solve in the Core and CoreIT tests |
9817750 to
55cf2de
Compare
6aced03 to
d03d8ec
Compare
Collaborator
Author
|
@jgaleotti Hey! It's ready for review now, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Z3Result(SAT/UNSAT/ERROR) to replaceOptional<Map<String, SMTLibValue>>, making solver outcomes explicit and preventing transient errors from being cachedcollectDseStatsflag) tracking SAT/UNSAT/error counts, timing, SMT-LIB size, and query uniqueness, written to CSV only when enabledmeasureDseCorrectnessflag: after Z3 returns SAT, generated rows are evaluated withSqlHeuristicsCalculatorto measure their distance to the original SQL predicate. Non-zero distances are logged as warnings and recorded inStatisticsSmtLibGenerator: previously every PK column had to differ individually across rows, which over-constrained the encoding. The generated SMT-LIB now enforces tuple uniqueness insteadSmtLibGeneratorto supportDELETEandUPDATEstatements in addition toSELECTLongValuegene mapping by usingLongGeneinstead of truncating values with.toInt()JSqlVisitorand adds newSmtLibGeneratorTestcoverageMotivation
This PR improves both the correctness and efficiency of EvoMaster's DSE pipeline.
On the performance side, repeated SQL constraints previously caused redundant Docker/Z3 executions. Memoizing SAT/UNSAT results significantly reduces solver overhead while intentionally avoiding caching transient execution errors. The new optional DSE statistics provide detailed observability into solver behavior with virtually no overhead when disabled.
On the correctness side, generated database rows could satisfy the SMT-LIB encoding while failing the original SQL predicate due to encoding limitations, including composite primary key handling, unsupported SQL statement types, and integer truncation. This PR fixes the most common encoding issues and introduces an optional post-verification step that measures how closely generated rows satisfy the original SQL predicate, exposing any remaining mismatches as metrics.
New Stats
DSE Performance Statistics (
collectDseStats)dseTotalQueriesdseUniqueQueriesdseDuplicateQueriesdseSatdseUnsatdseErrorsdseParseFailuresdseZ3TotalMsdseSmtlibGenTotalMsdseAvgSmtlibSizeBytesDSE Correctness Statistics (
measureDseCorrectness)dseCorrectnessChecksdseCorrectnessZeroDistancedseCorrectnessNonZerodseCorrectnessAvgDistdseCorrectnessEvalFailures