From dd4858222aa5a24fdefbb52bb3abf7a31c7e692c Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 18 Nov 2026 11:19:19 -0300 Subject: pdf-scroll-bench: its core's clock moves a frame each frame, as a shell's loop moves it (Pardes.advance), where it stood still: the PDF's glide and fling are on that clock since the split, so a slow scroll's travel summed into one window that never closed and counted as a fling, rendering 25 bands where 4 pages were rendered; a real window session (offscreen, its clock running) renders the same with part 2's kind and this one: 2 pages over 192 notches at 120, 30 and 4 ms a notch, a fling of 48 notches a frame 3-5 (one band) here against 4-7 (1-2 bands) with part 2's; the fixed bench on part 2's tree and on this one: slow_scroll 4 rasters and 4, instructions:u 18,451-18,455M against 18,064-18,069M (-2.1%; the unfixed bench measured 18,393-18,403M against 19,209-19,211M); the glide's frames in flight differ by decision P8 (their visual hashes); no suite compiles the bench Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- test/pdf_scroll_bench.zig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/pdf_scroll_bench.zig b/test/pdf_scroll_bench.zig index bb4640f7..595037ae 100644 --- a/test/pdf_scroll_bench.zig +++ b/test/pdf_scroll_bench.zig @@ -277,9 +277,15 @@ fn measure(config: Config, plan: Plan) !Result { var visual: u64 = 0x7061_7264_6573_5343; var shown: u64 = 0; var total: u64 = 0; + // The core's clock a frame on at each, as a shell's loop moves it + // (its glide and a fling are on that clock). + var now: u64 = std.time.ns_per_s; + core.advance(now); for (0..plan.frames) |frame| { const button: pardes.Mouse.Button = if (plan.scenario == .fling_reverse and frame >= plan.down_frames) .wheel_up else .wheel_down; const started = nowNs(); + now += pardes.frame_ns; + core.advance(now); for (0..ticks) |_| core.update(.{ .mouse = .{ .button = button, .kind = .press, .col = rect.x + rect.w / 2, .row = rect.y + rect.h / 2, .amount = config.turn } }); _ = arena.reset(.retain_capacity); const surface = try core.render(arena.allocator()); -- cgit v1.3