diff options
Diffstat (limited to 'gui/bench/RESULTS.md')
| -rw-r--r-- | gui/bench/RESULTS.md | 88 |
1 files changed, 60 insertions, 28 deletions
diff --git a/gui/bench/RESULTS.md b/gui/bench/RESULTS.md index d24659b..89f0d78 100644 --- a/gui/bench/RESULTS.md +++ b/gui/bench/RESULTS.md @@ -1,6 +1,6 @@ # Debug V8 versus a small C target -Measured locally on 2026-11-12, Linux 7.2.11-arch1-1, Intel i7-11700, +Measured locally on 2026-11-13, Linux 7.2.11-arch1-1, Intel i7-11700, Zig 0.17.0, ReleaseFast controller. The targets were a `cc -g -O0` C loop and **unoptimized debug V8**, not release d8. Both used the same controller: 512 stack bytes, 24 disassembled instructions and telescope depth 2, with a @@ -13,22 +13,22 @@ Final controller run: python3 gui/bench/steps.py \ --d8 /tmp/computeranim-v8-debug-remote/d8 \ --ztrace zig-out/bin/ztrace \ - --out /tmp/ztrace-step-bench-cleared + --out /tmp/ztrace-step-bench-ui ``` | 1,000 instruction steps | C | Debug V8 / generated JS | | --- | ---: | ---: | -| Capture + flush, median | 35.73 µs | 38.47 µs | -| Capture + flush, p95 | 45.13 µs | 59.18 µs | -| Controller round trip, median | 46.94 µs | 49.53 µs | -| Controller round trip, p95 | 59.23 µs | 73.00 µs | -| Controller round trip, maximum | 310.72 µs | 381.48 µs | -| Launch through first requested breakpoint | 9.50 ms | 901.84 ms | +| Capture + flush, median | 37.48 µs | 38.43 µs | +| Capture + flush, p95 | 54.37 µs | 52.48 µs | +| Controller round trip, median | 49.49 µs | 49.48 µs | +| Controller round trip, p95 | 72.46 µs | 68.31 µs | +| Controller round trip, maximum | 553.21 µs | 364.10 µs | +| Launch through first requested breakpoint | 5.98 ms | 938.49 ms | This supports comparable steady instruction-step cost for these workloads. It does not claim that V8 starts as quickly as a small program, or that all C++ -source/DWARF operations have this cost. The earlier 1,000-step run measured -39.09 / 44.42 µs capture medians and 53.69 / 60.57 µs round-trip medians for +source/DWARF operations have this cost. The previous 1,000-step run measured +35.73 / 38.47 µs capture medians and 46.94 / 49.53 µs round-trip medians for C / V8. Scheduling and cache state affect these microsecond measurements; no CPU isolation or filesystem-cache dropping was used. GUI presentation is not included in the controller timings. @@ -42,9 +42,23 @@ the recording no longer reports the previous native source line. The loop address is read from V8's own output; the harness fails rather than guesses if a different V8 compiler allocates different registers. -The raw records, logs and JSON results are in `/tmp/ztrace-step-bench-cleared`. +The raw records, logs and JSON results are in `/tmp/ztrace-step-bench-ui`. The script is the durable reproducer; `/tmp` artifacts are not permanent. +With JIT source information loaded, the final 1,000-step run remained comparable: + +| Source-enabled run | C | Debug V8 / generated JS | +| --- | ---: | ---: | +| Capture + flush, median | 36.60 µs | 37.76 µs | +| Capture + flush, p95 | 46.78 µs | 46.35 µs | +| Controller round trip, median | 48.04 µs | 48.84 µs | +| Controller round trip, p95 | 60.97 µs | 63.83 µs | + +Reproduce with `--jit-source --out /tmp/ztrace-step-bench-source` added to the +command above. This run imports the real JIT ELF before sampling and checks the +final recording retains JavaScript source information. The initial import is +excluded from steady stepping, just as executable startup is excluded. + ## V8 provenance The user's remote Arch build host (`chaincli-box`) has the existing checkout at @@ -68,10 +82,19 @@ and smoke-tested locally. ## Checks -The GUI's real-target script exercises launch, a named breakpoint, continue, -keyboard and mouse instruction stepping, source stepping, pause during execution, -and browsing history back to live. The core tests additionally check pause -signal suppression and source stepping without line information. +The GUI's real-target script exercises launch, a named breakpoint through the +Vim command bar, continue, keyboard and mouse instruction stepping, source +stepping, pause during execution and browsing history back to live. It also +checks fractional scrolling, pane histories, Mouse4/5 through the actual +pointer handler, semantic right-clicks, minimap dragging and animated lenses. +Native-window checks cover keyboard stepping, pane focus, scrolling and command +entry. Raw hardware Mouse4/5 injection was not performed. + +`gui/test/inspection.py` checks bounded read-only code/memory inspection against +C and debug V8: RIP stays unchanged, invalid counts are rejected, and subsequent +stepping still works. With `--d8`, it imports V8's real GDB JIT ELF and asserts +that source line 6 of the JavaScript fixture appears in the recorded instruction +metadata. The line mapping comes from V8's DWARF line program. The root suite had two failures before this work; they remain in the existing loader/syscall formatting and watch/string assertions. The new debugger tests @@ -86,17 +109,26 @@ animation design, checked strike/highlight/settled frames, and approved the final native window. The checked-in GUI test asserts that the stack highlight changes between strike and settled screenshots, as well as exercising controls. -At 1920×1080, an approximate headless redraw measurement was **1.23 ms/frame -for C and 2.41 ms/frame for V8**. This subtracts the median elapsed time of -30-frame runs from 330-frame runs (three repeats each), then divides by 300. -Both opened the corresponding 1,000-step recording. V8 displayed 24 instruction -rows while C displayed 10; this is a whole-view cost, not an equal-row renderer -comparison. It excludes live trace reopening and display presentation latency. -Raw timings are in `/tmp/ztrace-gui-redraw-results.json`. +At 2240×1260, an approximate headless redraw measurement was **3.55 ms/frame +for C and 4.28 ms/frame for V8**, including source/disassembly, registers, +stack, memory and cached content minimaps. `gui/bench/redraw.py` subtracts the +median elapsed time of 30-frame runs from 330-frame runs (three repeats each), +then divides by 300. Both opened their corresponding source-enabled 1,000-step recording; +this is a whole-view cost, not an equal-row renderer comparison. It excludes +live trace reopening and display presentation latency. Raw timings are in +`/tmp/ztrace-gui-redraw-source.json`. The previous, smaller 1920×1080 view measured +1.23 / 2.41 ms/frame for C / V8. + +The complete animation gallery and shared renderer tests passed after the +library changes. Existing applications retain their organization: the GUI uses +shared source preparation/alignment, row drawing, address hit geometry and +minimap drawing instead of maintaining a second renderer. -The final native session was verified with d8 PID 2502490 in Linux tracing-stop -state and recorded RIP `0x7f09921c0196`: breakpoint 2 on `add r8d, r9d`, offset -`0x156` inside TurboFan-generated `jitWork`. It is left open in the GUI. The -recording is `/tmp/ztrace-gui-2502452-357545622054931.ztrace`; the screenshot is -`/tmp/ztrace-v8-live-final.png`. These addresses and PIDs describe this session -only. The complete animation gallery was not re-rendered. +The final native window was independently approved with debug d8 PID 2536162 +in Linux tracing-stop state at breakpoint 1, RIP `0x7f6ee00001a2`: `jbe`, offset +`0x162` inside TurboFan-generated `jitWork`, mapped by V8's line table to the +body at `gui/targets/jit.js:6`. Both the source-to-PC and branch-to-target arrows +are visible. The GUI remains open. The recording is +`/tmp/ztrace-gui-2536121-364024192152453.ztrace`; the screenshot is +`/tmp/ztrace-v8-final-reviewed.png`. Addresses and PIDs identify this session +only. Other test windows were closed. |
