Commit f73ffcd
staged concolic miniwasm (#89)
* remove unused expressions
* let's start from the staged miniwasm interpreter
* dup all concrete operations to symbolic
* maintain a symbolic stack during the execution
* record path conditions
* The branch node only needs to remember the positive condition.
use the sub-nodes of the branch to classify whether the execution is true or false
* symbolic runtime for explore tree
* add a to graphviz method, enhancing debug experience
* put symbolic expression on the SymStack
* `type.symbolic` instruction
* test staged concolic compilation in CI
* dump graphviz by default
* concolic driver
* fix: add an unreachable node & use GENSYM_ASSERT
* call z3 to solve constraints
* remove unused & resize before update environment
* use c++20
* branch in brtable
* use driver's entrypoint by default
* rename package name of staged miniwasm
* tweak
* Reuse symbolic states (#90)
1. split concrete and symbolic interpreter
2. copy tests from concrete execution
3. some bug fixes
* c++17 compatible
* fix
* revert: don't split concrete/symbolic interpreter & don't support snapshot for now
* introduce a SnapshotNode, which currently behaves same as UnexploredNode
* fill snapshot into SnapshotNode
* snapshot reuse via continuation
more tests should be added
* remove debug printings
* give every branch node an ID
* a bitmap to record the branch coverage
* a new exploring strategy: exit when all branches are covered
* support numeric globals
* Explicitly classify the next stage computation and its type
Then we can compose/decompose them more easily.
* correct behavior for global
* make log function returning std::monostate/Unit type
* Symbolic memory (#91)
* move Memory_t to symbolic
* failing cases for load
* correct behavior for load/store (concrete)
* test offset
* test concolic, currently failed
* oops
* symstack and stack should be consistent
* added test for extract(currently failing
* extract & concat
* some fixes, make btree example runable
* tweak
---------
Co-authored-by: butterunderflow <azhong.934@gmail.com>
* fix: high bits should be concat first
* make btree example work with concolic execution
* preallocate pages for the memory
* remove some unperformant code
1. dont intialize memory twice
2. dont allocate memory for unuse symbolic memory, because we need to copy them
3. profiling utilities
* work list algorithm for exploration
* config header; fix extract evaluation; capture by value in lambda
* replace SymEnv_t's underlying representation
* compare the exploration trees (w/ vs. w/o snapshot reuse)
* accelerate test by using O0 optimization
* add an option to use immutable data structure
* a simple test case to show immutable's improvements
* add a benchmark testcase
* a pool to store symbolic concrete
* a example to show when snapshot is highly effective
* some infra to support the cost model to decide if we should create snapshot
* a cost model to determin if we want to create snapshot
* update btree benchmarks
* rename
* turn wast to wat
* use imported api for symbolic operations so they can be run by wat2wasm
currently only 2o2u.wat works
* replace call to i32.symbolic with external call
* a normalize script
* replace sym_assume with (call $i32.sym_assume)
* remove print_btree, it's a dummy instruction only implemented in wasp
* replace (sym_assert) with (call $i32.sym_assert)
* replace the usage of get_sym_int32
* remove two files that are not runable by wasp
* convert all wat file to a form we can parse via (wasm2wat . wat2wasm)
* get_sym_int32 is not useful anymore
* take get_sym_int32 back but don't use them
* a test entry that compile btree cases
* a compile script in python
* avoid some usage of fun
* remove an unused function
* nontermination (if loop termination depends on symbolic value, it will explode the user's stack instead, now it gets out of bounds for the concrete stack in c++)
* support sym_assume to prune subtrees
* support write profile file
* a script for running and cleaning up benchmark executables.
* never build an expression twice
* update sym_assert and timer
* refactor operator to explicit methods
* fixed a bug, zero initialize local variables
* use z3's api to evaluate a symbolic expression
* let z3 decide the value of symbols that are not in the model
* tweak tests
* update test script
* support some f32
* support call_indirect
* final call_indirect
* misc
* up
* fix
* up btree for wasp
* update collection-c benchmark
* add import
* i32.symbolic
* sym_assume is call 1
* sym_assert is call 2
* alloc and free wasp primitive
* support some operations
* tweak
* a script to run wasp on btree benchmarks
* data section initialize
* revert something
* more operations
* try not to build symbolic expressions when all operands are concrete
* a crafted benchmark
* snapshot benchmark
* lots cleanup
* fix cost ratio related things
* fix: extract's index is 1-based
* remove debug prints
* use a dedicated slot for current continuation (so we can enforce tail call optimizations later)
* finally we have tail call optimization enforced
To run larger benchmarks, we must have this
* a test case for very long execution
* fix
* little optimize
* save current symbolic environment in snapshot
* fix a memory issue detected by sanitizer
* more guaranteed tail call
* a interface to calculate the dag size of symbolic
* a unified interface for storing symbolic byte
* calculate dag size of symbolic expressions
* avoid creating duplicate symbolic operations
* avoid creating same symbolic expressions multiple times by factory pattern
* reorg snapshot related logic: only calculate cost of a snapshot when it's reachable
* update profile
* update crafted benchmarks
* fix smallbv factory
* a cache for query results
* independent constraint resolving
* remove collection-c benchmark
* update benchmark compilation entry
* remove unnecessary files
* remove pldi2026 benchmarks, add them in another PR
* a function to collect path conditions without re-iterating same path
* fix ci
* support wasp style profiling
* mechanism for profiling Z3 solver API calls
* tweak
* extract node picking logic from the driver
* small fix
* use a unified path condition to explore new path
* fix ci
* a bv2bool method
* mark a node as unreachable if its condition is concrete
* more simplification
* more simplification
* enrich symbolic encoding, so we can simplify them further
* more simplification applied other concolic execution tools
* more simplification detected by gpt
* tweak
* try to reduce the use of not
* try build z3_expr less often
* update
* fix ci
* refactor & fix ci
---------
Co-authored-by: ahuoguo <ahuoguo@gmail.com>1 parent d35cad8 commit f73ffcd
File tree
48 files changed
+31721
-1006
lines changed- .github/workflows
- benchmarks/wasm
- btree
- compare_wasp
- staged
- grammar
- headers
- wasm
- src
- main
- java/wasm
- scala/wasm
- test/scala/genwasym
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
48 files changed
+31721
-1006
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| |||
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
81 | | - | |
| 85 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2626 | 2626 | | |
2627 | 2627 | | |
2628 | 2628 | | |
2629 | | - | |
2630 | 2629 | | |
| 2630 | + | |
2631 | 2631 | | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
2632 | 2635 | | |
2633 | 2636 | | |
2634 | 2637 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
0 commit comments