Skip to content

Commit 588f287

Browse files
authored
Booster flag to disable simplification before fall-back request (#3825)
Logs are showing that the simplification performed before fall-back execute requests is often not productive. This PR provides a server flag to switch it off and save the overhead. OTOH, the simplification may prune spurious branches, saving a `Branching` re-execution in `kore-rpc` in some cases. Therefore the default behaviour is still to simplify before fallback requests.
1 parent 089deaf commit 588f287

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

booster/tools/booster/Proxy.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ data ProxyConfig = ProxyConfig
6969
, boosterState :: MVar.MVar Booster.ServerState
7070
, fallbackReasons :: [HaltReason]
7171
, simplifyAtEnd :: Bool
72+
, simplifyBeforeFallback :: Bool
7273
, customLogLevels :: ![Log.LogLevel]
7374
}
7475

@@ -353,7 +354,10 @@ respondEither cfg@ProxyConfig{statsVar, boosterState} booster kore req = case re
353354
"Booster " <> show boosterResult.reason <> " at " <> show boosterResult.depth
354355
-- simplify Booster's state with Kore's simplifier
355356
Log.logInfoNS "proxy" . Text.pack $ "Simplifying booster state and falling back to Kore "
356-
simplifyResult <- simplifyExecuteState logSettings r._module def boosterResult.state
357+
simplifyResult <-
358+
if cfg.simplifyBeforeFallback
359+
then simplifyExecuteState logSettings r._module def boosterResult.state
360+
else pure $ Right (boosterResult.state, Nothing)
357361
case simplifyResult of
358362
Left logsOnly -> do
359363
-- state was simplified to \bottom, return vacuous

booster/tools/booster/Server.hs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ main = do
112112
, boosterSMT
113113
, fallbackReasons
114114
, simplifyAtEnd
115+
, simplifyBeforeFallback
115116
}
116117
} = options
117118
(logLevel, customLevels) = adjustLogLevels logLevels
@@ -220,6 +221,7 @@ main = do
220221
, boosterState
221222
, fallbackReasons
222223
, simplifyAtEnd
224+
, simplifyBeforeFallback
223225
, customLogLevels = customLevels
224226
}
225227
server =
@@ -286,6 +288,8 @@ data ProxyOptions = ProxyOptions
286288
-- ^ halt reasons to re-execute (fallback) to double-check the result
287289
, simplifyAtEnd :: Bool
288290
-- ^ whether to run a post-exec simplification
291+
, simplifyBeforeFallback :: Bool
292+
-- ^ whether to run a simplification before fall-back execute requests
289293
}
290294

291295
parserInfoModifiers :: InfoMod options
@@ -334,6 +338,12 @@ clProxyOptionsParser =
334338
( long "no-post-exec-simplify"
335339
<> help "disable post-exec simplification"
336340
)
341+
<*> flag
342+
True
343+
False
344+
( long "no-fallback-simplify"
345+
<> help "disable simplification before fallback requests"
346+
)
337347

338348
reasonReader :: String -> Either String HaltReason
339349
reasonReader = \case

0 commit comments

Comments
 (0)