booster: configurable HS-only symbols before LLVM simplify#4140
Closed
Stevengre wants to merge 6 commits into
Closed
booster: configurable HS-only symbols before LLVM simplify#4140Stevengre wants to merge 6 commits into
Stevengre wants to merge 6 commits into
Conversation
Author
KEVM Performance test
|
Author
|
Closing this PR. The functionality this aimed to implement is essentially the correct behavior of the non-evaluator, tracked in runtimeverification/k#4904. |
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.
Behavior Delta
--hs-only-symbol LABEL(repeatable) tokore-rpc-booster; any term containing a listed symbol skips LLVM simplification and stays on the Haskell path.llvmSimplify,simplifyConstraint', andsimplifyCeilnow check for HS-only symbols before dispatching to LLVM, falling back to the Haskell evaluator when a match is found.kore-rpc-boosterCLI,ServerState, equation/rewrite/ceil evaluation paths, dev-tools (booster-dev,parsetest).--hs-only-symbolflag,containsSymbolNamehelper, and unit tests covering CLI parsing and symbol matching.flowchart TD CLI["--hs-only-symbol LABEL (CLI)"] --> CLOptions["CLOptions.hsOnlySymbols :: HashSet ByteString"] CLOptions --> ServerState["ServerState / EquationConfig / RewriteConfig"] ServerState --> Guard{"Term contains HS-only symbol?"} Guard -- Yes --> Haskell["Haskell evaluator (no LLVM)"] Guard -- No --> LLVM["LLVM simplification (unchanged)"]Invariants / Non-goals
--hs-only-symbolflags are passed, the empty set propagates everywhere and all existing behavior is unchanged (zero-cost guard).Validation
Lbl'Hash'...names)Test.Booster.CLOptionsunit testsbooster/unit-tests/Test/Booster/CLOptions.hscontainsSymbolNamecorrectly scans nested termsTest.Booster.Pattern.ApplyEquationsunit testsbooster/unit-tests/Test/Booster/Pattern/ApplyEquations.hscomputeCeilsDefinitionaritycabal build booster-dev parsetestcabal test llvm-integration(10/10 pass)cabal test predicates-integration(13/13 pass)22986242999Risk / Blast Radius / Rollback
Lblprefix), causing the guard to silently miss matches — terms still go to LLVM.kore-rpc-boosterusers who explicitly opt-in via--hs-only-symbol; default behavior (empty set) is unchanged.--hs-only-symbolflag from the launch command; the emptyHashSetcauses all guards to pass through to LLVM as before.Review Focus
containsSymbolNameinBooster/Pattern/Util.hsrecursively scans all term constructors (especiallyInjection,KMap,KList,KSetinternal structures).hsOnlySymbolsis threaded correctly throughServerState→EquationConfig/RewriteConfig→simplifyCeilwithout any path dropping the set.readHsOnlySymbolinCLOptions.hsvalidates and encodes labels correctly (ASCII-printable check,Lblprefix addition).Architecture Trace
Context (C4-L1)
No L1 change — this PR does not alter external system interactions. The
kore-rpc-boosterJSON-RPC interface is unchanged.Container (C4-L2)
Single-container change within
kore-rpc-booster. The LLVM backend shared library and the Haskell Kore evaluator are both unchanged; only the dispatch logic in front of LLVM is modified.Component (C4-L3)
Code Trace (C4-L4)
Booster.CLOptions→booster/library/Booster/CLOptions.hsBooster.Pattern.Util.containsSymbolName→booster/library/Booster/Pattern/Util.hsBooster.Pattern.ApplyEquations→booster/library/Booster/Pattern/ApplyEquations.hsBooster.Definition.Ceil→booster/library/Booster/Definition/Ceil.hsbooster/tools/booster/Server.hs,Booster.JsonRpcdev-tools/booster-dev/Server.hs,dev-tools/parsetest/Parsetest.hsbooster/unit-tests/Test/Booster/CLOptions.hs,booster/unit-tests/Test/Booster/Pattern/ApplyEquations.hsDecision Record