summaryrefslogtreecommitdiff
path: root/gui/bench/RESULTS.md
diff options
context:
space:
mode:
Diffstat (limited to 'gui/bench/RESULTS.md')
-rw-r--r--gui/bench/RESULTS.md102
1 files changed, 102 insertions, 0 deletions
diff --git a/gui/bench/RESULTS.md b/gui/bench/RESULTS.md
new file mode 100644
index 0000000..d24659b
--- /dev/null
+++ b/gui/bench/RESULTS.md
@@ -0,0 +1,102 @@
+# Debug V8 versus a small C target
+
+Measured locally on 2026-11-12, 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
+recording flush at every stop. No syscall tracing and no continuous stepping
+while the user has selected Continue.
+
+Final controller run:
+
+```sh
+python3 gui/bench/steps.py \
+ --d8 /tmp/computeranim-v8-debug-remote/d8 \
+ --ztrace zig-out/bin/ztrace \
+ --out /tmp/ztrace-step-bench-cleared
+```
+
+| 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 |
+
+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
+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.
+
+The V8 fixture compiles `jitWork` with TurboFan, traps in the native runtime,
+then installs an actual software breakpoint at `addl r8,r11` inside the
+optimized loop. The harness asserts the returned RIP equals that address and
+lies in an anonymous executable mapping. It then tests source-step fallback
+without JIT source lines, records the instruction-step sample, and checks that
+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 script is the durable reproducer; `/tmp` artifacts are not permanent.
+
+## V8 provenance
+
+The user's remote Arch build host (`chaincli-box`) has the existing checkout at
+`/home/goblin/v8-research/v8`. Ninja verified the compatible debug build up to date
+(`ninja: no work to do`). No V8 compilation was performed on the workstation.
+The complete runtime artifacts were copied to `/tmp/computeranim-v8-debug-remote`
+and smoke-tested locally.
+
+- Revision: `84703f702dca525edd469f3a98d784faa46a02f8`.
+- d8 version: `15.2.0 (candidate)`.
+- Output: `out/x64.debug-vuln` (historical directory name).
+- Existing unrelated local `BUILD.gn` change to the `v8_fuzzer` source list was
+ preserved; the checkout was not reset or updated.
+- `is_debug=true`, `v8_optimized_debug=false`, `symbol_level=2`,
+ `v8_symbol_level=2`, `use_debug_fission=true`, `target_cpu="x64"`.
+- Disassembler, object printing, heap verification, slow DCHECKs and backtraces
+ enabled; `use_remoteexec=false`, `use_siso=false`.
+- Component build: d8 plus its shared libraries (including the large debug
+ libv8.so), snapshots and ICU data. Split `.dwo` files were not copied, so this
+ run is not a validation of complete C++ local-variable/source debugging.
+
+## 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 root suite had two failures before this work; they remain in the existing
+loader/syscall formatting and watch/string assertions. The new debugger tests
+pass (86/88 in the full root suite; 25/27 debugger tests, with those same two
+failures). No assertion was
+weakened to hide them.
+
+## Rich GUI verification
+
+A separate UI agent compared rendered C and V8 frames against the existing
+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`.
+
+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.