From f67fec978a9296c651ec06bd2f43686d34ff86ee Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 14 Aug 2026 13:40:29 -0300 Subject: look: richer path/range parsing, pdf rendering, corner-drag and stepgrain snapshots --- build.zig | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'build.zig') diff --git a/build.zig b/build.zig index 6e311072..80e995b6 100644 --- a/build.zig +++ b/build.zig @@ -122,12 +122,15 @@ pub fn build(b: *std.Build) void { const mupdf_check = b.step("mupdf-check", "compile, link, render, and search docs/design.pdf with MuPDF"); const pdf_bench_step = b.step("pdf-bench", "benchmark real MuPDF page rendering (-- [--json] [--reps N] [--warmup N] [--path FILE] [--page N] [--pages N])"); const pdf_sections_bench_step = b.step("pdf-sections-bench", "benchmark PDF outline/sections paths in ReleaseFast (-Doptimize=ReleaseFast -- [--json] [--reps N] [--warmup N])"); + const pdf_scroll_bench_step = b.step("pdf-scroll-bench", "benchmark fast continuous-strip PDF scrolling in ReleaseFast (-Doptimize=ReleaseFast -- [--json] [--reps N] [--warmup N] [--path FILE])"); if (!enable_mupdf) mupdf_check.dependOn(&b.addFail("mupdf-check is unavailable with -Dmupdf=false").step); if (!enable_mupdf) pdf_bench_step.dependOn(&b.addFail("pdf-bench is unavailable with -Dmupdf=false").step); if (!enable_mupdf) pdf_sections_bench_step.dependOn(&b.addFail("pdf-sections-bench is unavailable with -Dmupdf=false").step); + if (!enable_mupdf) + pdf_scroll_bench_step.dependOn(&b.addFail("pdf-scroll-bench is unavailable with -Dmupdf=false").step); // The other half of -Dprebuilt-shaders: recompile every shader and write // the SPIR-V back into shaders/prebuilt/, which is TRACKED rather than @@ -488,6 +491,29 @@ pub fn build(b: *std.Build) void { if (b.args) |args| run_pdf_sections_bench.addArgs(args); run_pdf_sections_bench.setCwd(b.path(".")); pdf_sections_bench_step.dependOn(&run_pdf_sections_bench.step); + + // The fling scoreboard. Same real-core wiring as the sections + // bench: what it measures is one shell frame — a whole batch of + // wheel notches through update() followed by a single render() — + // so it needs the production core, not the raster wrapper alone. + const pdf_scroll_bench = b.addExecutable(.{ + .name = "pardes-pdf-scroll-bench", + .root_module = b.createModule(.{ + .target = target, + .optimize = .ReleaseFast, + .root_source_file = b.path("test/pdf_scroll_bench.zig"), + .link_libc = true, + }), + }); + pdf_scroll_bench.root_module.addImport("pardes", hx_core_mod); + pdf_scroll_bench.root_module.addImport("mupdf", mupdf_mod); + const scroll_bench_opts = b.addOptions(); + scroll_bench_opts.addOption(bool, "release_fast_core", optimize == .ReleaseFast); + pdf_scroll_bench.root_module.addOptions("pdf_scroll_bench_config", scroll_bench_opts); + const run_pdf_scroll_bench = b.addRunArtifact(pdf_scroll_bench); + if (b.args) |args| run_pdf_scroll_bench.addArgs(args); + run_pdf_scroll_bench.setCwd(b.path(".")); + pdf_scroll_bench_step.dependOn(&run_pdf_scroll_bench.step); } } -- cgit v1.3