diff --git a/.agents/skills/opera-test-harness/SKILL.md b/.agents/skills/opera-test-harness/SKILL.md index 1eb09cc..094004f 100644 --- a/.agents/skills/opera-test-harness/SKILL.md +++ b/.agents/skills/opera-test-harness/SKILL.md @@ -1,6 +1,6 @@ --- name: opera-test-harness -description: Use when running, automating, or debugging the 3DO libretro "opera" core with the test-harness binary, including terminal mode, controls, BIOS/core defaults, screenshots, ROMs, scripted input, and benchmarks. +description: Use when running, automating, or debugging the 3DO libretro "opera" core with the opera-test-harness binary, including terminal mode, controls, BIOS/core defaults, screenshots, ROMs, scripted input, and benchmarks. --- # opera-test-harness @@ -16,7 +16,7 @@ Trigger when: - User asks to "run the core", "test the core", "boot a 3DO disc", "capture a screenshot" of a 3DO game, or "benchmark" the core. -- User mentions `test-harness`, `test_harness.c`, "test harness" or +- User mentions `opera-test-harness`, `test_harness.c`, "test harness" or headless core testing. - User asks to script button presses or compare runs against a baseline. @@ -26,7 +26,7 @@ Trigger when: From the repo root: ```sh -make harness # builds ./test-harness +make harness # builds ./opera-test-harness ``` The harness always compiles the vendored zlib encoder used by Kitty @@ -36,20 +36,20 @@ graphics. It also depends on `tools/stb_image_write.h` and links ## BIOS If `--core` is omitted, the harness looks for `opera_libretro.so` -beside the `test-harness` executable. If `--bios` is omitted, it -prefers `panafz1.bin` beside `test-harness`, then falls back to +beside the `opera-test-harness` executable. If `--bios` is omitted, it +prefers `panafz1.bin` beside `opera-test-harness`, then falls back to filename search. `--bios` accepts either a real path or a bare filename listed in `BIOS_ROMS[]` (`tools/test_harness.c`). Bare filenames are searched -beside `test-harness`, then in RetroArch system dirs +beside `opera-test-harness`, then in RetroArch system dirs (`RETROARCH_ROM_DIRS[]`). Use `--list-bios` to print recognized BIOS ROMs and any resolved local paths. ## Canonical invocation ```sh -./test-harness \ +./opera-test-harness \ --core ./opera_libretro.so \ --bios /path/to/panafz1.bin \ --title "/path/to/Game (USA).bin" \ @@ -62,7 +62,7 @@ ROMs and any resolved local paths. ``` `--core` and `--bios` are optional when the defaults are available -beside `test-harness` or in the configured BIOS search +beside `opera-test-harness` or in the configured BIOS search paths. Everything else is optional. ## Key flags @@ -135,7 +135,7 @@ Examples: Example: ```sh -./test-harness --core ./opera_libretro.so --bios panafz1.bin \ +./opera-test-harness --core ./opera_libretro.so --bios panafz1.bin \ --title /path/to/game.cue --frames 600 --wall-timeout 30 \ --option opera_random_seed=0xdeadbeef ``` @@ -207,7 +207,7 @@ Terminal implementation notes: - `124` — `timeout`: `--wall-timeout` fired. - `128+signal` — terminated by a handled process signal after cleanup. -The terse stderr line is `test-harness: , frames=N, log=..., +The terse stderr line is `opera-test-harness: , frames=N, log=..., metrics=...`. Full detail lives in `metrics.json` under `status`, `exit_code`, `frames_run`, `average_fps`, `speed_multiplier`, `input_events[]`, `log_counts`, etc. @@ -216,7 +216,7 @@ metrics=...`. Full detail lives in `metrics.json` under `status`, ### Boot-to-title screenshot ```sh -./test-harness --core ./opera_libretro.so --bios panafz1.bin \ +./opera-test-harness --core ./opera_libretro.so --bios panafz1.bin \ --title "/path/to/Game.cue" --seconds 10 \ --screenshot /tmp/title.png --wall-timeout 30 ``` @@ -234,14 +234,14 @@ Write a `inputs.txt` with one event per line and comments: ``` Then: ```sh -./test-harness --core ... --bios ... --title ... \ +./opera-test-harness --core ... --bios ... --title ... \ --frames 2400 --input-file inputs.txt \ --screenshot-every 300=/tmp/frames --wall-timeout 60 ``` ### Multiple capture points plus contact sheet ```sh -./test-harness --core ... --bios ... --title ... \ +./opera-test-harness --core ... --bios ... --title ... \ --frames 600 \ --screenshot-at 60=/tmp/01.png \ --screenshot-at 600=/tmp/end.png \ @@ -251,7 +251,7 @@ Then: ### Regression / benchmarking Pin a stable frame window so rebuilds can be compared apples-to-apples: ```sh -./test-harness --core ... --bios ... --title ... \ +./opera-test-harness --core ... --bios ... --title ... \ --frames 1800 \ --benchmark-start-frame 600 --benchmark-end-frame 1800 \ --cpu 2 --wall-timeout 120 \ @@ -286,6 +286,6 @@ the stable comparison numbers. - **GPU threads are pinned with `--cpu`,** which also sets affinity for any threads the core spawns. - **Run artifacts go under `--output-dir`** (default - `./test-harness-runs//`); the temp `work/` + `./opera-test-harness-runs//`); the temp `work/` subdir (system + save) is removed unless `--keep-work-dir` or `--work-dir` is set. diff --git a/.gitignore b/.gitignore index 50612a8..af6c48f 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,6 @@ *.a /test-harness /test-harness-runs/ +/opera-test-harness +/opera-test-harness-runs/ .vscode/pro-deployer.json diff --git a/Makefile b/Makefile index fe3b9db..ab566b4 100644 --- a/Makefile +++ b/Makefile @@ -643,7 +643,7 @@ endif %.o: %.c $(CC) -c $(OBJOUT)$@ $< $(CFLAGS) -HARNESS_TARGET := test-harness +HARNESS_TARGET := opera-test-harness HARNESS_ZLIB_DIR := $(DEPS_DIR)/zlib-1.3.1.2 HARNESS_ZLIB_CFLAGS := -I$(HARNESS_ZLIB_DIR) HARNESS_ZLIB_SOURCES := \ diff --git a/tools/test_harness.c b/tools/test_harness.c index a9049bb..af30b51 100644 --- a/tools/test_harness.c +++ b/tools/test_harness.c @@ -556,13 +556,13 @@ void _print_usage(FILE *f_) { fprintf(f_, - "Usage: test-harness [--core ./opera_libretro.so] [--bios /path/to/bios.bin] [options]\n" + "Usage: opera-test-harness [--core ./opera_libretro.so] [--bios /path/to/bios.bin] [options]\n" "\n" "Core and BIOS:\n" " --core PATH libretro core shared object to load; default\n" - " opera_libretro.so beside test-harness\n" + " opera_libretro.so beside opera-test-harness\n" " --bios PATH recognized 3DO BIOS ROM; default panafz1.bin\n" - " beside test-harness, then filename search\n" + " beside opera-test-harness, then filename search\n" "\n" "Content and duration:\n" " --title PATH optional iso/bin/chd/cue title path\n" @@ -586,7 +586,7 @@ _print_usage(FILE *f_) " (default 6)\n" "\n" "Artifacts:\n" - " --output-dir DIR default ./test-harness-runs/\n" + " --output-dir DIR default ./opera-test-harness-runs/\n" " --log PATH default /run.log\n" " --metrics PATH default /metrics.json\n" " --audio PATH write stereo s16le WAV\n" @@ -2045,13 +2045,13 @@ _default_output_dir(void) strftime(stamp, sizeof(stamp), "%Y%m%d-%H%M%S", &tm_now); snprintf(leaf, sizeof(leaf), "%s-%ld", stamp, (long)getpid()); - if(_mkdir_p("test-harness-runs") != 0) + if(_mkdir_p("opera-test-harness-runs") != 0) { - perror("mkdir test-harness-runs"); + perror("mkdir opera-test-harness-runs"); exit(1); } - return _xasprintf2("test-harness-runs", leaf); + return _xasprintf2("opera-test-harness-runs", leaf); } @@ -2093,7 +2093,7 @@ _prepare_paths(void) fprintf(stderr, "unable to resolve BIOS path: %s\n", g_cfg.bios_path); else fprintf(stderr, - "unable to find BIOS file %s beside test-harness, " + "unable to find BIOS file %s beside opera-test-harness, " "in the current directory, or common RetroArch " "system directories\n", g_cfg.bios_path); @@ -8975,7 +8975,7 @@ main(int argc_, if(exit_code == 0) { fprintf(stderr, - "test-harness: ok, frames=%" PRIu64 + "opera-test-harness: ok, frames=%" PRIu64 ", elapsed=%.3fs, fps=%.2f, log=%s, metrics=%s\n", g_run.frames_run, g_run.wall_seconds, @@ -8986,7 +8986,7 @@ main(int argc_, else { fprintf(stderr, - "test-harness: %s, frames=%" PRIu64 + "opera-test-harness: %s, frames=%" PRIu64 ", elapsed=%.3fs, fps=%.2f, log=%s, metrics=%s\n", status, g_run.frames_run,