# Debug V8 versus a small C target 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 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-ui ``` | 1,000 instruction steps | C | Debug V8 / generated JS | | --- | ---: | ---: | | 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 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. 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-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 `/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 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 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 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 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.