Skip to content

Conversation

@msooseth
Copy link
Collaborator

@msooseth msooseth commented Sep 5, 2025

Description

The depth should not have been incremented here. It gets incremented inside runBoth when we actually have to branch. If we can determine that the branch can only go one way, this is not supposed to be incremented. Furthermore, with this, we increment it twice when we branch, and we actually have to go both ways. Notice that UnknownBranch does this:

      runBothPaths loc exploreDepth UnknownBranch =
        (runBoth depthLimit exploreDepth ) . PleaseRunBoth condSimp $ (runBothPaths loc exploreDepth) . Case

where:

      Stepper.Fork (PleaseRunBoth cond continue) -> do
        frozen <- liftIO $ stToIO $ freezeVM vm
        let newDepth = vm.exploreDepth+1
        evalLeft <- toIO $ do
          (ra, vma) <- liftIO $ stToIO $ runStateT (continue True) frozen { result = Nothing, exploreDepth = newDepth }
          interpret fetcher iterConf vma (k ra)
        evalRight <- toIO $ do
          (rb, vmb) <- liftIO $ stToIO $ runStateT (continue False) frozen { result = Nothing, exploreDepth = newDepth }
          interpret fetcher iterConf vmb (k rb)
        (a, b) <- liftIO $ concurrently evalLeft evalRight
        pure $ ITE cond a b

Hence, it's incremented already.

I have also renamed a parameter name to be more consistent.

Checklist

  • tested locally
  • added automated tests
  • updated the docs
  • updated the changelog

@msooseth msooseth force-pushed the fixing-depth-width branch 3 times, most recently from 2a79e14 to 89e5a47 Compare September 5, 2025 12:19
@msooseth msooseth changed the title [DRAFT] Fixing depth width [DRAFT] Fixing double depth incrementing Sep 5, 2025
@msooseth msooseth changed the title [DRAFT] Fixing double depth incrementing Fixing double depth incrementing Sep 5, 2025
@msooseth msooseth marked this pull request as ready for review September 5, 2025 12:20
@msooseth msooseth requested a review from blishko September 5, 2025 13:14
Copy link
Collaborator

@blishko blishko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@msooseth msooseth merged commit c11a7d7 into main Sep 5, 2025
6 of 7 checks passed
@msooseth msooseth deleted the fixing-depth-width branch September 5, 2025 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants