# Integration tests and their assets

`cargo test` runs the unit suite and fast integration tests without external
assets. Slow optimized-only tests, including probe goldens and save-state
round trips, are reported as **ignored** in debug builds. Run them with
`cargo test --profile ci --locked` or `cargo test --release`; explicitly
forcing them with debug `--ignored` fails with an optimized-build instruction.

Tests requiring local Kickstart ROMs or disk images remain `#[ignore]`d.
In `image_regression.rs`, explicitly selecting a test now **fails** if its
required assets are absent. The live-audio test also requires
`COPPERLINE_LIVE_AUDIO_ACCEPTANCE=1` and a working audio device. Older
asset-backed suites still contain skip-as-pass checks; an ignored test or a
missing-asset message is not evidence that its scenario was exercised.

Run a selected image regression once its assets are installed:

```sh
cargo test --release --test image_regression kickstart_boot_screen -- --ignored --nocapture
```

`tests/debugger_security.rs` runs in the default suite without external
assets. It checks GDB/DAP remote-listener rejection, explicit GDB/TCP DAP
opt-in, and control authentication through temporary info files while
asserting that tokens never appear in process logs. Child processes have
20-second deadlines and are killed on test failure.

## Contributor regression workflow

CPU dependency updates also run the standalone
[CPU conformance gate](../crates/cputest-runner/README.md). Root `cargo test`
does not execute that crate or the dependency's own tests. The gate needs no
Amiga ROMs/disks and covers a fixed instruction subset on 68020/030/040/060,
MMU translation and fault frames, and native JIT versus interpreter behaviour.

The fast gate for a CPU, memory, bus, IRQ, or chipset change is:

```sh
cargo test
cargo build --release
cargo test --release --test probe_golden
cargo fmt --all --check
cargo clippy --all-targets --all-features --locked -- -D warnings
git diff --check
```

CI uses `cargo test --profile ci --locked` for the native suites. This
release-derived profile keeps optimization level 3 and disables debug
assertions and overflow checks, but turns off LTO and uses 16 codegen units
to avoid repeating expensive whole-program optimization for every test
executable. It builds the emulator too, so no preceding `cargo build` is
needed. Outputs live in `target/ci/` (or `target/<triple>/ci/` with
`--target`). Packaged binaries and performance benchmarks still use
`--release` and its fat LTO. Linux retains Cargo's artifact paths from the
full suite and directly reuses those executables for the extra ignored
audio and network checks, avoiding further build-script runs and recompiles.
macOS and both Windows architectures stage and run every integration test
target too; asset-backed tests remain ignored. Probe goldens run in separate
jobs. Audio-stem determinism runs explicitly on all three host platforms.
Native CI jobs have wall-clock limits; golden captures time out after 120 s,
and image-regression subprocesses after 300 s, killing and reaping a stalled
emulator while retaining its output.

The standard desktop suite includes the shared inspector's egui tests; no extra
feature flag, GPU, or display is needed. The macOS **Inspector UI tests** step
runs them from the prebuilt library test executable and checks that the suite
is present. Run just those tests locally with:

```sh
cargo test --locked --lib video::window::egui_debugger::
```

GPU preview renders remain ignored; see the
[video internals](../docs/internals/video.md) for their commands.

The native CI builders publish `cargo-timings-*` artifacts from `--timings`
for seven days. To inspect build costs locally, add `--timings` and open
`target/cargo-timings/cargo-timing.html`. CI and packaging use distinct
cache keys because an explicit `--target` build cannot populate the native
build's output directory. These Rust caches are saved only on `main` and
restored by pull requests. This avoids filling the repository cache budget
with copies scoped to individual PRs, which cannot be reused by other PRs.
New dependency/profile combinations first populate the shared cache after
merging; until then, a PR may need a cold build.

The golden renders live under `timing-test/golden/`. A hardware-model change
that intentionally alters one must name that probe when blessing it:
`COPPERLINE_BLESS_GOLDEN=ddfprobe cargo test --release --test probe_golden golden_ddfprobe -- --exact`.
Only the named golden is replaced; a bare `1` or an unknown name fails.
Review each render difference as part of the change. CI also reassembles
all tracked timing-test binaries with pinned vasm 2.0b and checks their bytes;
run `python3 tools/check-probe-binaries.py --vasm /path/to/vasmm68k_mot` locally. Run the ignored image
suite above when the required local assets are available, followed by any
subsystem-specific private smoke configurations.

Promote a repeated manual smoke path into a focused unit test, an ignored
image regression, or a deterministic input script. Completed investigations
belong in commits and PR descriptions rather than a permanent done-log.

### Parser fuzz regressions

`cargo test --test fuzz_regressions` runs retained inputs through all nine
parser harnesses on stable Rust, with no guest assets. `control` and `dap`
enable their corresponding cases. The shared harnesses live in
`fuzz/harnesses/`; the integration test and libFuzzer call the same code.
The [retention workflow](fuzz-regressions/README.md) explains how to promote
a minimized campaign crash into a committed regression. Initial synthetic
boundary inputs keep every replay path exercised before a campaign finds
a defect. See [fuzz/README.md](../fuzz/README.md) for campaign commands,
limits and artifact retention.

### Hostfs boot round trips

`hostfs_boot_aros_runs_a_guest_binary_and_writes_to_the_host` needs **no
local assets at all** (the bundled AROS ROM boots the mount), so it runs on
any checkout; `hostfs_boot_kick13_runs_a_guest_binary_and_writes_to_the_host` additionally
covers Kickstart 1.3's V34 boot path when a local `KICK13.ROM` is present.
Both boot a shell from a `[[filesys]]` host-directory mount, type `mkfile`
into it (the committed guest probe from `guest/hostfs-test/`), and assert
the file the probe creates arrives on the host side -- autoboot, handler
startup, LoadSeg off the volume, and a write back through it, end to end.

### Clipboard sharing

`clipboard_text_crosses_both_ways_under_aros` (`tests/clipboard.rs`) boots
the bundled AROS ROM but needs one asset: a guest `clipboard.device`,
which is disk-based on AROS as on Kickstart (the ROM carries none). Point
`COPPERLINE_CLIPBOARD_DEVICE` at one, or put it in the asset directory as
`clipboard.device` or `Devs/clipboard.device` (the `Devs` drawer of any
Workbench 2.0+ or AROS distribution has it); the test skips otherwise. It
`--run`s the committed `guest/clipboard-test/` probe with `--clipboard`
and a headless control server; the probe installs the device into
`DEVS:`, posts an FTXT clip, which the services ROM's bridge pushes and
the test reads back through `clipboard.get`, then the test stages a reply
with `clipboard.set` and asserts the probe wrote the text it found in
`clipboard.device` into its host directory -- the whole register protocol
against the real guest ROM code, both ways.

### ATAPI CD-ROM firmware compatibility

`tests/atapi_cd.rs` boots a `[lide]` Zorro II IDE board with LIV2's real
`cdfs.rom` filesystem driver against a genuine ISO9660 image on the ATAPI
slave slot, and checks the emulator's own diagnostic log for the real
driver's expected probe sequence (IDENTIFY DEVICE aborts on the ATAPI slot,
IDENTIFY PACKET DEVICE succeeds, PACKET data-in transfers follow) -- a
firmware-compatibility check that a synthetic-host unit test cannot give,
since it exercises Copperline's ATAPI protocol implementation against real
third-party driver code rather than against our own assumptions about it.
No bundled Amiga OS ships ATAPI support in its stock drivers, so this cannot
be a "guest mounts the CD" test without also bundling a period driver as an
asset; `cdfs.rom` is exactly that. Needs a
local `lide.rom`, `cdfs.rom`, and a bootable hard-disk image under
`test-assets/lide/`, plus a host ISO-authoring tool (`hdiutil` on macOS,
`genisoimage`/`mkisofs` elsewhere); skips cleanly without any of these. The
protocol contract itself (chunked PIO, interrupt-reason register,
error/sense mapping, mixed disk+ATAPI buses) is covered without assets by
the unit tests in `src/ata.rs`.

### Open A2091 ROM autoboot

`tests/a2091_boot.rs` fits the bundled clean-room A2091/A590 ROM in three
end-to-end boots. The asset-free AROS case boots a directory-built FFS volume;
the Kickstart 1.3 case boots an OFS volume and needs `KICK13.ROM`; the Kickstart
3.1 case boots a real RDB Workbench image through the WD33C93/DMAC path and
needs `KICK31.ROM` plus `AmigaSYS3PlusAGA-rdb.hdf`. Put those files in
`test-assets/` or `COPPERLINE_A2091_TEST_ASSETS`; asset-backed cases skip
cleanly when their inputs are absent. The 3.1 test asserts a non-blank desktop
and a diagnostic trace containing DMAC starts, 24-bit addresses, and delivered
INT2 status. Run all available cases with:

```sh
cargo test --release --test a2091_boot -- --ignored --nocapture
```

`tests/a2091_dma.rs` runs the committed `guest/a2091-test/` probe against
private raw-disk fixtures. It checks Fast/Chip bounce allocation, overlapping
read buffers, large reads and writes, unaligned copies, SCSI-direct residuals,
partial failures, recovery, and buffer release. A Unix-only sparse-disk case
also reads across the 32-bit LBA boundary through `TD_READ64`. The AROS cases
need no local assets; the 1.3 and 3.1 cases use the same Kickstart lookup as the boot tests.

```sh
cargo test --release --test a2091_dma -- --ignored --nocapture
```

`tests/scsi_tape.rs` runs the committed `guest/tape-test/` probe against a
`[[tape]]` drive: the guest opens `scsi.device` unit 4 and drives it with
SCSI Direct (fixed- and variable-block reads and writes, filemarks, SPACE,
LOAD/UNLOAD, ERASE), checking each status and its autosense data, and the
test then reads the tape files left in the cartridge directory. The A2091
case needs no assets (bundled AROS and A2091 ROMs) and runs in the
optimized suite. The A3000 case repeats it through Commodore's own
`scsi.device` and needs `kicka3000.rom` in the asset directory:

```sh
cargo test --release --test scsi_tape
cargo test --release --test scsi_tape -- --ignored --nocapture
```

`tests/hd_timing.rs` runs the committed `guest/hdbench/` benchmark (sequential
reads at 512 B to 256 KiB, random 4 KiB reads, a 256 KiB write, all timed with
the E-clock) through the machine's own disk driver on a private 16 MiB disk,
and checks each drive profile's pace (`timing`, `docs/guide/configuration.md`
"Drive timing"). The A2091 cases run under the bundled AROS ROM with no local
assets and include a determinism rerun; the A1200 and A4000 IDE cases need
`Kickstart v3.1 r40.68 (1993)(Commodore)(A1200)[!].rom` and
`Kickstart v3.1 r40.68 (1993)(Commodore)(A4000).rom`, and the A4000 one checks
the Seagate ST3144A against the period ScsiSpeed figures.

```sh
cargo test --release --test hd_timing -- --ignored --nocapture
```

### Open CD32 FMV ROM

`tests/cd32_fmv_aros.rs` contains two Cannon Fodder paths. The AROS case uses
an AROS ROM pair carrying the merged PR 1089 (CDXL-ordering commit `64eb7ed1`;
the bundled `assets/aros` pair qualifies); the Kickstart case uses the
replacement ROM's own `cd32mpeg.device` and standard Mode-2 reader. Both assert sustained
MPEG decoding without malformed-stream recovery, full-colour 60-second
output, and non-silent stereo. The media and proprietary Kickstart remain
local; run both with:

```sh
COPPERLINE_FMV_AROS_DIR=/path/to/patched-aros-roms \
COPPERLINE_FMV_ROM=/path/to/copperline-fmv.rom \
COPPERLINE_FMV_CANNON_FODDER_CUE=/path/to/Cannon-Fodder.cue \
COPPERLINE_FMV_KICKSTART_ROM=/path/to/cd32-kickstart.rom \
COPPERLINE_FMV_KICKSTART_EXT_ROM=/path/to/cd32-extended.rom \
cargo test --release --test cd32_fmv_aros -- --ignored --nocapture
```

`tests/cd32_videocd.rs` has two CD32 Kickstart real-media regressions. The
first boots the committed guest probe, opens the cartridge's
`videocd.library` by its public LVO table, and checks the Philips Media Retail
Sampler '95 metadata. The second cold-boots the same disc into the player,
presses Red, checks sustained 352x240 decoding, presses Blue, and verifies the
menu returns. Build and bundle the ROM plus the probe first, then run:

```sh
COPPERLINE_FMV_ROM=/path/to/copperline-fmv.rom \
COPPERLINE_FMV_VIDEOCD_CUE=/path/to/Philips-Sampler.cue \
COPPERLINE_FMV_KICKSTART_ROM=/path/to/cd32-kickstart.rom \
COPPERLINE_FMV_KICKSTART_EXT_ROM=/path/to/cd32-extended.rom \
cargo test --release --test cd32_videocd -- --ignored --nocapture
```

### Modem end to end

`tests/modem_e2e.rs` closes the one gap `src/modem/`'s exhaustive unit
suite (a fake transport) cannot: the real hardware path between the AT
state machine and a guest -- Paula's SERPER-paced UART, the CIA-B
control-line overlay, and a real `serial.device` actually driving them. It
boots from a `[[filesys]]` mount holding the committed guest probe
(`guest/modem-test/modemtest`, built like `guest/hostfs-test`'s), lets a
real Startup-Sequence run it, and asserts the transcript it writes back:
`ATZ` answered `OK`, `ATDT` dialling a one-shot local TCP peer this test
spins up on an ephemeral port, `CONNECT`, the peer's greeting arriving at
the guest, and the guest's own line arriving at the peer.

Unlike the hostfs tests above, this one cannot use the bundled AROS ROM:
`serial.device` is not ROM-resident on real AmigaOS either (Kickstart
2.0+ loads it from `DEVS:serial.device` on demand via `LoadSeg` the first
time something opens it), and the bundled AROS build carries no
`serial.device` at all, ROM-resident or otherwise. It needs a local
Kickstart ROM (`KICK31.ROM`, anywhere in the asset directory or the repo
root) and a real `Devs/serial.device` driver file at
`test-assets/modem/Devs/serial.device` (copy one out of any Workbench
2.0+ install), and skips cleanly without either.

### WHDLoad boot

`tests/whdload_boot.rs` boots the committed, project-owned
`tests/assets/whdload/TestGame.lha` fixture through the full WHDLoad path
(`--whdload` staging, hostfs boot, the real WHDLoad binary handing control
to the fixture slave) and asserts the slave's solid-colour frame. It needs
the fetched support archives (`tools/fetch-whdload.sh` populates
`assets/whdboot/`) and a Kickstart 3.1 (40.068 A1200) image anywhere in the
asset directory -- identification is by content, the filename does not
matter -- and skips cleanly without either.

### copperhf.device integration matrix

`COPPERHF-DEVICE-PLAN.md`'s M6 splits the {RDB, RDB-less} x {OFS,
FFS-from-LSEG, PFS3-DS >4 GiB} x {Kickstart 1.3, 3.1, 3.2} matrix across two
files, alongside the earlier `tests/copperhf_device.rs` (M2),
`tests/copperhf_m4_guest.rs` (M4), `tests/copperhf_mounter.rs`/
`tests/copperhf_m5.rs` (M3/M5) suites, all of which need no local assets:

- `tests/copperhf_m6.rs` (default CI, no assets) --
  `lseg_filesystem_loads_into_filesystem_resource` builds a hand-crafted
  RDB (RDSK + PART + FSHD + LSEG chain) around
  `guest/copperhf-test/lsegfix` -- a tiny, self-checking three-hunk
  fixture binary (generated by the adjacent `gen_lsegfix.py`; its own
  header comment documents the exact byte layout, including a
  deliberately truncated hunk and an odd-word `HUNK_RELOC32SHORT`
  padding case) -- and drives `guest/copperhf-test/chftest_m6` (built by
  `guest/copperhf-test/Makefile`) over `--run` to verify `guest/copperhf/
  mounter.c`'s FSHD/LSEG loader end to end: the `FileSystem.resource`
  entry it creates, the loaded seglist's chain length, actually calling
  the seglist's entry point (the relocation self-test), and the mounted
  `DeviceNode`'s patched `SegList`/`GlobalVec` fields. This is the
  default-CI stand-in for the FFS-from-LSEG axis -- a synthetic fixture,
  not a real filesystem binary, so no licensed asset is needed.
- `tests/copperhf_kickstarts.rs` (`#[ignore]`d, real ROM assets) -- the
  matrix against actual Kickstart 1.3/3.1/3.2:
  - **Plain OFS**, {RDB, RDB-less}, one test per ROM. 3.1/3.2 (the ROM
    shell has `Echo` built in from Kickstart 2.0 on) reuse
    `tests/copperhf_mounter.rs`'s exact bootmark-file trick: a
    Startup-Sequence that echoes a marker string to `SYS:bootmark`,
    verified by walking the mounted volume's own directory structure
    afterwards (not a raw byte search -- see that file's header comment
    for why a byte search would be a false positive). Machine shape:
    A1200/AGA for 3.1 and 3.2, matching `tests/image_regression.rs`'s own
    KICK31 config. **1.3 has no ROM-resident `Echo`** (disk-based `C:`
    commands only, and this fixture carries none), so it is verified
    instead by an exact-byte golden screenshot
    (`tests/golden/copperhf/*.png`; set `COPPERLINE_BLESS_GOLDEN` to one
    golden's file stem to (re)generate that one) of the CLI prompt an *empty* Startup-Sequence leaves
    open on the mounted volume -- weaker than a structural marker check,
    but the only option that stages no extra binary onto the volume;
    machine shape matches `tests/image_regression.rs`'s own KICK13
    config (A500-shaped OCS/68000, no `[machine]` override needed). This
    exercises the V34 `AddDosNode`/`eb_MountList` fallback path in
    `guest/copperhf/mounter.c`.
  - **FFS-from-LSEG**, Kickstart 3.1 plus a bundled-AROS variant
    (`aros_ffs_from_lseg_...`, still `#[ignore]`d for the FastFileSystem
    asset but needing no ROM -- AROS's dos.library starting a real
    Commodore FFS through the FSHD/LSEG chain is its own compatibility
    data point). The 3.1 row is the gate (`COPPERHF-DEVICE-
    PLAN.md` actually asks for). Needs `test-assets/copperhf/
    FastFileSystem`, a real FastFileSystem binary. Design note: Kickstart
    3.1's ROM already has DOS\0 (OFS) and DOS\1 (FFS) resident in
    `FileSystem.resource`, so tagging the partition/FSHD DOS\1 would make
    `guest/copperhf/mounter.c`'s own "already resident, skip the LSEG
    load" check (see its header comment) short-circuit the very path this
    test means to exercise. DOS\3 (FFS + international mode) is *not*
    ROM-resident on 3.1 -- the entire reason FastFileSystem replacement
    binaries existed on real Workbench 3.1 disks -- so the partition and
    FSHD are both tagged DOS\3 instead, which forces the mounter to
    actually load and run the real binary. The DOS\3 on-disk block
    layout is identical to plain FFS (only filename hashing differs, and
    this fixture's filenames are all plain ASCII), and `src/dirfs.rs::
    build_image` already supports building it directly via
    `FileSystem { ffs: true, variant: Variant::Intl }` -- no bespoke FFS
    emitter was needed. Verified the same bootmark way as the OFS axis.
  - **FFS-from-LSEG on Kickstart 1.3** (`kick13_ffs_from_lseg_boots_without_crashing`,
    needs `KICK13.ROM` plus `test-assets/lide/wb13/Workbench1.3/l/
    FastFileSystem`) -- currently **passes**. Unlike 3.1, Kickstart 1.3 has
    no ROM-resident FFS at all (not even DOS\1), so a real 1.3 FFS hard
    disk always loaded its handler off the RDB -- exactly this path,
    tagged plain DOS\1 (no DOS\3 trick needed, since nothing on 1.3
    short-circuits it). Verified by `assert_not_guru` (a screenshot
    pixel-colour check for the Guru Meditation screen's distinctive red) and
    `assert_golden` against the committed golden render
    `tests/golden/copperhf/kick13_ffs_from_lseg_boots_without_crashing.png`.

    **Investigation history (2026-09-14), kept for anyone who hits this
    again**: this test originally used `test-assets/copperhf/
    FastFileSystem` (the modern/community `$VER: fs 46.13 (23.9.2018)`
    release the Kickstart 3.1 FFS-from-LSEG case above uses), following a
    real user crash report on Kickstart 1.3. That combination reliably
    took a Guru Meditation partway through mounting DH0. Traced
    (instruction-level `COPPERLINE_DBG_WATCH`/`COPPERLINE_DBG_TRACE`,
    `docs/debugger/headless.md`) to exec.library's own jump table (just
    behind SysBase, e.g. the `Permit()` LVO slot) getting overwritten with
    unrelated data around the time that binary starts running as DH0's
    handler process, crashing on the next call through the clobbered
    vector -- entirely inside real, unmodified Kickstart ROM code doing
    what looks like exec's own internal InitResident()/MakeLibrary()
    machinery, not `guest/copperhf/mounter.c`'s own code (already handed
    off by that point; its hunk-loader/relocation code
    (`chf_load_lseg_chain`) was re-audited against this finding and looks
    correct).

    **Root cause CONFIRMED, not a copperhf.device or Copperline bug**: the
    46.13 binary links `utility.library` (per `strings` on the binary) --
    a Kickstart 2.0+ (V36+) component Kickstart 1.3 (V34) never shipped at
    all. Confirmed by A/B test: swapping in the genuinely period-correct
    `test-assets/lide/wb13/Workbench1.3/l/FastFileSystem` (`$VER: V34.85
    (8/10/88)` -- the matching V34 designation, and no `utility.library`
    in its much shorter dependency list) makes the identical mount
    sequence complete cleanly every time, with no code changes anywhere.
    A real Amiga 500 running 1.3 with a hard disk formatted by the modern
    46.13 binary would hit the exact same fault on real hardware -- this
    is a genuine binary/Kickstart version incompatibility, not an
    emulation defect. Lesson for any future "it crashed on Kickstart 1.3"
    report involving copperhf: check which FastFileSystem version the
    disk actually carries before assuming a Copperline bug -- many
    real-world disks get reformatted with whatever modern FFS shipped in
    someone's install media, regardless of which Kickstart they're
    actually paired with.
  - **PFS3-DS beyond 4 GiB**, Kickstart 3.1 plus a bundled-AROS variant
    (`aros_pfs3_...`, `#[ignore]`d for the pfs3aio asset only). Needs
    `test-assets/copperhf/pfs3aio`, the real PFS3 "all-in-one" binary.
    **Deliberately narrow scope**: this project has no host-side tool to
    *format* a PFS3 volume (`src/dirfs.rs` only ever implemented plain
    OFS/FFS, and PFS3's own `Format` is a Workbench-disk command this
    project does not carry as a test asset), so the test cannot stage a
    mounted, usable PFS3 volume the way the OFS/FFS-from-LSEG axes do.
    What it actually proves: a sparse (`File::set_len`) >4 GiB partition,
    tagged `PDS\3` and carrying the real `pfs3aio` binary through an
    FSHD/LSEG chain exactly like the FFS-from-LSEG axis, attached
    alongside an ordinary bootable OFS unit, does not crash, hang, or
    otherwise prevent Kickstart 3.1 from completing a normal boot --
    i.e. copperhf's TD64/NSD command path and >4 GiB sparse backing file
    survive a real `pfs3.handler` actually starting up and probing the
    unit. It does **not** assert `NDOS`/`PDS:` volume state and does
    **not** drive a `Format`. A fuller manual smoke test -- attach the
    same fixture to a real Workbench 3.1 install with PFS3 already set up
    from Prefs, `Format` the partition by hand, and confirm it mounts and
    is usable past the 4 GiB mark -- is the sturdier follow-up this
    automated test does not attempt; there is no tracked recipe for it
    yet since it needs a hand-prepared Workbench install, not just a
    dropped-in asset file.

  Each test skips cleanly when its required assets are absent. Required assets:

  | Asset | Used by |
  | --- | --- |
  | `KICK13.ROM` | the 1.3 OFS axes (golden-screenshot verified) and the 1.3 FFS-from-LSEG axis |
  | `KICK31.ROM` | the 3.1 OFS, FFS-from-LSEG, and PFS3 axes |
  | `KICK32.ROM` | the 3.2 OFS axes |
  | `test-assets/copperhf/FastFileSystem` | the 3.1 FFS-from-LSEG axis |
  | `test-assets/lide/wb13/Workbench1.3/l/FastFileSystem` | the 1.3 FFS-from-LSEG axis (period-correct V34.85 binary; golden-screenshot verified) |
  | `test-assets/copperhf/pfs3aio` | the PFS3-DS >4 GiB axis |

  Run the whole file with:

  ```sh
  cargo test --release --test copperhf_kickstarts -- --ignored --nocapture
  ```

  Building `tests/copperhf_m6.rs` did exactly the job it exists to do:
  its first runs caught three real, previously-unexercised
  `guest/copperhf/mounter.c` bugs (forward-referencing relocations,
  odd-aligned FileSysStartupMsg after an even-length partition name,
  `ADNF_STARTPROC`/`ConfigDev` passed for non-bootable partitions), all
  fixed at the site there -- plus one fixture-design lesson worth
  keeping: AmigaDOS starts a mounted DeviceNode's `dn_SegList` as a real
  handler process on first reference, so the fixture implements a
  minimal DOS-packet loop and the probe verifies relocation correctness
  through `Lock("CHFM6:")`'s `IoErr()` rather than by calling the
  seglist raw (`guest/copperhf-test/gen_lsegfix.py` and `chftest_m6.c`
  document the mechanism).

### DiagROM smoke

DiagROM is the first asset-backed boot smoke before a Kickstart OS check:

```sh
./target/release/copperline --model A500 --noaudio \
  --screenshot-after 5 /tmp/diag.png /path/to/diagrom.rom
```

The run should produce serial diagnostics and a nonblank screenshot without
an unexpected CPU halt. On the current headless path the serial-enable prompt
appears around `t=14s`, times out around `t=18s`, and menu input is reliable
from `t=22s`. Useful DiagROM menu paths are `3`, `4`, `1` for the IRQ test and
`4`, `5`, then any key for the embedded graphics-test intro. Script these with
repeatable `--press-after` events rather than host-time input.

### Manual chipset regressions

These fixed regressions remain useful stress scenes when their underlying
hardware models change. The media and local configurations are private test
assets, never repository inputs or compatibility conditions:

- **Inside The Machine**: `18s` board sparks/electric effect; `60s` coherent
  tunnel runner rather than noise; `70s` face-light sprites clipped to the
  active window; `80s` Roto/HAM bottom rows without captured-row garbage;
  `90s` stable card traces; `127s` HAM torus/balls rather than vertical strips;
  and a falling-man handoff that has left the static figure for the next
  runner scene by `180s`. The `165s`/`180s` pair guards Copper frame reload,
  BLTPRI-clear CPU access, and the enabled-audio-DMA reservation window.
- **State of the Art**: dense hand/silhouette overlap should remain free of
  diagonal blitter edge-mask trails. Use it after changes to line mode,
  first/last-word masks, blitter completion, or bitplane capture.
- **Frontier**: retain stable output after bus, blitter, bitplane, or chipset
  timing changes.

Logs from these runs should not contain unexpected `halt`, exception, or
invalid-memory warnings unless the test deliberately exercises that path.

## Where the assets are looked up

In order:

1. `COPPERLINE_TEST_ASSETS=/path/to/dir` if set.
2. `test-assets/` under the repo root, if it exists.
3. The repo root itself (legacy fallback).

`test-assets/` and all ROM/disk extensions are gitignored, so assets placed
there cannot be committed by accident. The example config stays in the repo;
the emulator is run with its working directory set to the asset directory,
and a config's relative `rom`/disk paths resolve there.

## What each test needs

The validation is property-based (region colour counts, distinct-colour
bounds, noise detection, perf budgets) -- there are **no committed reference
images**, so nothing copyrighted is stored and there are no brittle
baselines to maintain.

| Test | Assets (exact filenames) |
| --- | --- |
| `kickstart_boot_screen_has_expected_structure` | `kickstart205.rom` |
| `reset_dsksync_boot_regression_reaches_boot_display` | `KICK13.ROM` |
| `hostfs_boot_aros_runs_a_guest_binary_and_writes_to_the_host` | *(none)* |
| `hostfs_boot_kick13_runs_a_guest_binary_and_writes_to_the_host` | `KICK13.ROM` |
| `clipboard_text_crosses_both_ways_under_aros` | `clipboard.device` (or `Devs/clipboard.device`; `COPPERLINE_CLIPBOARD_DEVICE` overrides) |
| `cannon_fodder_streams_cleanly_through_the_aros_open_rom` | AROS main/ext ROMs with PR 1089 merged (the bundled pair qualifies), generated `copperline-fmv.rom`, Cannon Fodder CUE and tracks |
| `cannon_fodder_streams_cleanly_through_the_standalone_kickstart_rom` | CD32 Kickstart 3.1 main/ext ROMs, generated `copperline-fmv.rom`, Cannon Fodder CUE and tracks; supplied through the `COPPERLINE_FMV_*` variables above |
| `ocs_bpu7_ham_captures_*` (incl. live-audio variant) | `kickstart205.rom`, `DESiRE-InsideTheMachine.adf` |
| `dblpal_boot_presents_full_programmable_scan` | `KICK31.ROM`, `wb31-dblpal.adf` |
| `diagrom_menu_preserves_left_margin_text_columns` | `diagrom.rom` |
| `mmu_library_boot_and_muforce_hits_*` | `Kickstart v3.1 r40.68 (1993)(Commodore)(A1200)[!].rom`, `mmu-test.adf`, `mmu-libs.adf` |
| `picasso2_workbench_opens_640x480x8` | `Kickstart v3.1 r40.68 (1993)(Commodore)(A4000).rom`, `p96-picasso2.hdf` (WB3.1 + Picasso96, default 640x480x8 screen) |
| `picasso2_workbench_opens_640x480x16` | `Kickstart v3.1 r40.68 (1993)(Commodore)(A4000).rom`, `p96-picasso2-16.hdf` (same, default 640x480x16 screen) |
| `picasso2plus_workbench_opens_with_gd5428_revision` | `Kickstart v3.1 r40.68 (1993)(Commodore)(A4000).rom`, `p96-picasso2.hdf` (same installation booted against the Picasso II+ identity) |
| `picasso2_p96cts_reports_all_modes_clean` | `Kickstart v3.1 r40.68 (1993)(Commodore)(A4000).rom`, `p96-picasso2-cts.hdf` (startup runs p96cts at 8/16/24 bpp and writes `P96OUT:p96cts.result`) |
| `graffity_z2_workbench_opens_640x480x8` / `graffity_z3_workbench_opens_640x480x8` | `Kickstart v3.1 r40.68 (1993)(Commodore)(A4000).rom`, `p96-graffity.hdf` (WB + Picasso96 with `Graffity.card`, default 640x480x8 screen) |
| `chd_cd32_disc_serves_iso9660_data_and_smooth_audio` | `Pinball Fantasies (EU).chd` (a chdman v5 CD32 disc with a MODE1_RAW data track and CD audio tracks) |
| `chd_hard_disk_matches_its_source_hdf_and_takes_writes_in_the_overlay` | `AmigaSYS3PlusAGA-rdb.hdf` and `AmigaSYS3PlusAGA-rdb.chd`, its conversion (`chdman createhd -i AmigaSYS3PlusAGA-rdb.hdf -o AmigaSYS3PlusAGA-rdb.chd`; `brew install rom-tools`) |
| `chd_hard_disk_boots_amigasys_under_kick31` | `KICK31.ROM`, `AmigaSYS3PlusAGA-rdb.chd` (as above) |
| `nrg_cd32_disc_serves_iso9660_data_and_smooth_audio` | `30 Games Compilation CD (2005)(Stuermer, A.).nrg` (a Nero 5 DAO CD32 disc with one MODE1/2048 data track and nine CD audio tracks) |
| `toccata_ahi_driver_recognizes_the_board` | `Kickstart v3.1 r40.68 (1993)(Commodore)(A4000).rom`, `toccata-ahi.hdf` (WB3.1 + AHI 4.18 with `toccata.audio` staged into `Devs/AHI` and Unit 0 set to Toccata) |
| `zz9k_sdk_tools_pass_on_zorro_ii` / `zz9k_sdk_tools_pass_on_zorro_iii` | `zz9k/C/zz9k-{info,hash,chacha,aead,irqtest}` -- the unmodified ZZ9000 SDK m68k tools, built from the zz9000-sdk revision pinned in `docs/internals/zz9k.md` (build recipe in `tests/zz9k_sdk_tools.rs`'s module comment) |

## Obtaining the assets legally

- **Kickstart 1.3 / 2.05 / 3.1 ROMs** (`KICK13.ROM`, `kickstart205.rom`,
  `KICK31.ROM`) and a bootable **Workbench 3.1 floppy** (`wb31-dblpal.adf`,
  a WB3.1 boot disk configured for the DblPAL screen mode): licensed via
  [Cloanto Amiga Forever](https://www.amigaforever.com/).
- **DiagROM** (`diagrom.rom`): freely distributed from
  [diagrom.com](https://www.diagrom.com/).
- **Inside The Machine** (`DESiRE-InsideTheMachine.adf`): a scene demo by
  DESiRE, available from [pouet.net](https://www.pouet.net/) / Aminet.
- **MMU test disks** (`mmu-test.adf`, `mmu-libs.adf`): built locally by
  `tests/mmu-disks/make-disks.sh` from any Workbench 3.1 boot disk plus
  Thomas Richter's MMULib (fetched from Aminet by the script). The
  committed `tests/mmu-disks/lawbreaker` binary is built from the adjacent
  `lawbreaker.c` with `m68k-amigaos-gcc -noixemul -O`. These disks drive
  the issue #90 regression: mmu.library building and enabling real
  translation trees on the 030/040, lazy faults through the resumable
  bus-fault frames, and MuForce hit reporting.
- **Picasso II/II+ HDFs** are local Workbench 3.1 installations with Picasso96's
  `PicassoII.card` driver (Picasso96 is freeware, from Aminet
  `driver/gfx/Picasso96.lha`). The boots use an A4000 over motherboard IDE
  because the generic `KICK31.ROM` has no big-box SCSI/IDE driver. The
  `-cts` image's startup sequence runs p96cts for
  its 8-, 16-, and 24-bit mode set and writes `PASS` to
  `P96OUT:p96cts.result`; on failure it leaves the suite's diff images in that
  host-mounted output directory.
- **The Graffity HDF** (`p96-graffity.hdf`) is the same kind of local
  Workbench + Picasso96 installation, with `Graffity.card` from the same
  Aminet Picasso96 archive installed in `Libs/Picasso96/`. Converting an
  existing PicassoII-configured installation needs three guest-side edits
  (all patchable from the host with a hex editor or a short script, since
  the fields are fixed-size NUL-terminated strings): a
  `Devs/Monitors/Graffity` monitor (copy the generic Picasso96 monitor
  binary; in its `.info`, change the `BOARDTYPE=PicassoII` tooltype to
  `BOARDTYPE=Graffity`, fixing up the 4-byte big-endian length prefix
  before the string), and the `Devs/Picasso96Settings` file's BDNM
  board-name field plus its `PicassoII:WxH` mode-name strings renamed to
  `Graffity:...`. Picasso96's own `Picasso96/debug/CheckBoards` is a good
  smoke check: it reports the claimed board's name, chip, and memory base,
  and brings the RTG screen to front for about two seconds.

- **Toccata/AHI HDF** (`toccata-ahi.hdf`) is a local Workbench 3.1
  installation with **AHI 4.18** (freeware, from Aminet's
  `mus/misc/AHIUser418.lha`) installed, plus its bundled `toccata.audio`
  driver (already shipped in that same archive's `AHI/User/Devs/AHI/`
  directory -- both the 68020+ build and the `.000` 68000 build -- along
  with the `AHI/User/Devs/AudioModes/TOCCATA` mode descriptor AHI prefs
  needs). To build one: install AHI onto a WB3.1 HDF as normal, copy
  `toccata.audio` and `AudioModes/TOCCATA` from the archive into the
  installed `Devs/AHI` and `Devs/AudioModes`, boot with `[toccata] enabled
  = true`, open `AHI` in Prefs, select Unit 0 = Toccata, and save so the
  choice persists in `ENV:Sys/ahi.prefs` (copy forward to `ENVARC:` too).
  The A4000/motherboard-IDE boot shape matches the Picasso II HDFs above,
  for the same reason (no big-box IDE driver in the generic `KICK31.ROM`).

The `*.U12` / `*.U13`-style files in the repo root are split EPROM dumps for
expansion-board ROMs (e.g. the A2091 SCSI boot ROM) used by other ignored
tests; they follow the same "never committed" rule.

## Tracked binary fixtures

The tracked `.bin`, guest-probe, and open-ROM fixtures are project-owned or
open-source test and runtime artifacts, never copyrighted ROM or disk images
(see `RELEASE.md` for the full tracked-binary audit):

- `timing-test/*.bin` probe programs (each built from its adjacent `.asm`
  source) and `timing-test/golden/*.png` blessed reference renders (see
  `timing-test/README.md`, "CI golden renders").
- Bundled open ROMs and board artifacts under `assets/` (`aros/`, `fmv/`,
  `services/`, `copperhf/`, `hrtmon/`, `a2091/`, `a4091/`, `lide/`,
  `hostsocket/`, `zz9k/`).
- Committed guest probes under `guest/` (`zz9kprobe`, `uaelib-test`,
  `hostfs-test`, `clipboard-test`, `modem-test`, `a2091-test`, `tape-test`,
  `hdbench`, `copperhf-test`, `osbench`) used by asset-free and asset-backed
  integration tests.
- Asset-free test fixtures under `tests/assets/whdload/TestGame.lha`,
  `tests/fixtures/`, `tests/fuzz-regressions/archives/`, `fuzz/corpus/archives/`,
  and `tests/golden/copperhf/*.png`.

Unlike the suites above, `probe_golden.rs` (the golden-render suite for
those probes) needs no external assets: it boots the bundled AROS ROM and
runs in CI on every push, including an NTSC A1200-profile sprite render.
`hrtmon_freeze.rs` is similarly self-contained
(using bundled AROS and the bundled HRTMon ROM) and runs in optimized builds
(`cargo test --profile ci --test hrtmon_freeze`): it verifies
freezer cartridge behaviour both via the library interface and the
`--freeze-after` CLI flag, asserting the monitor's active status, screen
output, and save state roundtripping.

`audio_stems_determinism.rs` also needs no external assets (bundled AROS,
an empty default DF0) -- it is `#[ignore = "runs the emulator"]` rather
than release-only-gated like `probe_golden.rs`, so run it explicitly:

```sh
cargo test --release --test audio_stems_determinism -- --ignored
```

## vAmigaTS

`vamiga_ts.rs` is a separate ignored suite driven by `COPPERLINE_VAMIGATS_*`
env vars against a local [vAmigaTS](https://github.com/dirkwhoffmann/vAmigaTS)
checkout plus a Kickstart 1.3 ROM. See `docs/guide/headless.md`
("Automated compatibility testing (vAmigaTS)").
