From 75ce2c37e6909a6c02dd3a9504718a76bf188556 Mon Sep 17 00:00:00 2001 From: Gregory Oakes Date: Fri, 6 Sep 2024 18:32:14 -0500 Subject: [PATCH 1/2] fuzzer: Fix `--zig-lib-dir` for client-side WASM. --- lib/std/Build/Fuzz/WebServer.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/std/Build/Fuzz/WebServer.zig b/lib/std/Build/Fuzz/WebServer.zig index a0ab018cf57c..af9336ec6d18 100644 --- a/lib/std/Build/Fuzz/WebServer.zig +++ b/lib/std/Build/Fuzz/WebServer.zig @@ -247,6 +247,8 @@ fn buildWasmBinary( try std.fmt.allocPrint(arena, "-MWalk={}", .{walk_src_path}), // "--dep", "Walk", // try std.fmt.allocPrint(arena, "-Mhtml_render={}", .{html_render_src_path}), // + "--zig-lib-dir", + ws.zig_lib_directory.path orelse ".", "--listen=-", }); From 5935ddc2da145f82d98497ebf41cac6f5944a7eb Mon Sep 17 00:00:00 2001 From: Gregory Oakes Date: Fri, 6 Sep 2024 18:33:38 -0500 Subject: [PATCH 2/2] fuzzer: Track the rate of fuzzing in cycles/s. As libfuzzer develops or as users design their own fuzz tests which use libfuzzer, it will be essential to understand the performance impact of changes. This change tracks the rate of execution in terms of cycles per second and updates the UI at most every second. This is implemented with a periodic update to the web UI which occurs at least every 1 second. The period is not guaranteed to be regular. --- lib/fuzzer/index.html | 1 + lib/fuzzer/main.js | 8 ++++++++ lib/fuzzer/wasm/main.zig | 13 +++++++++++++ lib/std/Build/Fuzz.zig | 4 +++- lib/std/Build/Fuzz/WebServer.zig | 22 ++++++++++++++++++++-- lib/std/Build/Fuzz/abi.zig | 12 ++++++++++++ 6 files changed, 57 insertions(+), 3 deletions(-) diff --git a/lib/fuzzer/index.html b/lib/fuzzer/index.html index 16fa87991377..2dbfa85d2d3a 100644 --- a/lib/fuzzer/index.html +++ b/lib/fuzzer/index.html @@ -145,6 +145,7 @@