Skip to content

Conversation

@msooseth
Copy link
Collaborator

Description

A queue for symbolic execution threads. Currently the number of processors, but should be easy to adjust. Returns [Expr End], and now the ITE is gone. When asking for reachability, we return a full set of leafs (i.e. Expr End-s). All tests pass.

Checklist

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

@msooseth msooseth changed the title New queue idea Symbolic execution queue Oct 21, 2025
@msooseth msooseth force-pushed the queue-symbolic-exec5 branch 2 times, most recently from bd18f0e to b07c460 Compare October 21, 2025 15:56
Cleanup

More generic interpret

Update

Making progress

Making progress

Update

Update

Update

Making progress

Update

Now typecheck

Update

Making progress

Update

Better now

Making progress

Update

Typechecks now

Update

Better

Some improvement?

Better I think

Update

Update

Making progress

Update to fix changes

Fixing

Update

Better

Let's hope this works

Cleaner

Update

Update

Less noise

Update

Much better

Update

Fixing

Update

Update

Update

QED change

Qed fixing still

Fixed Qed

Update to fix cli

Ooops, fixing bug

Better printing

Cleanup

Cleanup

Cleanup

Cleanup

Trying to rebase on top of main

Add changelog

Less braces

Less change

Much better display
@msooseth msooseth force-pushed the queue-symbolic-exec5 branch from b07c460 to 96bb9cd Compare October 21, 2025 16:00
@msooseth msooseth force-pushed the queue-symbolic-exec5 branch from 8d67a30 to e068dc1 Compare October 22, 2025 13:10
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.

Looks good!
I left a few comments and questions.

Comment on lines 451 to 453
conf <- readConfig
(ra, vma) <- liftIO $ stToIO $ runStateT (continue v) frozen { result = Nothing, exploreDepth = newDepth }
let vmConst = vma { constraints = (PEq v expr) : vma.constraints }
Copy link
Collaborator

Choose a reason for hiding this comment

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

The first three lines are the same in both cases. Maybe we can split the cases only after the common point?

Also, we now add a constraint to the constraints of the VM, but we did were not doing that before.
I actually think this is correct!
Seems like previously we might have been missing some information?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah shit. It's already added here:

        pushTo #constraints $ Expr.simplifyProp (addrExpr .== val)

for runAllPaths. Same for runBothPaths:

      runBothPaths loc _ (Case v) = do
        assign #result Nothing
        pushTo #constraints $ if v then Expr.simplifyProp (Lit 0 ./= condSimpConc)
                                   else Expr.simplifyProp (Lit 0 .== condSimpConc)

So adding the constraint is not needed I think. Removing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Wow... that thing was wrong. This: Expr.simplifyProp (Lit 0 ./= condSimpConc) when replaced by PNeg (PEq (Lit 0) cond) it actually works. Otherwise, nope. Ooops. Fixing. And then we can remove adding this condition, since it's added correctly by all continue-s, i.e. for runAllPaths and for runBothPaths. Nice, thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Regarding the shared code... I think they are subtly different? I nevertheless tried to contract things, especially around newT. Let me know what you think!

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.

I think this looks good!
Can you rebase on top of current main?
I think you will have to remove some RealWorld parameters to be compatible with current main.

I would like to run a few experiments afterwards to have some performance numbers.

@sambacha
Copy link
Contributor

I think this looks good!

Can you rebase on top of current main?

I think you will have to remove some RealWorld parameters to be compatible with current main.

I would like to run a few experiments afterwards to have some performance numbers.

yes plz

@msooseth
Copy link
Collaborator Author

I think this looks good! Can you rebase on top of current main? I think you will have to remove some RealWorld parameters to be compatible with current main.

I would like to run a few experiments afterwards to have some performance numbers.

Done! I merged main into this, which is sometimes easier to do. Looks very similar anyway in the git history. I hope it's good :) We can also squash-merge (when merging the PR), if you like, then it will look like a single commit.

@msooseth
Copy link
Collaborator Author

(oops, my merge was a bit bad, sorry, I'll fix soon)

@msooseth msooseth force-pushed the queue-symbolic-exec5 branch from 802d0c3 to 0ba7790 Compare November 18, 2025 14:52
@msooseth
Copy link
Collaborator Author

I have now fixed the biggest issue. I'll fix the 2 tests that fail tonight when I have more time & better internet.

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.

4 participants