Commit 8aef409
acid: timing perf counters + per-test perf delta + first timing/IRQ tests
Builds out the acid framework along the lines requested: comprehensive
test categories, perf data capture wired into the runner, first real
tests against timing & IRQ delivery (the categories most likely to
explain the Doom 2x speed regression in issue #131).
Core instrumentation
--------------------
Five new PERF_COUNTERs at the timing-critical hot paths so any test
or `make benchmark` run can see how often things actually fire (no
runtime cost unless built with BENCH_PROFILE=1):
* `timing_jaguar_execute_calls` -- once per `retro_run()`
* `timing_halfline_callbacks` -- 525 per frame on NTSC
* `timing_vblank_irqs` -- 1 per frame
* `timing_jerry_irqs` -- JERRY PIT timer 1/2 to 68K
* `timing_gpu_irqs_to_68k` -- TOM PIT to 68K
Verified against headless Doom benchmark: halflines = 524 * frames
exactly; vblank_irqs ~= frames; everything within spec. These
counters will surface any future regression where (e.g.) vblank
fires twice per frame -- which is the leading hypothesis for the
Doom 1.5-2x bug.
Acid runner: per-test perf summary
----------------------------------
`test/acid/run.c` now snapshots a fixed set of perf counters before
and after each test's frame run and prints the delta, e.g.:
[PASS ] tests/timing/vc_per_frame.jag
perf: timing_jaguar_execute_calls=600 timing_halfline_callbacks=314400
That lets reviewers see at a glance what each test exercised --
useful for catching tests that PASS while doing nothing, and for
attributing a slow blitter test to the right counter (calls vs
inner-iter vs phrase-write).
Top-level `make acid` now forces BENCH_PROFILE=1 + TEST_EXPORTS=1
so the runner's `dlsym(perf_counters_find)` always works.
First real tests
----------------
* `tests/timing/vc_advance.s` [PASS] -- VC counter must change
* `tests/timing/vc_per_frame.s` [PASS] -- VC sweeps once per frame
* `tests/irq/vblank_delivery.s` [NOT-RUN-YET] -- VBlank IRQ raises
in TOM (counter ticks) but our 68K vector-64 patch never fires.
Real bug surface, exactly the kind of thing this suite is meant
to catch. Left checked in as a known-broken regression gate.
Documentation
-------------
* `test/acid/README.md` rewritten as a long-form roadmap covering
all 13 planned categories (smoke, timing, irq, blitter, op, gpu,
dsp, bus, hle, memory, quirks, stress, perf), with status
matrix, per-test perf-summary docs, vasm install steps for the
prb28/vasm GitHub mirror, and explicit cross-references to
Shamus' original `docs/TODO` items per category.
* `docs/emulation-bug-hunt-todos.md` gains a final section that
lists the still-open accuracy items from the upstream `docs/TODO`
(VC behaviour, cycle accuracy, blitter A1<->A2 propagation, bus
contention, OP timing) and maps each to its acid-test home.
The original `docs/TODO` is left untouched per user direction --
it's the historical record.
Status: 3 / 5 tests passing. The 2 NOT-RUN-YET cases are real
emulator bugs, surfaced (not introduced) by this work.
Co-Authored-By: Claude Opus 4.7 <[email protected]>1 parent 1950680 commit 8aef409
10 files changed
Lines changed: 737 additions & 110 deletions
File tree
- docs
- src
- core
- jerry
- tom
- test/acid
- tests
- irq
- timing
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
909 | 909 | | |
910 | 910 | | |
911 | 911 | | |
912 | | - | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
913 | 918 | | |
914 | 919 | | |
915 | 920 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
36 | 47 | | |
37 | 48 | | |
38 | 49 | | |
| |||
694 | 705 | | |
695 | 706 | | |
696 | 707 | | |
697 | | - | |
| 708 | + | |
| 709 | + | |
698 | 710 | | |
699 | 711 | | |
700 | 712 | | |
| |||
712 | 724 | | |
713 | 725 | | |
714 | 726 | | |
| 727 | + | |
| 728 | + | |
715 | 729 | | |
| 730 | + | |
716 | 731 | | |
717 | 732 | | |
718 | 733 | | |
| |||
934 | 949 | | |
935 | 950 | | |
936 | 951 | | |
| 952 | + | |
937 | 953 | | |
938 | 954 | | |
939 | 955 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
165 | 168 | | |
166 | 169 | | |
167 | 170 | | |
| |||
250 | 253 | | |
251 | 254 | | |
252 | 255 | | |
| 256 | + | |
253 | 257 | | |
254 | 258 | | |
255 | 259 | | |
| |||
266 | 270 | | |
267 | 271 | | |
268 | 272 | | |
| 273 | + | |
269 | 274 | | |
270 | 275 | | |
271 | 276 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| 265 | + | |
265 | 266 | | |
266 | 267 | | |
| 268 | + | |
| 269 | + | |
267 | 270 | | |
268 | 271 | | |
269 | 272 | | |
| |||
1316 | 1319 | | |
1317 | 1320 | | |
1318 | 1321 | | |
| 1322 | + | |
| 1323 | + | |
1319 | 1324 | | |
| 1325 | + | |
1320 | 1326 | | |
1321 | 1327 | | |
1322 | 1328 | | |
| |||
1329 | 1335 | | |
1330 | 1336 | | |
1331 | 1337 | | |
| 1338 | + | |
| 1339 | + | |
1332 | 1340 | | |
| 1341 | + | |
1333 | 1342 | | |
1334 | 1343 | | |
1335 | 1344 | | |
| |||
0 commit comments