Debugger chrome: dock workspace, registers + pause/step, engine-equivalence + render-decode/mouse oracles (#53 slice 3, first artifact) - #58
Merged
Conversation
…rep, #53) The --debug chrome's RUN state will drive the same inlined hot loop as plain gfx mode. Called once per 70224 T-cycles, so the lift is free; twin markers moved intact (check_twins green), gfx smoke + 500K canary pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tate (#53) debug_step_instr is the slow readable twin of the hot loops, guarded semantically: --engine debug byte-diffs against the hot engine's dump (CYC/regs/flags/MMIO/SERLEN/MEMSUM) at the same cycle bound — EQUIVALENT at 500K on cpu_instrs, and Blargg 06 prints Passed through it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
--debug opens a dock workspace: center LCD canvas, west registers (code_view fed by debug_regs_text — the same formatter --dump-state prints) + pause/step-instr/step-frame controls. RUN drives run_frame at hot-loop speed; STEP drives src/debug.eigs. --break-cycle auto-pauses and every pause/step emits the canonical dump + panel geometry on stdout (the oracle seam). Chrome pause dump at CYC=421368 byte-equals the headless engine's --dump-state at the same bound. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
) A) run_debug_equivalence.sh (CI, headless, any pin): hot vs debug engine dump byte-diff at 500K + Blargg 06 Passed through the debug engine. B) run_debug_ui_oracle.sh (self-arming: SKIPs while the pinned lib predates dock, everything REQUIRED once the probe passes): glyph atlas from real rendered pixels (atlas_app.eigs), registers panel decoded from a screenshot and byte-diffed against the core's stdout dump, real pointer clicks (hover->Step->Run->Pause + inert click-away), planted render fault caught. The oracle found its own first bug: xdotool getwindowgeometry returns the FRAME origin under a reparenting WM — clicks landed one titlebar low (Step hit Frame); fixed via xwininfo client coords + per-dump reason asserts. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
app_loop runs the toolkit focus path AND the app key handler, so space on a clicked (still-focused) button double-fired: pause is now 'p' (a key the focus path ignores) and every control click drops focus, so return stays a joypad Start press. Lint pragma on src/debug.eigs (module fragment). CLAUDE.md + CHANGELOG document the debugger and its oracle set. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First artifact of #53 (fleet UI ladder rung 5, slice 3): a dock-workspace debugger chrome around the LCD — registers panel + pause/step — with the oracle set the issue prescribes. Disassembly/breakpoints and tile/VRAM/OAM viewers remain on #53.
What ships
--debugopens the chrome (dock #848 from EigenScript main; dev-binary decoupled — see CI note): center = live LCD canvas, west = registerscode_view+ Pause/Run, Step-instr, Step-frame buttons.p/s/fkeyboard equivalents; joypad keys still play the game while running.--break-cycle Nauto-pauses at the first frame boundary ≥ N.src/debug.eigs— the engine side, headless-safe:debug_step_instr(the non-inlined, readable form of the hot-loop bodies), the canonical state dump (CYC/regs/FLAGS/IE IF/LCDC STAT LY DIV TIMA TMA TAC ROM+SERLEN/MEMSUMover all mutable memory),--dump-state, and--engine debugon the headless CLI.run_frame(cpu, mem)lifted out of the gfx loop (twin markers moved intact) — plain gfx mode and the chrome's RUN state now drive the identical inlined hot loop, once per 70224 T-cycles.Oracles (all green)
tests/run_debug_equivalence.sh, in CI, runs on any pin): hot engine vs debug engine full-dump byte-diff at 500K cycles — identical including the memory hash — plus Blargg06.gbdriven entirely through the debug engine →Passed(~3s).--cycles 421368 --dump-state(a frame boundary is an instruction boundary, so the bound reproduces exactly).tests/run_debug_ui_oracle.sh): glyph atlas built from real rendered output (tests/atlas_app.eigs, never a golden image); the registers panel is decoded back out of window screenshots and byte-diffed against the core's stdout dump — 11/11 lines identical at every checkpoint.--plant-render-faultcorrupts the panel while the dump stays truthful — caught.The mouse oracle caught its own first bug on first run:
xdotool getwindowgeometryreports the frame origin under a reparenting WM, so every click landed one titlebar-height low (Step hit Frame). Fixed withxwininfoclient coords, plus per-dump reason asserts so a mis-aimed click can never pass by coincidence. A second real find:app_loopruns the toolkit focus path and the app key handler, so space on a clicked (focused) button double-fired — pause moved topand the controls drop focus after acting.CI / pin note
Dock landed upstream after the v0.37.0 cut, so the chrome is dev-binary-only until the next release wave.
tests/run_debug_ui_oracle.shis self-arming: on the current pin the dock probe SKIPs it loudly; once the pin carries dock, every missing tool or display becomes a hard FAIL so the oracle cannot be silently dropped. The equivalence gate needs no lib/ui and runs in CI now. The devcontainer gains the X tooling (xdotool, x11-apps, x11-utils, python3-pil) so bump day needs no further change.Part of #53 — does not close it.
🤖 Generated with Claude Code