Repository navigation
Headless runner: inspection commands, debug console output, flash cache profiling - #568
Conversation
5b8d1f4 to
4b7b64e
Compare
4b7b64e to
1be9bfb
Compare
|
Meat proxying Codex's tests with this PR checked out: Preserve the software-command setting when handling debug-console writesThe new console handler executes whenever either Other findings:
|
|
If you're busy I suppose I can fix the remaining things in a new commit on top and merge that. |
7ee6ff5 to
0d6fe82
Compare
For scripted tests and profiling of programs: read and write memory, hold a key while inspecting the calculator, inspect registers and IX frames, and read the cycle counters, including flash cache misses. Reject unmapped poke ranges before any writes. Report flash accesses with a counter that includes reads and writes. Build and smoke-test the headless frontend on Linux. Co-authored-by: Adrien Bertrand <bertrand.adrien@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Codex <codex@openai.com>
Add DEBUG_CONSOLE_SUPPORT to route calculator dbg_printf output through the console callbacks even in builds without the debugger. The option defaults to off. The headless runner and autotester write this output to stderr. Run the debugger handler first so DBG_SOFT_COMMANDS controls output in debugger-only builds as well as debugger-open and console-clear commands. An explicit DEBUG_CONSOLE_SUPPORT build can also emit console output when software commands are off. Co-authored-by: Adrien Bertrand <bertrand.adrien@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Codex <codex@openai.com>
Track entries and misses for each 32-byte serial flash cache line and expose per-line counters and ordered traces through cemu-headless. Finalize each trace before opening its replacement and report output failures when writing or closing a trace or profile. Allow a fixed cost per read to approximate pre-revision-M flash timing. Account for accesses and delay in fixed mode, and require cached timing for tracing and profiling. In the original KhiCAS run, cache misses consumed roughly 30% of the cycles. In simulation, a perfect layout removed about a quarter of those misses. Co-authored-by: Adrien Bertrand <bertrand.adrien@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Codex <codex@openai.com>
0d6fe82 to
5b829bf
Compare
|
Squashed minor fixes/improvements into the commits, it's cleaner. |
|
Merged, thanks! |
These are the emulator tools I used while speeding up FlowCE (a KhiCAS fork), rewritten for upstream. Three commits, each usable on its own:
peek,poke,keydown,keyup,regs,statsandlcd-dma. Read and write memory, hold a key while inspecting the calculator, see where a program is stuck (registers and IX frames), and read the cycle counters, flash cache misses included.DEBUG_CONSOLE_SUPPORT, prints the debug console without DEBUG_SUPPORT, sodbg_printfoutput can reach cemu-headless and the autotester (on stderr). It is off by default (a commented-out line in core/Makefile, like DEBUG_SUPPORT), so other consumers of the core are unaffected, as calc84maniac suggested.line-profile), an ordered trace of the lines entered for cache simulations (line-trace), andflash-cycles <n>to approximate pre-revision-M flash timing with a revision M ROM.Everything is documented in headless_protocol.md. Tested on Linux with a TI-84 Plus CE ROM: each command on a running program; the line profile and the trace agree (same number of line entries);
flash-cycles 10makes a KhiCAS computation about 2.4 times slower;dbg_printfoutput appears on stderr when the core is built with-DDEBUG_CONSOLE_SUPPORT, and not without it.For what it's worth, on KhiCAS cache misses were about 30% of the cycles, but a cache simulation of its trace showed that even a perfect code layout would remove only about a quarter of them.
Assisted by Claude code (plz don't discriminate just trying to help ;)