diff options
author | Alon Zakai <azakai@google.com> | 2024-03-26 11:01:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-26 11:01:54 -0700 |
commit | 19f8cc706e823f97554f5e4e9167060061d32a41 (patch) | |
tree | a8860b47bc0a4b97e172f16a05c760de022a40ad /test | |
parent | 431e858c4f4ac0343914eb42196f8bb64ac99023 (diff) | |
download | binaryen-19f8cc706e823f97554f5e4e9167060061d32a41.tar.gz binaryen-19f8cc706e823f97554f5e4e9167060061d32a41.tar.bz2 binaryen-19f8cc706e823f97554f5e4e9167060061d32a41.zip |
Add "interposition" to the fuzzer's mutate() method (#6427)
Before this PR we only mutated by replacing an expression with another, which
replaced all the children. With this PR we also do these two patterns:
(A
(B)
(C)
)
=> ;; keep children, replace A
(block
(drop (B))
(drop (C))
(NEW)
)
,
(D
(A
(B)
(C)
)
)
=> ;; keep A, replace it in the parent
(D
(block
(drop
(A
(B)
(C)
)
)
(NEW)
)
)
We also try to replace onto the new D (either A itself, or A's children).
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/fuzz_metrics_noprint.bin.txt | 54 | ||||
-rw-r--r-- | test/passes/translate-to-fuzz_all-features_metrics_noprint.txt | 74 |
2 files changed, 71 insertions, 57 deletions
diff --git a/test/passes/fuzz_metrics_noprint.bin.txt b/test/passes/fuzz_metrics_noprint.bin.txt index 703c2aeb4..f6af82a5a 100644 --- a/test/passes/fuzz_metrics_noprint.bin.txt +++ b/test/passes/fuzz_metrics_noprint.bin.txt @@ -1,34 +1,34 @@ total - [exports] : 29 - [funcs] : 39 + [exports] : 18 + [funcs] : 21 [globals] : 9 [imports] : 4 [memories] : 1 [memory-data] : 2 - [table-data] : 6 + [table-data] : 7 [tables] : 1 [tags] : 0 - [total] : 5494 - [vars] : 119 - Binary : 400 - Block : 892 - Break : 210 - Call : 232 - CallIndirect : 12 - Const : 898 - Drop : 49 - GlobalGet : 421 - GlobalSet : 333 - If : 289 - Load : 113 - LocalGet : 434 - LocalSet : 306 - Loop : 118 - Nop : 85 - RefFunc : 6 - Return : 62 - Select : 52 - Store : 45 - Switch : 1 - Unary : 380 - Unreachable : 156 + [total] : 11685 + [vars] : 64 + Binary : 848 + Block : 1846 + Break : 456 + Call : 275 + CallIndirect : 117 + Const : 1952 + Drop : 86 + GlobalGet : 844 + GlobalSet : 679 + If : 625 + Load : 236 + LocalGet : 1050 + LocalSet : 764 + Loop : 301 + Nop : 143 + RefFunc : 7 + Return : 103 + Select : 77 + Store : 111 + Switch : 3 + Unary : 835 + Unreachable : 327 diff --git a/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt index 9697da8bd..241d84718 100644 --- a/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt +++ b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt @@ -1,6 +1,6 @@ total [exports] : 3 - [funcs] : 6 + [funcs] : 5 [globals] : 1 [imports] : 5 [memories] : 1 @@ -8,35 +8,49 @@ total [table-data] : 1 [tables] : 1 [tags] : 2 - [total] : 314 - [vars] : 38 - ArrayNew : 2 - ArrayNewFixed : 1 + [total] : 661 + [vars] : 21 + ArrayGet : 1 + ArrayLen : 1 + ArrayNew : 4 + ArrayNewFixed : 6 AtomicFence : 1 - Binary : 58 - Block : 28 - Break : 6 - Call : 10 - Const : 72 - Drop : 3 - GlobalGet : 10 - GlobalSet : 10 + AtomicRMW : 1 + Binary : 87 + Block : 78 + Break : 17 + Call : 11 + Const : 125 + DataDrop : 1 + Drop : 7 + GlobalGet : 26 + GlobalSet : 26 I31Get : 1 - If : 7 - Load : 18 - LocalGet : 36 - LocalSet : 21 - Loop : 1 - Nop : 2 - RefEq : 1 - RefFunc : 2 - RefI31 : 2 - RefNull : 1 - Return : 2 - Select : 1 - Store : 1 - StructGet : 1 + If : 24 + Load : 22 + LocalGet : 65 + LocalSet : 38 + Loop : 9 + MemoryCopy : 1 + Nop : 9 + RefAs : 8 + RefCast : 1 + RefEq : 2 + RefFunc : 1 + RefI31 : 3 + RefIsNull : 2 + RefNull : 13 + RefTest : 1 + Return : 4 + SIMDExtract : 3 + SIMDLoad : 1 + Select : 2 + Store : 4 + StructGet : 2 StructNew : 3 - TupleMake : 2 - Unary : 6 - Unreachable : 5 + Throw : 1 + Try : 1 + TupleExtract : 2 + TupleMake : 5 + Unary : 28 + Unreachable : 13 |