Skip to content

Latest commit

 

History

History
589 lines (525 loc) · 44.3 KB

macos-testing.md

File metadata and controls

589 lines (525 loc) · 44.3 KB
status active
owner macos
reviewed 2026-11-15
summary macOS test lanes — deterministic development verification, the platform gate, model fixtures, explicit XCUITest smoke/benchmark/perf acceptance with the ui-perf baseline protocol (copy reports out between runs; discard-and-replace on concurrent use), and crash/profile evidence.
sourceOfTruth
scripts/macos_test.sh
scripts/ui_test.sh
scripts/lib/xctest_summary.py
scripts/lib/mac_lane_data.py
scripts/lib/host_preflight.sh
config/ui-perf-thresholds.json
config/ui-lane-tests.json
scripts/check_macos_ui_perf.py
scripts/check_macos_ui_bench.py
scripts/lib/playback_capture.py
Tests/VocelloCoreTests/MacStudioGenerationRequestFactoryTests.swift
Tests/VocelloCoreTests/VoiceClipEnrollmentEvidenceTests.swift

macOS testing

Vocello separates routine deterministic development verification from explicit native-app UI acceptance. Every UI check is an XCUITest lane (maintainer decision 2026-11-17); what XCUITest cannot drive is the maintainer's, by hand.

Clone/enrollment parity is part of ordinary deterministic verification. The core suite exercises the shared transcription-review/evidence policy and the pure macOS Design/Clone request factory, including manual-edit precedence, stale-result rejection, explicit audio-only enrollment, reference-language metadata, target-text Auto routing, explicit-language precedence, and exact reference/prompt/seed/variation identity. These tests guard the request boundary; native visual and interaction acceptance remains the XCUITest lanes below.

Ordinary development

scripts/dev.sh check        # lint, contracts, selected tests, native lanes the dirty tree touches
scripts/macos_test.sh test  # the deterministic macOS core and runtime tests
scripts/dev.sh ci           # exactly what push CI runs, serially

These are advisory; the commit lint is the only local block and CI on main is the gate (main is the only published branch; the lead integrates agent worktree branches into it, with no pull request). None of them needs UI execution, installed generation models, or release evidence.

scripts/macos_test.sh test writes each bundle's raw log plus a structured summary next to it (core.test-results.json, runtime.test-results.json, produced by scripts/lib/xctest_summary.py, the same writer the XCUITest lanes use) and verdict.txt under build/artifacts/macos/tests/<run>/. The bundles run through the direct xcrun xctest runner on purpose: Xcode 26.6 can compile and then wait indefinitely before spawning xctest for these hostless bundles through xcodebuild, so no .xcresult is produced for this lane.

Two of the runtime tests compare the watermark port with fixtures minted from the PyTorch reference (AudioSealParityTests: the whole-buffer parity test and the windowed-path test). The fixtures and the exported generator weights are not committed, so both tests skip unless QWENVOICE_AUDIOSEAL_FIXTURES names a directory that holds parity-fixtures.safetensors and audioseal-generator-fused.safetensors; ordinary CI never sets it, and there is no default path. Export the variable before the lane to run them: QWENVOICE_AUDIOSEAL_FIXTURES=<fixtures directory> scripts/macos_test.sh test. The verdict says which happened in its audioseal_parity= line (ran (2 tests against the reference fixtures), skipped (2 of 2 tests: QWENVOICE_AUDIOSEAL_FIXTURES is unset), or not run when the runtime tests never reached them); the line reports and never changes the verdict, and a run that skipped them is no parity evidence.

scripts/macos_test.sh test --coverage is opt-in and non-blocking: it builds the bundles with -enableCodeCoverage YES (which flips the shared macOS cache and forces a rebuild, so it is never part of scripts/dev.sh check or push CI), runs them with LLVM_PROFILE_FILE under the run directory, and exports coverage.json (llvm-cov, summary only), coverage-summary.txt (line coverage per source root) and coverage-runtime.json (SwiftPM export for Qwen3RuntimeTests). The verdict gains a coverage= line; no threshold exists yet. A future floor belongs in a dedicated config/ policy file validated from scripts/check_project_inputs.sh, not in this lane.

Platform gate (scripts/macos_test.sh gate)

scripts/macos_test.sh gate                         # project inputs → foundation build → deterministic tests → crash delta
QWENVOICE_GATE_BENCH=1 scripts/macos_test.sh gate  # adds a bench preflight and a bounded, seeded vocello bench; a PASS publishes its benchmark history
QWENVOICE_GATE_BENCH_SEED=1 scripts/macos_test.sh gate  # the same bench, added to the staged baseline instead of compared
scripts/macos_test.sh release-readiness            # project inputs → exact-path app build → deterministic tests → crash delta
scripts/macos_test.sh preflight [--strict-models]  # Xcode, app, dSYM and model-fixture status; --strict-models fails on a missing fixture
scripts/macos_test.sh crashes [--test]             # collect and symbolicate .ips for the app
scripts/macos_test.sh telemetry-overhead           # model-dependent on/off telemetry parity diagnostic

The gate is release tooling, not the daily loop: .github/workflows/release.yml runs it in the archive-ios job as the platform-readiness step (scripts/macos_test.sh gate && ./scripts/build_foundation_targets.sh ios). Its four ledgered required steps are project-inputs (check_project_inputs.sh, step 0; locally the gate sets QVOICE_GATES=quick, so the Python suite CI already ran is skipped while scripts/ and config/ are clean, and CI ignores it), foundation-build (build_foundation_targets.sh macos), deterministic-tests (the same bundles as test: VocelloCoreTests, which the gate no longer runs a second time, and the Qwen3 runtime tests) and the gate-fatal crash-delta over the app's diagnostic reports newer than the run's marker. Every step lands in a required-step ledger with the verdict under build/artifacts/macos/gates/.

The crash delta of the gate, of release-readiness and of the macOS XCUITest lanes reads the same reports (mac_new_diagnostic_reports in scripts/lib/shared.sh): the app's crash reports (Vocello-*.ips, and the legacy .crash), hang reports (.hang) and spin reports (.spin), in ~/Library/Logs/DiagnosticReports and, when it can be read, /Library/Logs/DiagnosticReports, where spindump writes hangs and spins. macOS writes a report a few seconds after the process died or was sampled, so a read that finds nothing waits QVOICE_CRASH_DELTA_SETTLE_SECONDS (default 5) and reads once more before it passes. The engine lanes' delta, which compares content digests before and after the run (scripts/publish_benchmark_history.py), reads the same report kinds and settles the same way.

QWENVOICE_GATE_BENCH=1 adds two steps. A benchmark-preflight before step 0 takes seconds: a quiet host, the canonical hardware profile, the installed benchmark model and a prediction of the baseline identity from the live host and the gate matrix; any failure stops the gate before a build, with a finalized ledger and a verdict that quotes the preflight's reason (a busy host, the hardware, a missing model, or a predicted BASELINE INVALID with its seed command). After the crash delta, unless an earlier step failed (the bench step is then left unrecorded and the ledger marks it missing), a bounded vocello bench of five seeded warm takes re-checks the host right before the model loads, compares the warm medians with the committed baseline and, on a PASS, publishes one benchmark record. A loaded, low-power or throttled host makes the bench INCONCLUSIVE: the ledger records the step as failed with exit code 3, nothing is published, and the gate prints GATE: INCONCLUSIVE and exits 3, never PASS or FAIL. The optimized CLI build logs to cli-build.log, the measurement to bench.log, and every threshold used, with the baseline digest, to bench-verdict.json. QWENVOICE_GATE_BENCH_SEED=1 runs the same bench but adds the run to the staged baseline instead of comparing (telemetry-and-benchmarking.md, baseline comparison). release-readiness is the packaging prerequisite scripts/release.sh invokes before signing; it needs no model fixture and no UI evidence.

The gate bench, profile, telemetry-overhead, lang-bench, memory and qc-takes (with agents-allowed) refuse to start on a busy host (the deterministic gate without a bench does not check, so it can run beside an agent or a native build): require_quiet_host refuses them before any model loads (its thresholds and the exploratory QVOICE_ALLOW_BUSY_HOST=1 override: tooling-and-evidence.md, Host preflight). Local targeted validation is authorized at coherent checkpoints; full matrices remain specific to the task or release. Join workers before measured lanes and use the session's worker registration, or the documented lead-only fallback when tracking is unavailable. Releases, publication and other external writes require a specific request. The storage floors every lane checks first are listed under Instruments profiles below.

Blocking ThreadSanitizer subset

scripts/macos_test.sh tsan

This lane instruments the deterministic VocelloCoreTests bundle, the whole subset config/tsan-policy.json names. It does not execute the MLX/Metal runtime tests, whose lazy graph and single-owner behavior remain covered by their owned deterministic suite. Xcode may still compile linked MLX targets while building the test host. The driver launches Xcode's resolved xctest binary directly with the bundle's own embedded TSan runtime preloaded; repository-owned Mach-O files remain arm64-only, while only the named Xcode sanitizer dylib may retain its universal toolchain slices.

Since 2026-09-14 this lane is blocking: ci.yml runs it as the macos-tsan job whenever the Swift lane routes (its own build/cache/xcode/macos-tsan cache, 5 to 11 minutes on a second macOS runner) inside CI required, and the nightly workflow (nightly.yml, job tsan, 04:00 UTC and on dispatch) keeps a cold run of the same lane. config/tsan-policy.json records the characterization that earned the promotion (three consecutive scheduled nightly passes, runs 34683488068, 34749309445 and 34829408217, zero race reports, only the two registered skips) and the dated maintainer decision; scripts/runtime_security_contract.py refuses a blocking status without the recorded passes, zero open confirmed races and that decision. Both workflows preserve every failed run and perform no automatic retry.

Explicit XCUITest lanes

Run them at a coherent checkpoint, the smallest lane that covers the change (local validation lanes are authorized; AGENTS.md). test01_NavigationAndReadiness (the whole localization lane, and the second journey of the full smoke lane, after test00_WindowSizesAndSettingsScene; smoke sets QVOICE_MAC_SKIP_LANGUAGE_WALK=1 and skips its ten-language walk of about 21 minutes, which only the localization lane runs) launches the app with Foundation's -NSDoubleLocalizedStrings YES -NSShowNonLocalizedStrings YES, so doubled text (menus included) and UPPERCASE labels in its attachment mac-smoke-readiness-pseudolocalized are the diagnostic, not a defect: doubling is the long-string stress and uppercase marks a key absent from the String Catalog. Under that stress the journey asserts single-line Saved Voices rows, chips and Settings badges and in-window controls (assertSavedVoicesLayoutIntact, assertSettingsPackageRowsLayoutIntact), the check that caught the 2026-09-13 row collapse. Every macOS journey also launches with -AppleLanguages (en) -AppleLocale en_US (VocelloMacUITestCase.englishLaunchArguments), so the few English values the journeys read ("Ready", "N characters") do not depend on the host's system language now that the catalog carries French. All of these arguments are process-scoped and never persist. Lanes:

scripts/ui_test.sh macos smoke   # about 11 minutes (637 s of tests in run 20261025-221609-c2191179)
# Focused quality-input journeys through the same genuine controls and collectors:
scripts/ui_test.sh macos smoke --scenario design-enrollment
scripts/ui_test.sh macos smoke --scenario clone-reference
scripts/ui_test.sh macos smoke --scenario long-form
scripts/ui_test.sh macos smoke --scenario line-batch
scripts/ui_test.sh macos smoke --scenario long-form-recovery
scripts/ui_test.sh macos smoke --scenario saved-voices-states
scripts/ui_test.sh macos localization
scripts/ui_test.sh macos benchmark
# Filtered benchmark example:
scripts/ui_test.sh macos benchmark --modes custom --lengths short --warm 1 --label "focused"
# A probe run that writes no tracked record (benchmark and perf):
scripts/ui_test.sh macos benchmark --no-publish
# Scaled long-form memory evidence (local only, 2–12 segments; default 2):
scripts/ui_test.sh macos smoke --long-form-segments 10
# SwiftUI performance / animation-smoothness scenarios (local evidence only):
scripts/ui_test.sh macos perf
# Product image refresh (asset workflow, never acceptance or benchmark evidence):
scripts/ui_test.sh macos marketing [--scenario all|models]
# Studio Auto language reaches the engine (about 15-25 minutes, unattended):
scripts/ui_test.sh macos auto-language

auto-language proves that Studio's Auto language is sent to the engine, not only shown. With every mode left on Auto (a mode on another language fails closed; the lane never changes one), each take of config/auto-language-check.json types a tracked sentence, waits for the language chip's value to settle on the detected language ("French, Auto"), reads the chip's menu without choosing anything and generates. The takes cover Built-in Voice in all ten languages, Design and Clone, an English sentence with one Japanese word, and Dutch, which no Qwen3 language matches: Built-in then shows Auto and sends English (the D6 fallback, recorded as an observation), Design sends no language token. Manual takes pick a language from the chip's menu on an empty script, mostly one that differs from the text (French over English, Spanish over French, English over Japanese and over Dutch), check that the chip keeps it once the sentence is typed, and return the mode to Auto afterwards. scripts/auto_language_check.py joins each take, by its generation ID, to the engine's request receipt and checks that the request carried the selection (auto or the picked language), that the model language and the chip agree, the token mode, the recognizer witness (for a manual take, the text's own language, which the selection overrides) and the prompt digest; the summary and the run's rows stay under the run directory, without the scripts. It needs the benchmark clone voice, saves no voice and records nothing, so no Speech Recognition prompt interrupts it (BKL-19).

design-enrollment runs the existing Design brief/player and actual-audio enrollment journey; clone-reference runs saved-reference hydration, editing and completed Clone playback; long-form runs the long-form project journey alone, including a regenerated segment accepted as a new revision with the replaced take and joined output kept in History (F-16); line-batch runs the two-line batch alone and reads, from the open menus, that Navigate ▸ History is disabled while the batch runs and enabled once it settles, while File ▸ Open Output Folder stays enabled; long-form-recovery plants an unreadable long-form journal in an isolated empty profile and drives History's notice: Export is offered, Retry is offered and the notice stays, and a confirmed Discard ends the notice and sets the journal aside on disk, unchanged (F-16); saved-voices-states opens Saved Voices on an isolated empty profile, then on one whose store fails every listing (a plain file where the store keeps its review candidates), and checks that each state keeps the window a height a display can show and sits inside the window pinned to its minimum size, with the error's Retry reachable (BKL-15). Each is recorded as focused-smoke, with its selected mode (none for long-form-recovery and saved-voices-states, which generate nothing) and no benchmark matrix. None constitutes full smoke, localization, automatic-ASR accuracy or acoustic-quality acceptance. Pure draft and recognition-operation tests cover pending/stale one-off references; the Design and Clone journeys do not replace that coverage.

The marketing lane refreshes the README and website images through genuine controls at a 1040×680 window (VocelloMacMarketingCaptureUITests.test00_WebsiteRefresh; --scenario models runs test06_ModelDownloadsRefresh alone): it generates two demo takes and saves one designed voice, attaches the captures for export and publishes nothing. Its run record carries evidenceClass: marketing-assets; it is never acceptance, promotion or benchmark evidence.

The benchmark lane also records what the app actually plays: the test runner taps the app's own audio output for one take per cell (the last warm repetition that does not start an app session; Core Audio process tap, physical output muted while tapped, one manual System Audio Recording grant for the lane-re-signed com.qwenvoice.app.uitests.xctrunner), writes the captures under the run's playback-capture/ directory and the checker compares each one with the published take WAV (playbackCapture* metrics, warn codes, and since 2026-09-14 a gate on captured takes; see telemetry-and-benchmarking.md §4.10). The gate (scripts/lib/playback_capture.py gate_failures) fails the lane on a captured take outside its thresholds and on a silent take: the tap ran and the app played nothing audible. When the runner armed capture (its capture-run.json is in the capture directory), every planned take owes a capture, and one that ends unavailable, referenceUnresolved or aborted fails the run. A run that was never armed (QVOICE_MAC_BENCH_PLAYBACK_CAPTURE=off, or the default auto on a host whose TCC database shows no grant) passes, and its record carries no capture evidence.

The benchmark checker also fails a take on playback health: any playback continuity failure (playbackContinuityFailures above zero) and more underruns than --max-playback-underruns allows (default 0, which the lane uses), each named with its take and cell. The iPhone checker prints the same two findings as report-only warnings that change neither the verdict nor the record, until a phone run calibrates them.

A benchmark take that the app's mandatory audio check refuses does not fail the lane by itself (RF-61, maintainer decision 2026-11-15). The test goes on to the next take, the checker records the refusal when the take's engine row proves it, and the run publishes the takes that completed as an exploratory record that names the refused cells and is never canonical. The lane's last line then reads macos benchmark PASS · REFUSED 1 take(s): take 13 (design/short/warm#1) · exploratory record, never canonical · <run directory>. The lane fails when more than one take is refused (the checker's --max-refused-takes), when a take failed any other way, and when a take the test marked left no engine row. A refused take is never retried and the seeds never move for one (telemetry-and-benchmarking.md, Refused takes).

The smoke lane captures its completed-generation take (test02) as well, always armed; its capture analysis is advisory. What fails the journey is playback itself: test02 asserts that the finished take starts playing on its own, and outside the measured lanes waitForPlaybackToFinish requires the player to have been seen playing (its control reads "Pause") before playback counts as ended. The benchmark and perf lanes keep the wait their baselines ran with; the benchmark's played-audio gate answers for a silent take there.

UI-performance lane (macos perf)

Twelve XCUITest-driven scenarios measure SwiftUI frame health, resource usage, and animation smoothness: idle-baseline, sidebar-navigation (pure UI: proactive warms suppressed with QWENVOICE_SUPPRESS_WARMUP, audit #33), harness-control (exploratory, audit #32: sidebar-navigation's readiness queries with no click, so its hitch time is the harness's own accessibility cost), history-scroll (400 seeded rows; exploratory), history-filter (400 seeded rows, three type/clear cycles of the search field; exploratory), history-filter-paged (exploratory: the same journey over 700 seeded rows, more than one 500-row History page, with a query whose matches all lie outside the newest page, so every answer comes from the database), delivery-menu (warms suppressed, as in sidebar-navigation, so no model warm starts inside the window), settings-scroll, composer-typing, window-resize (exploratory), sidebar-navigation-warms (exploratory: the same navigation with the product's warms on, run late because it loads models) and generation-active (exploratory; gate ON, engine busy). The navigation scenarios and the control mark phases inside their windows (query for readiness polls, action for clicks, verify for the wait on the destination), and the report lists each phase's hitch rate. Every scenario prints its setup stamps (VOCELLO_UIPERF_SETUP=), and the report's lanePhases names each scenario's launch, settle, setup and window, the windows' share of that time and the required-step ledger's step durations (audit #82; report only). Scroll scenarios drive a WINDOW-anchored coordinate, never scrollViews.firstMatch: element-addressed events re-resolve their query per event and that accessibility walk executes on the app's main thread, polluting the measurement (Time Profiler evidence 2026-08-05). The History scenarios stay exploratory because the 400-row tree's accessibility maintenance cannot be excluded from their windows at all. Each scenario launches the app once with the in-app frame probe enabled (QWENVOICE_UIPERF_FRAME_PROBE, registered knob) and marks its wall-clock window; the probe streams 500 ms display-link blocks (frames delivered vs expected, excess frame time, max gap, gap histogram, CPU, footprint, thermal) to diagnostics/ui-perf/, and scripts/check_macos_ui_perf.py joins windows to rows and writes ui-perf-report.json under the run directory. The three History scenarios launch on an isolated profile: QWENVOICE_APP_SUPPORT_DIR points the app at a temporary folder per row count, which QWENVOICE_UIPERF_SEED_HISTORY seeds to exactly 400 or 700 rows (registered knobs; the seeder tops up to the count and is idempotent), so the shared debug History, which other lanes fill and nothing erases, never sets the size of the list they measure. Each asserts its last seeded row before the window opens, the setup stamp carries the seeded count (archiveCount), and the folders are removed when the class finishes. The isolated profile, the History cycle marks, the paged scenario and delivery-menu's suppressed warms were measurement version 2 of Mac ui-perf (2026-11-15); switching test05DeliveryMenu to window-anchored coordinate clicks plus keyboard (BKL-77, 2026-11-20, eliminating accessibility snapshot walks) bumped Mac ui-perf to measurement version 3 (scripts/lib/lineage_identity.py), a lineage of its own.

Registry posture (UI-7): the structural gate is unchanged (every scenario present once, probe coverage ≥90% of each window, monotonic blocks, sane refresh interval). On a PASS the checker evaluates the ceilings in config/ui-perf-thresholds.json. A breach is a warning that marks the run passedWithWarnings, unless the contract's enforce list names the scenario: there a hitch or max-gap breach fails the run (exit 1, report status failed, no evidence manifest). An enforced scenario must have both ceilings, ceilings may cover scenarios outside the confirmatory set, and an uncalibrated run enforces nothing. The committed enforce list enforces seven scenarios (idle-baseline, sidebar-navigation, delivery-menu, settings-scroll, composer-typing, history-filter, history-filter-paged), while history-scroll, window-resize and sidebar-navigation-warms remain warn-only. The contract names the profile and refresh interval its ceilings were derived on (calibrationProfile, calibrationRefreshIntervalMS); a run on any other carries one uiperf.uncalibrated:<profile> code instead of ceiling verdicts. A contract whose scenarios changed meaning after its derivation names why in calibrationStale, and its runs carry the same code on any profile; a derived contract never carries the field. The committed contract is calibrated on mac-mini-m6-16gb at 16.67 ms with no calibrationStale: BKL-77 re-derived it on 2026-11-21 from three counted M6 runs of the measurement-version-3 driver (calibrationRuns), covering the five confirmatory scenarios (idle-baseline, sidebar-navigation, delivery-menu, settings-scroll, composer-typing) plus the History, window-resize and warm-navigation scenarios. It supersedes earlier M2 and v2 ceilings, including the pre-2026-09-25 M2 baseline-v3 ceilings that judged quantities the driver no longer measures (sidebar-navigation became pure UI with warms suppressed and phased polls, and uiMaxGapMS became clipped to the window; audit #32, #33, #81). A re-derivation runs python3 scripts/check_macos_ui_perf.py --derive-thresholds <run IDs...> --write config/ui-perf-thresholds.json (rule spread-v1: per confirmatory scenario, max(1.3 × the median, the median + 3 × the run-to-run range), which is the median times max(1.3, 1 + 3 × the relative range) whenever the median is above zero; hitch rounded up to 0.5 ms/s with a 5 ms/s floor, gap to 10 ms with a 40 ms floor; --rule v3 reproduces the retired M2 ceilings; --scenarios a,b,c derives ceilings for a list other than the confirmatory scenarios, and must cover every confirmatory and every enforced one). The derivation accepts only canonical records of one comparison lineage (one comparison.key), so dirty or exploratory sessions and other builds never shape the contract. A confirmatory window whose footprint grows past footprintGrowthCeilingMB (250 MB) gets a warn-only uiperf.footprint:<scenario> code: since the engine moved in-process, sidebar-navigation's own product warms grew it by about 1-2.4 GB, which is why it now runs with warms suppressed and sidebar-navigation-warms measures them apart. Scenarios that repeat a cycle (sidebar-navigation, history-filter, history-filter-paged, delivery-menu, composer-typing) mark each cycle, and the report lists a hitch rate per cycle; records also carry uiHitchMSPerAction, the window's excess frame time per scripted action, and the generation-active take names the memory samplers' cadence during its take (samplerTargetIntervalMS, from the probe's environment row: 100 or 250 ms by tier (the floor tiers sampled at 500 ms before 2026-09-25); the iPhone lane names it too). Since 2026-09-25 each probe block also carries every frame gap (gaps, end offset and length) and the private watchdog's heartbeats of that block (heartbeatCount, delayedHeartbeats), so the checker clips uiMaxGapMS to the window (a gap straddling a window edge counts only its in-window part), takes uiP95GapMS from the gaps that end in the window instead of a histogram bucket edge (with uiGapSampleCount; uiP95GapMSApprox is no longer published for such probes) and publishes the window's own heartbeats (uiWindowHeartbeatCount, uiWindowDelayedHeartbeatCount50/250, uiWindowMaximumDelayedHeartbeatMS) (audit #80, #81). The watchdog's launch-scoped summary stays in the report and is never published under the generation-scoped heartbeat names; probes without the samples keep the block-level fallbacks. On the canonical hardware profile only, the checker emits benchmark-evidence.json, which the lane publishes as a PASS-only ui-perf registry record (one take per scenario, no model/telemetry/QC claims). Non-canonical hosts keep local-only reports, and dirty-source or late publications classify exploratory as usual. Since IUI-6 the ui-perf kind is platform-aware: the iOS twin lane (scripts/ui_test.sh ios perf) publishes through the same plumbing against its own contract (config/ui-perf-thresholds-ios.json; see ios-device-testing.md). The probe measures main-run-loop display-link cadence, a UI-thread hitch proxy; compositor ground truth remains an Instruments Hitches/Core Animation trace.

Baseline protocol: one discarded warm-up run, then at least three counted runs, five when the session allows (the derivation refuses fewer than three; fixed scenario order, AC power, cursor parked, caffeinate held by the lane); report per-scenario median and IQR; discard any counted run whose thermal state left nominal, that failed, or that ran during concurrent machine use, and replace it with a fresh counted run. Copy ui-perf-report.json out of the run directory after every counted run: retention keeps only the newest passing perf run per lane, so a multi-run session that skips the copy loses its earlier reports (the probe JSONL under the debug diagnostics store remains the recoverable raw source). Ceilings come only from the counted runs' own spread, through --derive-thresholds.

Lane Scope
Smoke Sixteen journeys in method-name order (test00–test15), each in a fresh app session (--scenario layout|studio-content|generation-errors|design-enrollment|clone-reference|long-form|line-batch|long-form-recovery|saved-voices-states|model-update runs test00, test12, test11, test08, test09, test06, test07, test13, test14 or test15 alone); generated diagnostic-store audio and History are retained, not automatically erased. Besides test00 (window sizes, Settings scene), test08/test09 (Design brief, Clone reference, completed player), test10 (missing models, Studio links), test11 (output-folder failure and recovery), test12 (cross-language content), test13 (long-form recovery Discard), test14 (Saved Voices empty and error states) and test15 (RF-59: an earlier Vocello's models on an isolated profile read Update required, Studio says Update in Settings, the banner offers the update; with automatic start on it starts by itself, Cancel stops it and a relaunch leaves it stopped; it needs a network and every other journey launches with QWENVOICE_MODEL_UPDATE_AUTOSTART=off, since the debug root's models folder links the host's real one), the journeys are: (1) navigation + visible model/clone readiness, (2) one real Custom generation whose finished take must start playing on its own, with the completed take asserted exactly once in History, (3) mid-generation cancellation — clean reset, no error badge, no History row, (4) the virtual-microphone recording flow through capture and review (registered QWENVOICE_FAKE_MIC_WAV knob, /tmp fixture; cancels before the permission-sensitive accept), (5) library surfaces, (6) a long-form project (default ~1,900-character script; report the actual planner segment count rather than assuming a fixed count; --long-form-segments N scales the same journey up to 12 planned segments for local memory-scaling evidence — the summary then adds a per-segment engine physical-footprint table and retains the compact per-generation diagnostics beside the run artifacts; joined WAV, one History project row with a working segment map; the lane prints the project wall clock and writes long-form-project-summary.txt), (7) a two-line batch (two streamed takes → two History rows; while it runs, Navigate ▸ History is disabled and File ▸ Open Output Folder is not, read from the open menus)
Benchmark Ordered, configurable Custom/Design/Clone matrix with cold/warm classification and per-take deterministic proof; the default is exactly 29 takes

The runner targets the configured native Vocello test host. Before launch it resolves every matching Vocello PID to its executable, fails fast if the process belongs to another app path, and signals only the exact app product under the runner's Release build directory. It uses stable accessibility identifiers and condition waits, preserves saved voices, visibly enables the persistent Clone consent preference for acceptance, restores temporary Auto-play changes, and records failures as XCTest activities and attachments. It never retries through a display name or alternate app path.

Every wait/action failure automatically attaches a full-desktop screenshot (which captures foreign system dialogs the app screenshot cannot see) plus a bounded accessibility-tree dump; each launch fails fast with the same evidence when the app window is obscured, and an interruption-monitor sentinel names any unrelated modal that blocks an interaction (it never answers TCC dialogs — those stay human-answered). The macOS lanes run a ui-preflight step that refuses a locked session or an Automation Mode that needs a password, and only warns when the app's microphone or speech-recognition TCC grant is undecided; they execute in two phases (a skippable build-for-testing keyed to the build inputs' content fingerprint, tree_fingerprint.py --build-inputs, then test-without-building, so repeat runs skip the rebuild while no build input changed; a commit that only publishes records or touches docs, the website or the roadmap keeps the skip), and write a per-test verdict sidecar (test-results.json) next to run.json.

A full smoke, perf or benchmark run must also have run the tests its lane promises. config/ui-lane-tests.json lists them per lane (macos-smoke, macos-perf, macos-benchmark, as Suite/method), and the lane passes its name to scripts/lib/xctest_summary.py --expect-lane for the run's last summary: a listed test that is missing from the results or was skipped ends the run with exit 4 and no PASS, and the summary's expected block names it. A test that ran and failed is the run's own failure. A --scenario run is one journey by design and checks nothing, and neither do the collectors of a failed run. scripts/tests/test_xctest_summary.py compares each list with the test methods under Tests/VocelloMacUITests, so a renamed, added or deleted journey changes the file in the same commit.

Benchmark accepts --modes, --lengths, --warm, --label, --seed-policy cell-hash-v2|cell-hash-v1|generated (default cell-hash-v2 since RF-61: each take's seed derives from its cell, audit #29) and --matrix-version NAME (a declared matrix in config/ui-bench-matrix.json; any version but the canonical one publishes focused records, audit #30). Filters are explicit diagnostic runs; invoking the command without filters is the canonical 29-take matrix on the tracked Mac mini Mac18,5 / Apple M6 / 16 GB profile (canonical since 2026-09-22; the retired Mac mini M2 8 GB records stay history). The lane refuses to build on any other Mac ("non-canonical host; benchmark records are not publishable"). Dirty-source successes are exploratory even on that hardware.

Model-dependent tests

Before generation, XCUITest must visibly confirm that Custom, Design, and Clone Speed are ready, Generate is enabled, and the benchmark clone voice is present. Use scripts/macos_test.sh models ensure only to repair/bootstrap fixtures, then begin a fresh test run. Do not download models implicitly inside a normal UI lane.

Deterministic evidence retained

The benchmark validator joins UI completion with:

  • History/database correlation and a readable WAV;
  • audio QC and complete typed frontend/backend telemetry by generationID (app + engine rows);
  • crash delta evidence;
  • benchmark order, take count, cold/warm class, and timing.

The validator atomically writes an untracked benchmark-evidence.json containing only the run's ordered generation IDs/cells and verdicts. The summarizer consumes that manifest plus the run ID, never the diagnostics directory's historical population. A PASS publishes one privacy-safe record under benchmarks/runs/ui-generation/ and regenerates benchmarks/HISTORY.md. Raw telemetry, WAVs, screenshots, and .xcresult remain untracked; publication never stages, commits, or pushes. The benchmark and perf lanes say in one line when they start that a passing run publishes; --no-publish keeps the artifacts and the verdict, writes no file under benchmarks/ and leaves publication-skipped.json in the run directory, from which python3 scripts/benchmark_history.py record --artifact-dir <run-dir> publishes the run later.

New publishable generation runs use telemetry schema v8 and evidence manifest v2. Their exact samples-<generationID>.jsonl files must begin/end with one start/stop sample, contain the required load/stream/finalization boundaries, match summary counts, have zero capture failures, and leave no gap between samples above the policy's unobserved-gap bound (twice the sampler cadence, at least 500 ms, calibrated on the M6 on 2026-09-25; 1,000 ms on the 8 GB Mac and the iPhone, provisional until an unforced record of theirs calibrates it; config/memory-qualification-policy.json). The app and engine samples of the one hosting process form one series in absolute-uptime order; they are never summed. Critical pressure, app memory warning/exit, hardTrim, or fullUnload fails publication, and so does a marking peak-equality breach (CP-2: within every take, no post-marking footprint sample may exceed the pre-marking peak beyond tolerance, and the exact MLX peak, cumulative since the request began, may not rise across the marking pass by more than one page; a marked take whose engine row lacks those MLX snapshots fails too — config/marking-peak-equality.json). Guarded pressure or softTrim publishes only as an explicit warning.

The routine per-tier cache clear (a trim-action with source post-generation and reason post_generation_cache_clear, emitted after every take where clearCacheAfterGeneration is set) is not memory pressure: records since 2026-09-25 count it as policyCacheClearCount (it stays in memoryTrimCount/maximumTrimLevel) and it raises neither the pressure level nor memory.pressure.soft_trim. Every other soft trim still warns. Older records fold the routine clear into that warning, so there memory.pressure.soft_trim alone is not an OS pressure event; zero pressure signals is not proof of leak freedom either. Use the policy-owned retained-memory lane below for bounded within-mode growth, rather than comparing unrelated peaks or interpreting initial model/cache residency as a leak.

Smoke is intentionally smaller: it asserts visible completion and History plus the runner's single-process/crash-delta checks; it does not claim the benchmark's per-take telemetry matrix.

Instruments profiles

# CPU/signpost profile (default)
scripts/macos_test.sh profile custom:speed:

# Time Profiler + Allocations + VM Tracker + signposts (keeps its raw trace by default)
scripts/macos_test.sh profile --kind memory custom:speed:

# Metal System Trace + signposts (1 cold + 1 warm medium take, 120 s cap, keeps its raw trace by default)
scripts/macos_test.sh profile --kind metal custom:speed:

# Explicit diagnostic exception: retain a CPU profile's raw Instruments document.
scripts/macos_test.sh profile --keep-trace custom:speed:

# Low-perturbation timing witness: os_signpost only, on the gate bench's seed (audit #50).
scripts/macos_test.sh profile --kind witness

The memory profile captures one cold long take so Allocations/VM Tracker include model-load and sustained-generation peaks. It uses Apple's Allocations template, which contains both memory tracks with automatic VM snapshots disabled; standalone VM Tracker auto-snapshots suspend the target and would legitimately blind its memory sampler (250 ms on the M6). Publication verifies that setting from the captured trace and still enforces the unobserved-gap gate unmodified. The default 180-second safety cap accommodates a cold long take, while target exit ends recording early. The Metal profile (--kind metal) uses Apple's Metal System Trace template plus os_signpost across 1 cold + 1 warm medium take (120-second default cap) to capture MLX GPU command buffers and shader kernels for Instruments or axiom_xcprof analysis while keeping trace size bounded. scripts/macos_test.sh memory owns the repeated retained-growth qualification.

The CPU and memory kinds sample with Time Profiler (since 2026-09-26, measurement version 4): CPU Profiler's hardware counters need root on macOS 27, and its records are never compared with Time Profiler's. Every kind first refuses a template or instrument that xcrun xctrace list does not list.

All profile kinds build the exact CLI, suspend one owned process, attach Instruments to that exact PID, resume it only after xctrace reports recording, and validate the exported trace table of contents. The memory lane enables verbose per-sample telemetry and remains PASS-only. Headless CLI profiles report the owning engine process; UI benchmarks merge the app and engine samples of their one process into one series. The tracer stage requires at least 5 GiB free for CPU and witness profiles and 15 GiB for memory and Metal profiles before it launches the target. The prerequisite CLI build uses the shared 8 GiB development-build floor, so a complete CPU or witness profile command effectively requires 8 GiB; memory and Metal remain 15 GiB. After successful trace validation and history publication, a CPU or witness profile's raw trace is deleted by default; the record retains its digest, capture settings, extracted summary, original ephemeral path, and retention status. --keep-trace is the explicit diagnostic exception. Memory and Metal profiles keep their raw traces by default (keptByDefault, several GB; prune by hand), because xctrace cannot export allocation/VM tables or Metal GPU shader tables and the trace is their only evidence. A failure retains only the newest raw failure for that platform/profile kind. Sidecars and retained diagnostics remain under build/ and untracked.

Other heavy macOS lanes also use the manifest-owned build-storage preflight before creating output: 8 GiB for deterministic/runtime builds, 12 GiB for telemetry-overhead and UI smoke, and 15 GiB for language, memory, and UI benchmark work. These are working-space floors, not cache quotas. Inspect python3 scripts/build_output_policy.py status before applying its suggested bounded cleanup.

Retained-memory qualification is a distinct non-Instruments lane:

scripts/macos_test.sh memory --label retained-check

It runs the policy-owned Custom→Design→Clone Speed/medium sequence with three canonically named retained#0...2 takes per mode (plus the CLI's genuine Custom/Design cold takes) in one process. Those retained takes still report their actual engine warm state. Policy retained-memory-v1 compares the first and last completed retained-take footprint within each mode; the maximum positive growth must stay at or below 5% of physical RAM. retained-memory-v2 (MLX active growth at the end of each take) is reported beside it and stays uncalibrated, gating nothing, until a consented run sets its bounds (telemetry-and-benchmarking.md). Intended cross-mode model residency is diagnostic and is not mislabeled as a leak. A PASS creates a memory-qualification record; a generation, memory, QC, or retention failure leaves only local artifacts.

Generated-output ownership

macOS -Onone development builds and deterministic tests reuse build/cache/xcode/macos/; the optimized CLI and every macOS UI lane (compiled at -O) reuse build/cache/xcode/macos-optimized/, so an optimized build never recompiles the -Onone arena; the TSan subset and the arm64e Enhanced Security trial CLI keep their own build/cache/xcode/macos-tsan/ and build/cache/xcode/macos-enhanced-security/; shared package checkouts live under build/cache/xcode/source-packages/. Result bundles, diagnostics, profiles, and current dSYMs are untracked artifacts under build/artifacts/, while release packaging is isolated under build/scratch/derived-data/release-macos/ and build/dist/macos/. build/Vocello.app, build/vocello and build/vocello-enhanced-security are public symlinks to current canonical products, not copied applications. See the authoritative owner/lifetime table in privacy-storage.md.

Release boundary

macOS signing, notarization, and packaging use deterministic release-readiness checks. Smoke and benchmark XCUITest results are independent frontend QA artifacts and never a packaging prerequisite.

See also testing-runbook.md, telemetry-and-benchmarking.md, and macos-release-qa.md.