# Test matrix

The required final media matrix is defined in `IMPLEMENTATION_PLAN.md`, Section
15. The checked-in deterministic MKV fixture currently exercises the automated
GUI, preview, A/V, and seek gates; it is not yet the complete UHD/HDR/corruption
fixture corpus.

## Current automated gates

The UCRT GUI release preset configures 91 tests. Every mandatory test currently
passes; the optional Application Verifier test is skipped because its Windows
run requires an elevated interactive UAC session. Coverage includes active Catch2 core/media checks,
10,000 deterministic randomized seeks compared with linear decoded-frame
hashes, checksummed index-cache corruption and atomic recovery, append-only
project edit-snapshot recovery from a torn final journal line, typed
extended container/stream probing, project-summary and blocked-export smokes,
decoded source-to-frame indexing, deterministic audio decode/PCM hashing,
project-summary and blocked-export smokes,
byte-identical MKV packet-copy/metadata/timestamp validation,
independent Main 10 boundary encoding and strict decode validation,
copy/replacement boundary joining with source-payload and timestamp audits,
HDR10 Main 10 boundary preservation of BT.2020/PQ, mastering display, and CLL,
physical per-packet HDR10+ boundary payload coverage and source-map alignment,
HLG Main10/Main 4:2:2 10/Main 4:4:4 colour signalling, H.264 High 4:2:2/4:4:4
boundary profiles, byte-identical A53 caption carriage, text-to-MOV_TEXT
subtitle conversion, and byte-exact Dolby E SMPTE 337M Matroska bridging,
Profile 8.1 RPU/config preservation with independent dovi_tool parsing,
multitrack temporal range retiming and long-form drift checkpoints, GUI/CLI
plan equivalence, GUI-driven validated export, selection undo/redo, accessible
controls, worker restart recovery, persistent Cut/Scene editing modes, editable
output profiles, selected-stream exports, packet-copy audio synchronization,
editable Joiner projects, title-card encoding/project round-trips/title-first
joining, parameterized interactive/review and queued Ad-Detective scans,
source-frame-rate-aware batch marker spacing, MP4/MOV/MPEG-TS smart-render
outputs, dimension-filtered QuickStream Fix, saved-project batch exports,
multi-object title composition, and AAC/AC-3/Opus output profiles with measured
gain. The offscreen GUI smoke also
checks project-modified tracking plus Cancel/Discard lifecycle decisions before
destructive source or application transitions, and pixel-level brightness and
contrast checks cover preview-only display adjustment. Combine, Replace, and
Cancel overlap decisions are also exercised against the normalized cut model.
The export-completion smoke verifies the formatted frame count, validation
result, and SHA-256 summary while suppressing modal dialogs under automation.
The Program Options smoke verifies persisted video-only playback, audio-alert,
default output/project folder, default container, save-priority, and queue
cleanup settings plus the Interactive versus Batch alert policy without emitting sound
under automation. It also verifies the plot mask covers the preview centre,
preserves pixels outside the selected area, and is a no-op when disabled.
The GUI smoke additionally verifies the File Save As labels, F1 Help Contents
binding, and marked-range repeat restart logic used by the live Audio
Synchronization dialog.
The multi-file Open gate sends two sorted sources through the Join route, then
through the validated Combine engine, and requires the combined result to load
as a frame-indexed editable source.
Chapter-file smoke coverage verifies removal of a marker inside a cut, output
frame/time retiming after the cut, cut-point insertion, first-frame insertion,
template substitution, and atomic text-file creation.
The control-IPC gate launches the real worker server, exchanges versioned
length-prefixed JSON over a local Windows named pipe through the CLI, validates
the protocol/version/PID response, and requires a clean shutdown response and
process exit. Unit coverage independently exercises the framing transport.
The GUI control-restart gate loads navigation through the persistent worker,
terminates that worker and requires an automatic restart, then forces a named-
pipe connection failure and requires the one-shot navigation fallback. Its
report distinguishes all three outcomes, while ordinary source/project tests
require at least one genuine persistent navigation response.
The project-roundtrip test is also used as a repeated teardown stress gate for
the worker/process/thread cleanup path; the IPC migration was accepted only
after ten consecutive save, reopen, journal-recovery, and shutdown passes.
Shared-preview unit coverage creates a named local mapping, independently opens
and validates the bounded header and pixel bytes, verifies frame/colour fields,
rejects an incorrect acknowledgement sequence, accepts the correct one, and
observes it from the publisher before RAII cleanup.
The GUI open-source and rapid-preview stress tests exercise the production
worker-to-GUI shared-memory path, including acknowledgement before worker exit,
display, cache insertion, superseded-request handling, and repeated seeking.
GUI-driven exports must also
capture a parseable final report containing a 64-character SHA-256 output
digest and the pinned dependency inventory,
67 malformed/truncated probes, full-disk/interruption/read-only failure paths,
Application Verifier heap/handle checks, a bounded-memory 3840x2160 Main10
decode, and external ffplay interoperability,
malformed-input contract tests, and release-report checks. The probe contract artifact is
written to `build/<preset>/test-results/gui-probe-contract.json`. A portable
worker gate verifies exact raw byte-range output, SHA-256 reporting, partial-file
cleanup, and same-file rejection for Create Trimmed File Copy.

The MSVC x64 preset runs six dependency-free core architecture, worker, IPC, and
index-integrity gates. Its preset explicitly clears the MinGW media root to prevent incompatible
ABIs from being mixed through a stale CMake cache.

Release-gate dependency chain:

`project-summary-smoke` -> `probe-contract-release-gate` ->
`release-summary-gate` -> isolated package launch -> source-bundle validation.

The blocked-export and malformed-probe tests run alongside the chain as safety
coverage; all must pass before packaging. The package gate clears inherited
developer PATH entries before launching the CLI and GUI, so missing FFmpeg, Qt,
or MinGW runtime DLLs cannot be hidden by a developer installation.

The MSVC AddressSanitizer preset adds six portable-core/worker/IPC gates. Application
Verifier is an optional external gate and is reported as skipped when the tool
is not installed or the process is not elevated. Azure Artifact Signing now
signs and verifies the first-party executables and installer after packaging.
The exact signed commercial artifacts also pass a 19/19 mid-GOP player matrix.
Every case contains encoded boundary frames and copied interior frames, decodes
completely with FFmpeg, and visibly advances at three distinct capture points
in MPC-BE. The matrix covers MPEG-2, H.264, HEVC Main/Main10, AV1 and VP9 with
representative AAC, AC-3, E-AC-3, ALAC, DTS, TrueHD, MP2, MP3, PCM, Opus, FLAC,
Vorbis and no-audio combinations.

Remaining external work includes the elevated Application Verifier run,
independent legal/patent review, production service-secret/live-lifecycle
testing after Lemon approval, and the broader VLC/mpv/long-file/device-diverse
GPU and media-corpus matrix.

The release gate also opens the corresponding-source ZIP and requires tracked
GUI/worker source, CMake configuration, project schemas, dependency build
scripts, and representative pinned dependency archives before packaging can
pass.

The `smartcut-hardware-acceleration` gate requires a real preview decode result
that identifies D3D11VA, Vulkan, or the supported software fallback, and
validates the registered/runtime-available contract for NVENC, Quick Sync and
AMF. The `smartcut-ffmpeg9-vulkan-codecs` gate independently requires the
FFmpeg 9 software and Vulkan FFV1/ProRes encoders to be registered. It produces
and decodes software controls plus explicit Vulkan outputs when the local
driver can open them, or verifies automatic software fallback otherwise. Local
real-media checks additionally cover D3D11VA preview on MPEG-2 and 4K HEVC,
GPU scaling for filmstrip and Ad-Detective, and H.264, HEVC and AV1 NVENC
transcodes with decoded-frame, keyframe, dimensions, bit-depth and timing audits.

The `smartcut-hardware-self-test` gate exercises the same user-facing benchmark
contract exposed at **Tools > Hardware Acceleration Self-Test**. It compares
validated software and available GPU paths for preview decode, DVD MPEG-2, H.264, HEVC,
FFV1 and ProRes, identifies the backend actually opened, and recommends the GPU
only when it completes correctly and is at least 10% faster on the selected
representative source. The test is advisory and codec-specific; it does not
remove a backend or alter the software-only smart-render boundary-GOP policy.
