Repository navigation
Say where in the frame the machine was touched, and stand on a scanline - #75
Merged
Merged
Conversation
Three gaps a session of mid-screen raster work found in the headless debugger, easiest first. The REPL's `state` reported the beam position and stopped there. For raster work those are the symptom; loopy's v, t, fine-x and the write latch are what explains them -- a coarse-X off by one tile on exactly one scanline says so in `ppu.v` and nowhere else in the program. The report has carried the same four all along, spelled the same way. `--log-events FILE` is the second, and it is wiring rather than new machinery: `Debugger.setEventSink` already hands out every PPU, audio and mapper write and both interrupts with the beam position each landed on, and nothing but the desktop's Events tab was listening. `EventTracer` writes them down beside `Tracer`, one record a line with the frame, scanline and dot, and `events on|reads|off` does it inside a session. It stops nothing, which is the whole point: a watchpoint on $2006 in a game whose NMI handler writes it forty times a frame is forty stops for one frame's worth of answer, and a trace of the same run is a gigabyte. This is the middle, and `EventLogRunTests` holds a logged run to the unlogged run's frame hash and cycle count. Seven whitespace separated fields on every line, which is why `EventKind` grew an `id()` beside its label: five of the seven labels are two words, so a reader cutting a line up would read the value of a PPU write as the word "write". `run-until-scanline N` is the third, and it is a sibling command rather than a beam term in `break ... if`. A condition stays answerable from a `CPU.State` and a `peek`, which is what its javadoc promises and what keeps it testable without a machine -- and the question raster work actually asks has no address in it at all. And `--headless --help` opens with a map of its own sections, because it is 250 lines and the half people miss is the half below the picture. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
SweepTests.aViewOnScreenIsSweptUntilItGoesAway showed a window, slept a fixed 200ms and asserted a 5ms timer had ticked at least once. That whole budget is one cold first-window creation on the event dispatch thread -- a native peer, a graphics pipeline, a font or two -- so on a loaded Windows runner the thread can eat all of it with the timer started and not yet run, which reads as a timer that never started. It failed that way once on CI and passed on a re-run of the same commit. It only surfaced now because the Windows and macOS runners arrived in the commit before it: on Linux the test is skipped as headless, so this assertion had barely run in CI at all. So the positive half waits for the tick instead, up to ten seconds it will never spend -- the cost of being wrong is asymmetric, a red build nobody can reproduce against a few milliseconds on the one run where the machine was busy. The negative half keeps its fixed pause, because an absence has nothing to wait for and the timer is already stopped on the dispatch thread before the pause begins. Two smaller things fall out. isHeadless() is whether the JVM has a display at all, which is weaker than whether the window just asked for reached the screen, so the panel is asked directly and a machine that cannot show one skips rather than fails. And the dispose moves into a finally, so a failure leaves no window behind. Checked by breaking Sweep so the timer never starts: the test still fails, on the same assertion. Co-Authored-By: Claude Opus 5 (1M context) <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.
Three gaps in the headless debugger that a session of mid-screen raster work turned up.
--log-events FILE(andevents on|reads|offin the REPL) writes down every PPU, audio and mapper register write and both interrupts with the frame, scanline and dot each landed on — wiring upDebugger.setEventSink, which already produced all of it and had only the desktop's Events tab listening — so "where does this split land, on every frame, for two hundred frames" is one run rather than a stop and astateand arunper write; it arms nothing, andEventLogRunTestsholds a logged run to the unlogged run's frame hash and cycle count. The REPL'sstatenow reportsv,t,fineXandwriteLatchbeside the beam position, spelled as the report has always spelled them — those four are what explains a background one tile out on exactly one scanline, where the scanline and dot are only the symptom.run-until-scanline Nstands the machine part way down a frame: a sibling ofrun-until-change/-stillrather than a beam term inbreak ... if, so a condition stays answerable from aCPU.Stateand apeek, and because the question raster work actually asks has no address in it.EventKindgrew anid()beside its label so every record has seven whitespace-separated fields whatever happened, and--headless --helpnow opens with a map of its own sections.mvn -B clean testis green across all eight modules.🤖 Generated with Claude Code