Skip to content

Latest commit

 

History

History
833 lines (665 loc) · 134 KB

testing_developer_guide.md

File metadata and controls

833 lines (665 loc) · 134 KB

PinPoint Studio — Testing Developer Guide

Audience: Developers adding or running unit tests in PinPoint Studio Location: tests/ (umbrella + shared CMake module + presets), src/<Sub>/tests/ (the suites) Language: CMake + C++17/20 (GoogleTest or a hand-rolled main()) Status: 9 suites, runnable as one umbrella build or individually


Contents

  1. Philosophy — why tests are decoupled from the app
  2. The big picture
  3. How the umbrella orchestration works
  4. The shared module — tests/cmake/PinPointTests.cmake
  5. pp_add_test reference
  6. Running the tests
  7. Adding a test to an existing suite
  8. Adding a brand-new suite
  9. Conventions and gotchas
  10. File map

1. Philosophy — why tests are decoupled from the app

The app target is heavy: configuring it pulls in whisper.cpp/ggml, FFmpeg, espeak-ng (built from source), OpenCV and ONNX Runtime — on the order of 20+ seconds just to configure, before a single object compiles. A unit test for, say, pure shaft-kinematics math has no business waiting on any of that.

⚠ The QML module is no longer part of that argument, and the difference matters. The Gui suite declares the PinPointStudio QML module itself, from the same lists the app builds it from (cmake/PinPointQmlModule.cmake), so its offscreen UI tests can press real components. It still depends on no app target — the module's C++ needs only Qt, and its link closure stays inside sources other suites already compile. The invariant is decoupled from the app; never builds QML was only a proxy for it, and holding the proxy is what kept the only UI coverage in the repo out of every release gate on every platform.

So the test suites are not part of the app build. The root CMakeLists.txt forces BUILD_TESTING OFF; building the app never compiles a test. Instead each suite is a small, self-contained CMake project that recompiles only the handful of .cpp it needs and stubs out anything that would drag in the heavy dependencies (most notably PpLogStream, whose real implementation in pp_debug.cpp pulls in whisper/ggml).

Two consequences worth internalising:

  • There is no pinpoint_analysis / pinpoint_core / pinpoint_gui library. Tests list source files directly. The only real library target is pinpoint_buffer (src/Buffer), which the EventBuffer and IMU suites link.
  • Tests must be buildable offline-ish and fast. Anything a test needs that the app would normally provide (a log sink, EventBuffer::nowMicros, …) is supplied by a local stub file in the suite.

This decoupling is the property to preserve. Do not "simplify" by folding the suites into the app build under BUILD_TESTING ON — that reintroduces the heavy configure on every test iteration.


2. The big picture

tests/
├── CMakeLists.txt            # the umbrella: builds all suites at once
├── CMakePresets.json         # tests / tests-asan / tests-tsan presets
├── cmake/
│   └── PinPointTests.cmake   # shared infra: Qt prefix, Eigen, sanitizers, pp_add_test
└── MIGRATION.md              # how the suites were consolidated (historical record)

src/<Sub>/tests/
└── CMakeLists.txt            # one suite; uses pp_add_test; works standalone too

Every suite runs two ways, from the same src/<Sub>/tests/CMakeLists.txt:

  • Standalone — cmake -S src/<Sub>/tests -B <build> for fast single-suite iteration. A small bootstrap block at the top of each suite pulls in the shared module.
  • Under the umbrella — cmake -S tests -B build/tests configures all suites in one shot; the bootstrap block is skipped (the shared module is already loaded) and the suite is add_subdirectory'd.

This is the same file in both cases — there is no duplication and no "umbrella copy" of a suite to keep in sync.


3. How the umbrella orchestration works

tests/CMakeLists.txt is a thin driver:

cmake_minimum_required(VERSION 3.16)
project(pinpoint_tests LANGUAGES CXX)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(PinPointTests)        # Qt prefix, Eigen locate, sanitizers, gtest, pp_add_test
enable_testing()

# Buffer is special — see below.
add_subdirectory("${PP_REPO_ROOT}/cmake/buffer" "${CMAKE_BINARY_DIR}/Buffer-lib")
add_subdirectory("${PP_SRC}/Buffer/tests" "${CMAKE_BINARY_DIR}/Buffer")

foreach(suite Analysis Audio Core Gui IMU LaunchMonitor Pose Update)
    add_subdirectory("${PP_SRC}/${suite}/tests" "${CMAKE_BINARY_DIR}/${suite}")
endforeach()

Three details make this work:

  1. The shared module is included once, at the top. It defines pp_add_test, pp_find_eigen, the sanitizer knob and the repo-layout variables (PP_SRC, PP_BUFFER, PP_CORE, PP_THIRD). Because it is loaded before any add_subdirectory, every suite sees pp_add_test already defined — which is exactly the signal each suite's bootstrap block uses to decide it is running under the umbrella (see §7).

  2. Buffer is special-cased. Its tests live under src/Buffer/tests but are gated on PROJECT_IS_TOP_LEVEL and need the real pinpoint_buffer library target. So the umbrella adds the Buffer library first, then pulls in src/Buffer/tests directly. The IMU suite also needs pinpoint_buffer; it guards its own add_subdirectory(Buffer) with if(NOT TARGET pinpoint_buffer) so the umbrella and standalone paths don't collide ("binary dir already used").

  3. A default C++20 standard is set by the shared module. Suites added as sibling directories don't inherit a parent suite's scope-local CMAKE_CXX_STANDARD, so the shared module pins the app's standard (C++20) globally. Individual targets override with STD 17 / STD 20 on pp_add_test where they care.

One configure produces one CTest registry spanning all suites:

cmake -S tests -B build/tests
cmake --build build/tests -j6
ctest --test-dir build/tests --output-on-failure -LE qml_ui                    # every suite but the QML files
ctest --test-dir build/tests --output-on-failure -L qml_ui --no-tests=error   # then the QML files (label qml_ui), in their own pass

4. The shared module — tests/cmake/PinPointTests.cmake

include(PinPointTests) sets up everything a suite needs. It is idempotent (include_guard(GLOBAL)), so the umbrella and a standalone bootstrap can both include it safely.

What it provides:

Thing Detail
Repo layout PP_REPO_ROOT, PP_SRC, PP_BUFFER, PP_CORE, PP_THIRD
Qt prefix The newest ~/Qt/<version>/<abi> carrying a Qt6Config.cmake (macos, gcc_64, msvc2022_64), unless -DCMAKE_PREFIX_PATH / env already set. Compared by version, not sorted, so 6.10 beats 6.9. If none is found it says so rather than silently letting CMake find some other Qt.
Qt + Threads find_package(Qt6 Core Gui) and find_package(Threads) once. Suites needing more (Qml, Bluetooth, OpenCV, Test for QSignalSpy) add their own — cheap and additive.
C++ standard Default C++20 (app/Buffer parity); per-target STD overrides.
pp_find_eigen(<out>) One Eigen locator: explicit -DPP_EIGEN_DIR, then any app build's build/*/_deps/eigen-src (matched regardless of build-dir name), then fetch 3.4.0.
pp_apply_sanitizers(<tgt>) Applied automatically by pp_add_test from the PP_SANITIZE cache var.
pp_require_gtest() Lazily fetches GoogleTest the first time a suite links it — gtest-free suites never pay for it. Called automatically by pp_add_test when GTEST/GTEST_NO_MAIN is requested.
pp_add_test(...) The canonical test-target helper (see §5).

Eigen — the bug this fixed

Before consolidation, src/Analysis/tests globbed build/*/_deps/eigen-src (correct) while src/IMU/tests hardcoded the Linux build-dir name (build/Desktop_Qt_6_11_0-Debug/...). On macOS that path never matched, so eskf_gyro_units_test was silently skipped — not failed, just absent. The single pp_find_eigen() routine removed that whole class of per-suite path drift. Always resolve Eigen through it.

Sanitizers — one knob

All suites share -DPP_SANITIZE:

cmake -S tests -B build/tests-asan -DPP_SANITIZE="address;undefined"
cmake -S tests -B build/tests-tsan -DPP_SANITIZE=thread

Use a separate build dir per sanitizer config (the flags bake into objects). pp_add_test applies them to every target automatically.

Two gotchas that have each cost an afternoon:

  • The Buffer suite follows this knob through libbuffer. -DPP_SANITIZE reaches pinpoint_buffer and its three suites, and is passed to libbuffer as LIBBUFFER_SANITIZE (pp_require_libbuffer() in tests/cmake/PinPointTests.cmake), so the ring code a TSan run exercises is instrumented. (Before the split the Buffer kept its own PINPOINT_ENABLE_* options, and an umbrella TSan run never instrumented the ring.) The library's own suites run under its asan and tsan presets.
  • Never set detect_leaks=1 on arm64 macOS. LeakSanitizer is unsupported there, and every test aborts at exit — a whole suite reporting as failing, with nothing wrong. ASan itself is fine; it is only the leak detector.

5. pp_add_test reference

pp_add_test(<name>
    SOURCES <files...>            # required — test .cpp + the production .cpp it needs
    [LINK <libs...>]              # extra link libs (Qt6::Qml, ${OpenCV_LIBS}, pinpoint_buffer, …)
    [INCLUDE <dirs...>]           # extra include dirs (PP_BUFFER is always added)
    [DEFINES <defs...>]           # extra compile definitions
    [COMPILE_OPTIONS <opts...>]   # e.g. -O2 for timing-sensitive tests
    [STD 17|20]                   # CXX_STANDARD for this target (default: C++20)
    [AUTOMOC]                     # the test or its sources contain Q_OBJECT / QML_ELEMENT
    [GTEST]                       # link GTest::gtest_main (gtest supplies main())
    [GTEST_NO_MAIN]               # link GTest::gtest (the test supplies its own main())
    [NO_QT])                      # do NOT auto-link Qt6::Core/Gui (e.g. OpenCV-only math)

Behaviour:

  • By default the target links Qt6::Core + Qt6::Gui and adds PP_BUFFER to the include path (types.h is near-ubiquitous). Pass NO_QT for a pure OpenCV or header-only math test.
  • GTEST / GTEST_NO_MAIN trigger the lazy GoogleTest fetch. Use GTEST_NO_MAIN when the test needs its own main() — e.g. to spin a QCoreApplication for a Q_OBJECT + QTimer class.
  • Every target is registered with CTest (add_test) and gets sanitizer flags from PP_SANITIZE.

Examples (real, from the suites):

# Pure header-only math.
pp_add_test(wrist_angles_test SOURCES wrist_angles_test.cpp)

# OpenCV-only, no Qt, optimised hot loop.
pp_add_test(shaft_tracker_test
    SOURCES shaft_tracker_test.cpp ${ANALYSIS}/shaft_tracker_math.cpp
    INCLUDE ${OpenCV_INCLUDE_DIRS}  LINK ${OpenCV_LIBS}
    COMPILE_OPTIONS -O2  NO_QT)

# GoogleTest + profiler core + a log stub (no whisper).
pp_add_test(pp_profiler_test
    SOURCES pp_profiler_test.cpp ${PROFILER_CORE}
    INCLUDE ${CORE}  LINK Threads::Threads
    DEFINES PINPOINT_PROFILE_BASELINE=1 PINPOINT_PROFILE=1  GTEST)

# Q_OBJECT controller with its own main().
pp_add_test(profiler_controller_test
    SOURCES profiler_controller_test.cpp ${MONITOR}/profiler_controller.cpp ${PROFILER_CORE}
    INCLUDE ${CORE} ${MONITOR}  LINK Threads::Threads
    GTEST_NO_MAIN  AUTOMOC)

Platform-specific bits that don't fit the keyword form (Apple .mm Metal backends, dxgi on Windows) are applied after the pp_add_test call with plain target_sources / target_link_libraries — see the GPU-metrics targets in src/Core/tests/CMakeLists.txt.


6. Running the tests

Everything at once (umbrella)

cmake -S tests -B build/tests
cmake --build build/tests -j6
ctest --test-dir build/tests --output-on-failure

A single suite (standalone — fastest iteration)

cmake -S src/IMU/tests -B build/imu-tests
cmake --build build/imu-tests -j6
ctest --test-dir build/imu-tests --output-on-failure

(The Qt prefix is auto-resolved; pass -DCMAKE_PREFIX_PATH=/path/to/Qt/6.11.x/<abi> only if Qt is installed somewhere non-standard.)

Via presets

tests/CMakePresets.json defines tests, tests-asan, tests-tsan. CMake reads CMakePresets.json from the current directory, so run them from tests/:

cd tests
cmake --preset tests
cmake --build --preset tests
ctest --preset tests

Useful CTest filters

ctest --test-dir build/tests -R shaft        # only tests whose name matches /shaft/
ctest --test-dir build/tests -j6 -LE qml_ui  # run tests in parallel (keep the QML files in their own pass: -L qml_ui)
ctest --test-dir build/tests --rerun-failed --output-on-failure

On the studio PC — tools/studio/studio-build.cmd

The studio PC's test tree is build\tests-vs18 (Debug, NMake JOM, the tests/ umbrella). Two modes of tools/studio/studio-build.cmd use it; the script's header has the details and the exit codes.

  • tests builds the tree, then runs both passes (-LE qml_ui, then -L qml_ui), with the real stores checked around them. tools/method/cabin_run.sh runs it.
  • build does the same steps up to and including the build, then stops: no ctest pass, no settings snapshot. tools/method/build_times.sh times it. With nothing changed it takes about 1–2 minutes, e.g. studio-build.cmd build pull jobs 16.

Both refuse while PinPoint Studio, Foresight, FSX or GSPro runs, take patch <file> and jobs N (1 to 24, default 16), and write tests_cmake.log, tests_build.log and tests_summary.log under C:\PinPointStudio\scratch\studio-build\.

The performance baseline, tools/method/cabin_perf_baseline.sh, is run on demand from the Mac, on an idle studio PC, with the owner told first. It runs build_times.sh, then, under the cabin lock, the release and build modes and tools/method/cabin_perf.py: eight fixed corpus swings through swinglab_run with peak GPU memory, and post_shot_bench's p50 and p95 (a Debug build). It appends one row per commit to /mnt/swingdata/scratch/perf/history.csv. --dry-run and --self-test touch neither the share nor the cabin; its header lists the columns.

The QML UI suite — the qml_ui label

Each tst_*.qml in src/Gui/tests/qml/ is its own ctest test, qml_ui.tst_<file>: the one qml_ui_test binary run with -input <that file>, offscreen, with its own TIMEOUT (src/Gui/CMakeLists.txt, set from the times measured on the Mac and on the studio PC's Debug build). All of them carry the label qml_ui. A new file is registered at the next configure.

ctest --test-dir build/tests -L qml_ui -j3 --output-on-failure    # every QML file, in parallel
ctest --test-dir build/tests -LE qml_ui -j3                       # everything except the QML files
ctest --test-dir build/tests -R '^qml_ui\.tst_session_report$' --output-on-failure   # one file

Until platform refactor B0.2b (#251) the whole suite was one test, qml_ui, running every file in one process, so one slow or stuck file hid every file after it. The old name maps like this: -R '^qml_ui$' → -L qml_ui, and -E '^qml_ui$' → -LE qml_ui. The old name no longer exists, and ctest exits 0 when -R matches nothing, so a script still using it silently runs no QML. Run the label as a pass of its own, not mixed into a -j run of the compute-bound suites: a starved render loop is what once made this suite flaky. The binary still runs a file directly, for its full report: build/tests/Gui/qmlui/qml_ui_test -platform offscreen -input src/Gui/tests/qml/tst_pp_chip.qml (add -v2 for every check, -o out.xml,junitxml for per-function times).

Wait for layout with waitForPolish, never waitForRendering (#254). waitForRendering(item) returns on the next rendered frame or after its timeout (5 s by default). When a change draws nothing new, no frame comes, so the call sleeps the whole 5 s. That was 400 s of the old tst_session_diagnostics.qml's 427 s on the Mac (80 of its 974 calls). A Row, Column or ListView lays out on polish, so a test that is about to read geometry waits for polish on the window. See laidOut() in src/Gui/tests/qml/diag/SessionDiagnosticsCase.qml: wait(0), then waitForPolish(item.Window.window) while isPolishScheduled says one is pending, and verify the result so that a layout which never settles fails rather than passing late. Wait on the window rather than an item, because an item's own flag says nothing about the positioners inside it. The session diagnostics tests are five files, tst_session_diagnostics_<part>.qml, split along the old file's section headers. They share a harness in src/Gui/tests/qml/diag/: SessionDiagnosticsProbe.qml holds the body, fakes, spies and fixtures, and SessionDiagnosticsCase.qml holds the helpers and the one init().


7. Adding a test to an existing suite

  1. Drop my_thing_test.cpp into src/<Sub>/tests/.
  2. Add one pp_add_test call to that suite's CMakeLists.txt, listing the test plus any production .cpp it must compile (remember: there is no library to link — name the sources). Reach for the right flags from §5.
  3. If the production code touches PpLogStream, add src/Core/pp_log_stream.cpp and src/Core/PpMessageLog.cpp to SOURCES — that is the real application log and it costs Qt and nothing else. Do not pull in pp_debug.cpp: that one still drags in whisper/ggml, because it also installs the message handler and silences whisper, ggml, OpenCV and FFmpeg.
  4. If it checks a requirement, label it after the pp_add_test (and after any set_tests_properties(… LABELS …), which replaces a test's labels): pp_requirement(my_thing_test REQ-ANA-8). It appends the ids as ctest labels, so ctest -L REQ-ANA-8 runs a requirement's tests, and the on-demand traceability report (python3 tools/method/make_rtm.py) lists it against the requirement. A QML test names its ids with // REQ: REQ-REV-5 lines in its tst_*.qml file instead. A habit, not a gate: an unlabelled test is fine (BT-39).
  5. Build + run standalone, then once under the umbrella.

For reference, every suite's CMakeLists.txt begins with this bootstrap so it works standalone and under the umbrella — you won't normally touch it:

# Standalone bootstrap: pull in the shared module when configured on our own.
# Under the umbrella pp_add_test already exists, so this block is skipped.
if(NOT COMMAND pp_add_test)
    cmake_minimum_required(VERSION 3.16)
    project(pinpoint_<sub>_tests LANGUAGES CXX)
    list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../tests/cmake)
    include(PinPointTests)
    enable_testing()
endif()

8. Adding a brand-new suite

Put tests next to the code they exercise, in a tests/ subfolder of that subsystem — src/<NewSub>/tests/. This keeps the relative ../foo.cpp includes short and the co-located stubs/fixtures obvious. (Don't create a single global tests/ dump of all test sources — only the orchestration is centralised, not the test files.)

A tests/ folder does not have to mean a new suite. src/Diagnostics/tests/, src/Stores/tests/ and src/Vocabulary/Metrics/tests/ hold sources with no CMakeLists.txt of their own — the Analysis suite compiles them by absolute path (SOURCES ${SRC}/Stores/tests/swing_doc_test.cpp …), because each links swing_analysis.h or the pack value types and a separate project would duplicate that whole dependency set for a handful of targets. Prefer this when the new tests would pull in the same dependencies as an existing suite; add a real suite only when the dependency set genuinely differs.

  1. Create src/<NewSub>/tests/CMakeLists.txt starting with the bootstrap block from §7 (substitute the project name).
  2. Add your pp_add_test calls.
  3. Register the suite in the umbrella — add its name to the foreach list in tests/CMakeLists.txt (or, if it needs a library like Buffer, add a dedicated add_subdirectory with the same special-casing).
  4. Verify standalone, then under the umbrella.
  5. Add a one-line entry to the suite catalog in BUILDING.md.

If the new suite needs Eigen, call pp_find_eigen(<var>). If it needs a dependency the shared module doesn't find_package (OpenCV, Qt6::Bluetooth, Qt6::Qml), find_package it in the suite — that is additive and cached.

⚠ The QML UI suite is the one target that does not follow step 2, and it is worth knowing why before copying it. pp_add_test cannot express it — that helper uses plain add_executable and hardcodes Qt6::Core/Qt6::Gui, with no hook for a test ENVIRONMENT — so qml_ui_test is spelled out by hand. It also lives in src/Gui/CMakeLists.txt rather than src/Gui/tests/, pulled in by add_subdirectory: qt_add_qml_module names each file's qmlcachegen output directory after the path relative to CMAKE_CURRENT_SOURCE_DIR, so declaring it from tests/ yields qml_ui_test_../theme — which POSIX resolves and ninja on Windows rejects outright. src/Gui is an ancestor of all 157 QML files, so the paths come out clean. Anything else declaring a QML module from a test directory will hit the same wall.


9. Conventions and gotchas

  • Test framework is per-suite, not enforced. Buffer, Core, Update and LaunchMonitor use GoogleTest; Analysis, Audio, Gui, IMU and Pose use a hand-rolled main() + CHECK/CHECK_NEAR macros. Both are fine — match the suite you're editing.

  • AUTOMOC is per-target now. The old suites set a global CMAKE_AUTOMOC ON; with pp_add_test you pass AUTOMOC on the targets that have Q_OBJECT / QML_ELEMENT. Forgetting it shows up as undefined-symbol link errors for the class's signals/vtable.

  • A Q_OBJECT header with no paired .cpp must be listed in SOURCES. AUTOMOC moc's a header automatically when it shares a basename with a compiled .cpp (e.g. foo.h ↔ foo.cpp). A pure-interface or test-double header that has no matching .cpp (e.g. an abstract base, or a FakeXxx test double) is not picked up just by being #included — list the .h itself in SOURCES so AUTOMOC generates its moc_*.cpp. Symptom otherwise: undefined reference to vtable / staticMetaObject for that class. (The Update suite lists update_backend.h and fake_update_backend.h for exactly this reason.)

  • QSignalSpy lives in Qt6::Test, not Core/Gui. A suite that spies on signal emissions/ordering must find_package(Qt6 COMPONENTS Test) and LINK Qt6::Test.

  • Compiling a real settings-backed class? Make an IsolatedStores first. The Update policy test compiles the real AppSettings/SessionController (they expose exactly the API the controller touches) rather than maintaining doubles. AppSettings reads and writes through ppSettings(), so the test's main() makes a pinpoint::test::IsolatedStores before QCoreApplication, and it never reads or writes the developer's real settings file. Test mode alone does not do that (see "Per-user stores" below).

  • Never link pp_debug.cpp — it pulls in whisper/ggml for PinPointDebug::install(), which silences whisper, ggml, OpenCV and FFmpeg at startup. Link pp_platform instead (LINK pp_platform): its pp_log_stream.cpp + PpMessageLog.cpp are ppWarn()/ppInfo() itself, and need Qt and nothing more. A test never lists a ring library's source (library_membership_lint_test).

    Until 31 Aug 2026 the log primitive lived in pp_debug.cpp, so every suite linked a stub that satisfied the linker and threw every log line away — Core/tests/pp_log_stub.cpp (six suites), plus copies in Analysis/tests/imu_test_stubs.cpp and Pose/tests/pose_test_stubs.cpp. All of them now carry the real log, so a test can assert on a line instead of discarding it. Core/tests/pp_log_stub.cpp, which nothing used, was deleted with the ring libraries (#424): a stub may stand in only for a symbol no linked library holds. (Gui/tests/reanalysis_stubs.cpp is a different thing: it stubs the re-analysis worker body, not logging.)

  • C++20 unless you say otherwise. Anything pulling in event_buffer.h → swing_window.h (std::span) needs C++20 — that's the default, so it just works; only set STD 17 to deliberately pin an older standard.

  • Sanitizers need their own build dir. Don't reconfigure an existing dir with PP_SANITIZE — make build/tests-asan / build/tests-tsan.

  • Windows/MSVC: the OpenCV-using suites (Analysis, Pose) need -DOpenCV_DIR=... at configure (the app's auto-probe isn't in the test projects), and CTest needs Qt's bin + OpenCV's bin on PATH or the test exes fail with 0xc0000135 (DLL not found).

  • build/ is gitignored. Build dirs are disposable; never commit them.

  • Never name a lambda emit. It is a Qt keyword macro. The symptom is not "redefinition" but a wall of left operand of comma operator has no effect on every call site, because the macro expands to nothing and push(a, b, c) becomes a comma expression.

  • A find() helper returns a pointer INTO a vector — bind the vector. The pointer from find(buildXSeries(...), "key") dangles the moment the full expression ends, so keeping it for the next line reads freed memory, and the crash is a null deref somewhere later that looks nothing like the cause. club_delivery_test was written that way first and segfaulted; every call there now goes through a named const auto. The product's lookups of this shape (a pointer or reference into an argument, or into *this) refuse a temporary at compile time: a deleted const T && overload beside a free function, a const & qualifier with a deleted const && twin on a member. Give a new test helper of the shape the same deleted overload. To read a temporary's value in one call, use a helper that returns the value, not the pointer (valueAt in dtl_posture_test, stateOf in characteristic_engine_test).

  • Make a synthetic swing look like a swing, in TIME as well as geometry. Producers resolve their address reference over a ±250 ms window about the Address event. A fixture compressed into 160 ms puts the TOP inside that window and contaminates the very reference the metric is measured against — which reads as a producer bug and is not one. body_rotation_test builds ~1.6 s at 240 fps for exactly this reason.

  • A decision that reads live app state cannot be tested — extract the decision. Not the same as "add a fake": if a policy reads five things off four controllers, the testable part is the JUDGEMENT, and the untestable part is the GATHERING, which is also the part that is hard to get wrong. decideStandalone() (src/LaunchMonitor) takes seven booleans and returns a verdict; the controller only fills the struct. The same split is why linux_update_logic.cpp exists. The tell that you need it: the policy has already behaved differently on a real machine than it did on paper — the launch monitor's did that twice, once because a precondition was missing entirely and once because the whole path sat behind a setting that was off, and neither was a coding error that any amount of care in the controller would have caught.

  • Enumerate the state space when it is small enough to enumerate. Seven booleans is 128 states; standalone_gate_test walks all of them and asserts exactly one records. Sampling the interesting-looking ones would not have caught a precondition added later without a thought about ordering. Where the combination count is small, exhaustive is cheaper to write than choosing representatives and arguing about the choice.

  • Return a verdict, not a bool, when several things can be false at once. Which reason gets reported is a decision somebody should be able to read and revisit, and it belongs in a test rather than in the order the ifs happened to be written. standalone_gate orders configuration before current state so a user still setting up hears about the setting rather than about capture — and there is a test asserting exactly that precedence, plus one asserting every refusal carries a reason.

  • Pin the REAL captured bytes, not a tidied version of them. gcquad_csv_parser_test embeds the actual FSX2020 row verbatim — trailing comma, CRLF and all — because the format's quirks are the thing most likely to break, and a fixture retyped into what the format "obviously" is tests the author's belief rather than the device. The same reason fake_shot.py copies the exemplar's header byte for byte instead of composing one.

  • Assert SIGNS on synthetic tracks, accuracy on a corpus. A sign is the one thing a synthetic fixture can pin exactly, and it is also the thing that silently grades every swing backwards when it is wrong. upper_body_metrics_test runs its whole sign suite twice — once normally, once through a MIRRORED camera with a left-handed golfer — because a convention that only holds for a right-hander filmed from one side is not a convention.


The session-setup UI suite — session_setup_ui

session_setup_ui_test (declared beside qml_ui_test in src/Gui/CMakeLists.txt; tests, fakes and drivers in src/Gui/tests/setup/) loads the real session-setup and calibration QML over fake cameras, sensors and a fake HackMotion device. session_setup_lint_test reads the same sources statically. Design and results: docs/design/session_wizard_refactor_design.md §7 and §11.

  • Opt-in — not in the full suite or the release gate (2026-10-17). It passes on an idle machine but crashes in Qt's render path on a loaded one: on Windows at the v0.1-beta5 gate, and on Linux the same week (offscreen + RHI got a GL 2.0 context — 43 101 "No GLSL shader code found" warnings, enough to crash QTest's failure formatter — then a render-thread race in QQuickWindow::afterFrameEnd). Configure with -DPP_SESSION_SETUP_UI_TEST=ON to build and register it. session_setup_lint_test still reads its sources and stays in the gate.
  • Run: cmake -S tests -B build/tests -DPP_SESSION_SETUP_UI_TEST=ON, then ctest --test-dir build/tests -R '^session_setup' (about nine minutes, on an otherwise idle machine). One file by hand: QT_QPA_PLATFORM=offscreen QT_QUICK_BACKEND=rhi QSG_USE_SIMPLE_ANIMATION_DRIVER=1 build/tests/Gui/qmlui/session_setup_ui_test -input src/Gui/tests/setup/<file>.qml (windows instead of offscreen on Windows). Test QML is read from the source tree at run time; production QML is compiled in.
  • It cannot make a sound. The real TingPlayer is filtered out of the target and tests/setup/silent_ting_player.h takes its QML name. Keep it that way: the suite completes dozens of calibrations.
  • Offscreen draws nothing. Behaviour cases run headless; the render cases in tst_setup_guide_render.qml skip there and need QT_QPA_PLATFORM=cocoa (or windows) on a visible desktop. SETUP_GUIDE_GRABS=<dir> saves the frames.
  • Every case fails on an unexpected QML warning (testLog). A binding that breaks at run time has no build error; this is what catches it.
  • Never construct AppSettings in a test before the suite's IsolatedStores (or a QSettings::setPath(IniFormat, UserScope, <scratch>)). QStandardPaths::setTestModeEnabled does not move the app's ini, and the constructor writes (the one-time impact-strip move, camera/impactRoiMigrated; the imu/placement → imu/roles migration it wrote went with the sensors' cut-over: the Rig's copy reads that move and writes nothing). qml_ui_test's set-up object makes one as its first member.
  • Each test file gets its own settings store (2026-11-11, #171), in this harness and in qml_ui_test. Quick Test gives every tst_*.qml its own engine, so Theme starts fresh, but a shared ini did not: Theme writes the theme, density and the like back through appSettings, the fakes wrote imuRoles (a fresh FakeRig per test holds the sensors' roles since the sensors' cut-over), and the next file read them, so a test could pass in the full run and fail alone. qmlEngineAvailable() now points QSettings at <scratch>/file<N> per file and stops if the scratch directory is invalid. A file that changes the theme or a setting still puts it back in cleanup(), so tests within one file stay independent, and a test that needs a theme sets it.
  • On Windows it runs in a real window (QT_QPA_PLATFORM=windows, set by the ctest environment; by hand use windows in the line above). Offscreen + RHI has no working Quick 3D on Windows (2026-10-08): D3D11 cannot create a swapchain for an offscreen window ("Access is denied", then a warning every frame) and OpenGL aborts. The suite's window shows on screen while it runs — keep it unoccluded, or its render loop and Timers starve.
  • Every test window holds a View3DKeepAlive (in support/CalibDriver.qml, support/SetupDriver.qml and the files that use neither). Qt 6.11.0's DEBUG Quick 3D crashes the render thread when a window's LAST View3D is destroyed — every time, on a plain View3D unloaded from a Loader; Qt's release libraries survive it. That was the suite's crash in the HackMotion calibration file (QSSGRenderCamera::markDirty + 0xfeeefeee). The app holds one in each top-level window for the same reason; src/Gui/viz/View3DKeepAlive.qml has the bisection, src/Gui/tests/probes/view3d_unload.qml checks the app.
  • The test target embeds the shaders the app's QML loads (view gain, topo background, Bayer demosaic) at the app's resource paths. A missing one is an "Empty shader passed to graphics pipeline" warning on a real D3D11 window — and a failed case.

Per-user stores — IsolatedStores and store_isolation_lint_test

Every suite that can reach a per-user store makes a pinpoint::test::IsolatedStores (src/Core/tests/isolated_stores.h, header-only; #187) before it touches one, and keeps it alive for the whole run:

  • A main() suite: the first line of main(), before QCoreApplication: pinpoint::test::IsolatedStores stores;
  • A QTest suite: the first member of the test class, so it is made before every other member and before initTestCase.
  • A gtest suite: the first line of its own main(); with gtest_main, a file-scope static pinpoint::test::IsolatedStores g_stores;.
  • Include it by relative path, e.g. #include "../../Core/tests/isolated_stores.h" from src/<Dir>/tests/. pp_add_test adds no include directory for it, so adding it rebuilds only the suite's own file.

What it does, against one fresh QTemporaryDir per process, so two runs at once or two build trees never share a file:

  • The settings. QSettings::setPath for IniFormat and NativeFormat, UserScope and SystemScope. ppSettings() (the settings and the phone pairings) is then <tmp>/settings/PinPointStudio/PinPointStudio.ini on every platform. Qt honours NativeFormat's path only on Linux; no product code uses it.
  • Test mode. QStandardPaths::setTestModeEnabled(true). Qt cannot point the standard locations into a temporary directory on macOS or Windows; only Linux honours XDG_*. So they move to Qt's test folders: ~/.qttest/… on macOS and Linux, %APPDATA%\qttest\… and %LOCALAPPDATA%\qttest\… on Windows. Those are off the real profile but shared by every run of the same suite. On macOS, Home, Documents and the Desktop move too (~/.qttest); on Windows they do not.
  • The app's own folders, through their seams:
    • PINPOINT_DIAGNOSTICS_DIR=<tmp>/diagnostics is diagnosticsDataDir(): every user pack, norm set, screen, drill, gate-word and reference layer.
    • PINPOINT_STUDIO_DIR=<tmp>/studio is the studio profile's folder.
    • PINPOINT_RIG_DIR=<tmp>/rig is the Rig's folder (RigStore::defaultFolder(), rig.json, FILE-APP-07).
    • A suite that sets one afterwards wins (report_studio_test).
  • No system trash. PINPOINT_NO_SYSTEM_TRASH=1: the stores' one seam (SwingPaths::systemTrashAllowed(), asked by SwingPaths::trashPath and the athlete store's trash) then sends every discarded session, swing or athlete to the library's own .pinpoint-trash, as on a volume with no trash. The temporary directory is on the boot volume, so without it a discard reached the machine's Trash (#394, 27 Nov 2026).
  • The library. libraryRoot() is <tmp>/library, for a suite to hand to a store. The stores' no-root fallback (AppDataLocation/swings) has no seam; under the helper it is the test folder.
  • Checking a path. contains(path) says whether a path lies inside the temporary directory. Both sides are canonicalised (macOS /var and /private/var, Windows case), and a path not yet written counts too.
  • No restore. It never restores anything when it is destroyed. If no temporary directory can be made, it stops the run (qFatal) rather than fall back to a real store.

A suite that wants a finer store of its own (one settings file per test, ppcp_*, athlete_repository_test, qml_ui_test's one per QML file) still makes the helper first, then calls QSettings::setPath again: the later path wins.

isolated_stores_test (Core suite) proves the redirections through the app's own path helpers, so a renamed seam fails there. With the helper on:

  • ppSettings().fileName(), a value written through it, diagnosticsDataDir(), StudioProfile::studioDir() and libraryRoot() lie inside the temporary directory;
  • the app-data, cache and config locations, and the library's fallback, are not the real ones;
  • the system trash is off, and a session discarded with it asked for lands in the library's own trash (run only once the switch is seen, so a failing run never reaches the real Trash).

It prints where Home, Documents and the Desktop point.

store_isolation_lint_test (registered by the umbrella, tests/CMakeLists.txt) stops an executable forgetting it, or making it late:

  • The rule: every executable of the umbrella that compiles a source calling ppSettings(), or links a library that does, must make an IsolatedStores first, in its own sources. First means the first statement of main(), the first member of a class (after Q_OBJECT and access labels), or a namespace-scope object (a file-scope static). A helper made later (a later statement or member, inside a test function or a nested block) fails, and so does one that only a linked library makes. The lint names the executable, the files that reach the settings (and the library each is in), and where its helper is.
  • Every executable, not only the ones a test is named after. An executable that must read the real settings is a named decision in the lint's own code (kExemptions, each with its reason), never an allowlist line:
    • tools run by hand on a scratch copy, which no test may run, each with its own reason in the code. They only read the real settings: ui/diagnosticsNormSetsOff and ui/diagnosticsGradePolicy (SET-06 and SET-15, which RuleData reads on every load), and for some the [athletes] records (AthleteStore). post_shot_bench turns test mode on to keep the user's data out, but test mode does not move the settings file. diag_uncertainty_report, measure_dump and variability_calibrate reach the settings only incidentally, through the process's RuleData (and, for the first, AthleteStore). The Python bridge's two backends, pps_swingdoc and pps_truth, read no settings at all, so they make IsolatedStores first and need no exemption (the owner, 29 Nov 2026). Two more are driven by a test through cmake -P (athlete_dump by athlete_dump_ids_test, regrade_ledger by regrade_ledger_new_needs_ini_test; the studio PC excludes those two tests). The tests that run each tool are read from the build tree's CTestTestfile.cmake files: a test that runs an exempt tool undeclared fails;
    • isolated_stores_test, which may make the helper late, because measuring the real locations first is what it proves;
    • an exemption that no longer reaches the settings, whose declared test no longer runs it, or whose helper is now first, fails as stale.
  • The manifest: at the end of every configure, the umbrella writes store_isolation_manifest.txt: every executable and in-tree library target, its type, its sources, the in-tree targets it links (LINK_LIBRARIES, INTERFACE_LINK_LIBRARIES, $<TARGET_OBJECTS:…>, aliases resolved), and every test name. The lint follows the links transitively. It is plain CMake, so it works under Ninja and NMake JOM.
  • Comments and strings don't count. The sources are read at run time with them blanked. The rule runs on fixtures first (a library two links away that calls ppSettings(), a helper that comes second, a stale exemption, an undeclared tool run).
  • What it does not see:
    • an inline ppSettings() in a header the target does not list;
    • code that reaches only QStandardPaths (the pack readers). That is a folder named after the test binary, never the app's;
    • an earlier file-scope static that touches a store before the helper is made: "first" is read from the code's shape;
    • "the first member" is of any class: a helper first in a gtest fixture passes, though a fixture is made per test;
    • a test that runs a tool through a script that finds the tool itself, or names it only in its ENVIRONMENT: only add_test command lines are read.
  • Why a lint and not a hash: a hash of the real store around the run cannot see a read, which is what kept 45 suites off the studio PC, and it cannot say which suite changed the store.

The packs and norms — RULE_DATA_SOURCES and installProcessRuleData()

Since refactor step 3.2 the packs, norms and content sets have one owner, RuleData (src/DomainModel/rule_data.h), and one door to their files, RuleDataStore (src/Stores/rule_data_store.h). Nothing assembles a private pack any more: every reader takes RuleData::current()'s snapshot, directly or through the interim accessors (makeCharacteristicPackProvider(), sharedDrillSet(), …). So a test that reads them:

  • links ${RULE_DATA_SOURCES} (defined in src/Analysis/tests/CMakeLists.txt and src/Gui/tests/CMakeLists.txt) and is AUTOMOC (RuleData is a QObject);
  • calls pinpoint::installProcessRuleData() (src/Stores/rule_data_install.h) on the main thread, after it has set its PINPOINT_CORE_* seams and moved its data location (QStandardPaths::setTestModeEnabled, setApplicationName), and before anything reads. With none installed every accessor answers from an empty snapshot;
  • after changing a seam or a data location mid-run, calls installProcessRuleData().reload(parts): one snapshot per change, so a test that swaps the core pack is a change RuleData must be told about;
  • likewise after removing or hand-writing a user file (user.json, user.norms.json, …) once RuleData is installed: since step 3.9 the pack and corridor editor (ModelBrowser) reads RuleData's snapshot, never the files, so model_browser_test and inspector_refresh_test call RuleData::installed()->reload() after clearing their scratch files.

A probe of the running app keeps its saves off the real user files with PINPOINT_DIAGNOSTICS_DIR and the machine's rig off the real rig.json with PINPOINT_RIG_DIR (docs/developer/feature_switches_developer_guide.md); on macOS the app data location ignores XDG_DATA_HOME.

A save through RuleData's commands publishes at once (EVT-12 / EVT-13); there is no "written but not yet reset" state. shared_norm_provider_test deliberately installs none: it is the headless norm slot's test. rule_data_test is the owner's own.

The headless start for probes — PINPOINT_HEADLESS_PROBE=1 and headless_probe_test

Every agent probe uses PINPOINT_HEADLESS_PROBE=1, and every probe launch goes through tools/probe/run_headless.sh (the one exception is headless_probe_test, below, which builds its own scratch and passes each variable as a separate argument). Environment assignments typed before a command can reach the app as one word or not at all, and the app then starts for real against the real home, settings and library, so the launcher builds the environment itself, refuses a home, settings file or library outside scratch, and kills within a second an app whose process lacks the switch.

tools/probe/run_headless.sh --app <PinPointStudio> --home <scratch>/home \
  --settings <scratch>/cfg/PinPointStudio/PinPointStudio.ini --probe <abs path to the probe> [--timeout 120] \
  [--env PINPOINT_<seam>=<value>]... -- [app args]
  • Refused (exit 2, nothing launched) unless --home, --settings, --log and the settings file's [%General] athleteLibraryPath are strictly beneath /mnt/swingdata/scratch/, the repository's build/, or the session scratchpad /private/tmp/claude-<uid>/, after symlinks are resolved (a .. component or whitespace is refused; so are /mnt/swingdata itself, an athlete folder, and any other setting pointing into the share). The app reads its settings as $XDG_CONFIG_HOME/PinPointStudio/PinPointStudio.ini, so --settings must be named that way; the launcher sets XDG_CONFIG_HOME to the folder above it. A binary named PinPointStudio that lacks the switch's log text is refused too.
  • The environment is passed through /usr/bin/env -i, one argument each: PINPOINT_HEADLESS_PROBE=1, QT_QPA_PLATFORM=offscreen, PINPOINT_LOG_STDERR=1, HOME and CFFIXED_USER_HOME (the scratch home), XDG_CONFIG_HOME, PINPOINT_DIAGNOSTICS_DIR=<home>/diagnostics, PINPOINT_RIG_DIR=<home>/rig, TMPDIR=<home>/tmp, a system PATH, LANG, and each --env (PINPOINT_* names only, for seams such as PINPOINT_WORKONS_DIR; a path value must be scratch or inside the repository).
  • The check (exit 3). Within a second of the launch the running process's own environment is read (macOS ps -E, Linux /proc/<pid>/environ); without PINPOINT_HEADLESS_PROBE=1 and the scratch HOME, or if it cannot be read, the process is killed with SIGKILL.
  • The run. stderr is teed to a log whose path is printed first (default <home>/run_headless-<time>-<pid>.log); --timeout (default 120 s) stops the app and exits 124; otherwise the app's exit code passes through.
  • run_headless_selftest (ctest, Gui suite; tools/probe/run_headless_selftest.sh, about 10 s) proves the refusals, the kill path (through the --_test_drop_switch and --_test_wrong_home hooks, which the launcher refuses for the real app), the exact environment, the exit code and the timeout, with a stand-in binary it compiles. It never launches the app.

A plain launch of PinPoint Studio, offscreen included, starts the device side at once, and on macOS that raises the Bluetooth, Speech Recognition and Microphone permission prompts on whoever's screen the session is on. With PINPOINT_HEADLESS_PROBE=1 the app starts with none of it (refactor 4-c; src/Core/headless_probe.h):

  • Not started, each said once in the app log as [HeadlessProbe] not started: <part>: Bluetooth (the IMU manager's adapter list and scan), the microphone and speech recognition (the transcription controller's permissions and threads), speech output (the TTS controller's speaker, worker and voice), the cameras (the camera manager's device list), the launch monitor (its connector: Kind::None), the phone link (the PPCP host's listener, discovery and advertising), the pose model's launch warm-up (unless PINPOINT_PROBE_WARMUP=1 asks for it: the quit pins, below) and the pose timing benchmark.
  • The controllers QML binds to are still made, inert, so every screen loads and reads empty device lists.
  • A backstop below them. The macOS permission requests and the Bluetooth adapter list and scan refuse under the switch and log [HeadlessProbe] REFUSED <call>, so a path the switch missed raises no prompt either.
  • Only the exact value 1 turns it on. Unset, or any other value, it changes nothing. A golfer never sets it.

What the launcher sets up, by hand (for reading, not for launching): a probe run, with its saves kept off the real files (HOME, CFFIXED_USER_HOME and XDG_CONFIG_HOME at a scratch home whose PinPointStudio/PinPointStudio.ini points athleteLibraryPath (under [%General]: AppSettings' General/ keys) at a scratch library, and PINPOINT_DIAGNOSTICS_DIR, above):

PINPOINT_HEADLESS_PROBE=1 QT_QPA_PLATFORM=offscreen PINPOINT_LOG_STDERR=1 \
  HOME=<scratch> CFFIXED_USER_HOME=<scratch> XDG_CONFIG_HOME=<scratch>/.config PINPOINT_DIAGNOSTICS_DIR=<scratch>/diag \
  PINPOINT_RIG_DIR=<scratch>/rig <PinPointStudio> --probe-qml <abs path to the probe>

headless_probe_test (ctest, Gui suite; src/Gui/tests/headless_probe_check.cmake) launches the app binary that way with src/Gui/tests/probes/headless_start.qml, which visits every screen and Settings panel and exits. It fails on a missing "not started" line, any REFUSED line, a QML ReferenceError or TypeError, or, on macOS, a display_prompt in tccd's log over the run, or a tccd log that cannot be read. The binary is -DPP_APP_BINARY=<path> at configure, else the first that exists of the app tree beside the tests tree (a worktree's build/app) and the main tree's Qt Creator build (build/Qt_*_for_macOS_Debug); configure prints which. A missing binary, or one built before the switch (the script looks for the switch's own log text in it first), fails the test and is never launched. The only skip is an explicit -DPP_APP_BINARY=OFF, which ctest reports as Not Run (exit 77), never as passed. About 35 s. A shell launch is attributed to the terminal by TCC, so the test proves no permission is asked for, not how a granted app behaves. src/Gui/tests/probes/app_state_on_screen.qml (refactor 4-c) drives 4-a's application state the same way over a scratch library: a pick kept across a reload of the same session and a return to the session screen, the Consistency glance following the selection, the Motion popup back on Presets on a switch to Capture, and an empty session's End with no "not being saved" notice. It needs the stage panel in the Replay layout (the default layouts have none: copy a [view] section into the scratch settings).

The quit pins — quit_pin.<point> and quit_pins_selftest

What they pin (SE-1b; the lifecycle model's APP-T3, APP-T9 and APP-T11, and its GAP-20 and GAP-21). The real app, started headless through tools/probe/run_headless.sh, is quit at one point of its start-up, or while one of its threads is busy, and must exit clean. One ctest per point, label quit_pins, each running the point twice (src/Gui/tests/quit_pins/quit_pin.py, the driver and the oracle; src/Gui/tests/probes/quit_pin.qml, the probe that quits). python3 -I src/Gui/tests/quit_pins/quit_pin.py --list prints the points:

Point The quit arrives
startup while main() is still building: queued from inside the QML load, delivered as exec() starts (APP-S1)
ready on the event loop's first turn: the window is up, no timer has fired (APP-S2)
ready-close as the window's close with no session running, 0.5 s in (APP-T9)
work-ons, report-list just after the work-ons list's 3 s and the report list's 3.5 s timers
housekeeping just after housekeeping's 60 s pass
warm-up 1 s into the pose warm-up (APP-S2a): the session building on the pose inference thread; it must be abandoned (abandoned, not waited for)
after-warm-up as the warm-up's session is ready: the inference thread idle, stopped and joined at exit
athlete-on-screen with the current golfer's latest session on screen, as the catch-up makes its first decision (the fixture library; the pool is not shown busy)
re-analysis, re-analysis-in-warm-up while a re-analysis runs, alone and beside the warm-up (the fixture library): the quit stops it and nothing is written (#294)

Clean means all of: the app's own exit code is 0 (not a signal, not the launcher's timeout or failed check); the process gone within 5 s of the probe's QUIT-PIN: quit requested line (GU-10's limit, ruled by the Product Owner); no teardown-fault line after it (a thread destroyed while running, a timer or notifier touched from another thread, an abort, a QML error: the FAULTS list); no line after it showing work running on after the application object has gone (after-shutdown, the SHUTDOWN list: Qt's "Please instantiate the QApplication object first" from any of its functions, or any model's "… model not found:" error, since each model's path is read from the application's folder; ViTPose's "fp16 model not found at", a warning that falls back to the fp32 model, is left out); the point's busy marker in the log before the quit and its "done" marker not (else the point proved nothing and fails as vacuous); for a busy point, none of the busy work's log lines after the quit (ran-on: a quit that waited for it with no window); and the memory guard (6 GB, AG-16) not needed. The two re-analysis points also need, after the quit, the re-analysis's owner's line that the job has returned ([Reanalysis] stopped at quit: the re-analysis returned in), and never the analysis's own last line ([WristAnalysis] N metrics, score: a quit that waited for the whole re-analysis inside the stop's budget instead of stopping it), a write-back ([Reanalysis] re-analysed) or the line that the stop's budget ran out; their ran-on lines are counted only after that line, because the stage running at the quit finishes first (a stage is not stopped part-way; the line is logged once the job has returned, so for these points the gates that catch a quit which did not stop the work are the analysis's last line, slow, after-shutdown and written); and every file of the swing's folder in the run's scratch library must be byte-identical, after the exit, to the fixture's (written), so the swing is left as it was before the run (a re-analysis its version stamps call for then runs again next time). The one file left out is the swing's phase-grid sidecar (swing_phasegrid.json, a derived index): any read of the session rebuilds it when its schema is older than the build's, as a plain launch with the golfer on screen shows. Every run prints its quit-to-gone time and peak footprint. For the start-up points the busy marker is the probe's own quit line, so they prove the quit's moment, not that a timer's work was running: with an empty scratch library the work-ons scan, the report list's read and housekeeping have nothing to do, and their work is not shown in flight.

How a busy point is timed. The probe watches a trigger folder (--quit-pin-at trigger:<dir>); the driver writes quit into it when the app log shows the point's busy marker, so the quit lands while that work is running. Two seams reach the work under the headless switch: PINPOINT_PROBE_WARMUP=1 runs the launch warm-up (read only under PINPOINT_HEADLESS_PROBE=1; src/Gui/main.cpp), and PINPOINT_PROBE_REANALYSE=<swing dir> re-analyses a swing 3 s after launch.

The fixture. The busy points read a one-swing library that zsh src/Gui/tests/quit_pins/make_fixture.sh copies, read only, from the live library into /mnt/swingdata/scratch/quit-pins-fixture/lib, once per machine; the driver copies it afresh into the run's scratch folder, so no run reads or writes it. Without it those points are Not Run (exit 77), never passed.

A point that fails as its filed issue says (the KNOWN table: the issue and the checks it fails) still runs, and is reported Not Run, naming the issue. If it then passes, or fails another way, it fails, so a fix or a new fault shows. The table is empty: both re-analysis points left it with #294's fix (before it, they failed on ran-on and after-shutdown, and slow beside the warm-up).

Stand-in devices, Debug only. Headless, every real device refuses to start, so a device's thread can be made busy only by a stand-in: a replacement for the device's lowest layer, inside the real app, with no hardware. The stand-ins are built into the Debug app and nowhere else (the Product Owner, 26 Nov 2026: "debug devices are going to be useful for automated testing").

  • The build option is PP_SYNTHETIC_DEVICES in the root CMakeLists.txt: on by default in a single-configuration Debug build, off in every other build type. A configure with it on in any other build type (Release, RelWithDebInfo, MinSizeRel), or with a multi-configuration generator (Xcode, Visual Studio) whatever its build type, is refused with a message, so no Release build, installer or local release carries a stand-in; a Debug tree re-configured as Release keeps its cached ON and is refused too, until it is given -DPP_SYNTHETIC_DEVICES=OFF. It reaches the code through a generated header (<app tree>/generated/pp_synthetic_devices.h), not a compile definition, so turning it on or off rebuilds only the files that include src/Core/synthetic_devices.h. Code asks pinpoint::synthetic::kBuilt, never the macro; a stand-in's own sources are added under if(PP_SYNTHETIC_DEVICES).
  • The two switches (src/Core/synthetic_devices.h), each read only under PINPOINT_HEADLESS_PROBE=1, in a build with the option:
    • PINPOINT_PROBE_SYNTHETIC=<part>[,<part>]... starts the stand-ins named, for example camera. A stand-in's gate sits beside its owner's [HeadlessProbe] not started: … gate; with the switch unset, every device refuses to start exactly as before.
    • PINPOINT_PROBE_SYNTHETIC_SLOW=<part>.<step>:<ms> makes one call of one stand-in take that long (1 to 120 000 ms), for example camera.stop:3000: its stop, its model load or its disconnect. A stand-in that answers at once passes every quit and proves nothing, because no teardown but the sensor scan's has a time limit; a slow one shows what the owner does while it waits (GAP-20, GAP-21).
    • A name is lower-case letters, digits and -, starting with a letter and not ending with -, at most 32 characters. Both are parsed strictly: no spaces, no empty or repeated item, no sign, leading zero or unit. A malformed value, or either switch set in a build without the option, is logged ([HeadlessProbe] synthetic switch ignored: …) and ignored as a whole, never acted on in part. A switch set but empty is malformed on the Mac and Linux; on Windows an empty assignment removes the variable, so it reads as unset.
  • The log convention. Each stand-in logs exactly one line as it starts, through synthetic::logStarted: [HeadlessProbe] synthetic: <part> <what>.
  • The not-run rule. A pin that needs a stand-in names its parts in the PINS table (synthetic, and slow for the slow setting); the driver passes the switches. It is Not Run (exit 77), never passed, when the app's build tree says it was built without the option (its CMakeCache.txt; nothing is launched), or when the stand-in's line is not in the log before the quit (a trigger pin waits 60 s for it, then stops the run). A run that also fails a check the stand-in's absence does not explain (the exit code, a fault line, after-shutdown, slow, written, the guard) fails: a crash is never reported as Not Run. No stand-in is built yet, so no pin in the table needs one.
  • quit_pins_synthetic_selftest (label quit_pins, about 20 s, CTL-BT-40) proves the rule on a test-only pin that needs the part selftest, which no stand-in provides: against an app tree whose cache has the option off, Not Run with nothing launched; launched, with the line absent, with near misses before the quit (another part's line, the "ignored" line, a "not started" line) and the real line only after it, Not Run each time; launched trigger pin, stopped and Not Run after the wait; a planted kill with the line absent, a FAIL; and with the line planted before the quit, it goes on to the oracle and passes, so the 77 is not hard-wired. synthetic_devices_test and synthetic_devices_off_test (Gui suite, CTL-AG-15) are one source built with the option's macro at 1 and at 0: the parsing (valid and malformed values), each switch read only under the headless switch and only in a build with the option, a malformed value logged and ignored, and the start line's text.

quit_pins_selftest proves the oracle: the ready point, unplanted, passes; with a planted kill (SIGKILL: an abort would leave a macOS crash report and a "quit unexpectedly" window), a stopped process, a missing busy marker and a fault line (--_plant), it fails on the named check each time. after-shutdown has two plants after the quit, Qt's warning from another function than the one #294 logged and another model's not-found line than the segmenter's, each failing on that check; and one near miss that must still pass: both lines just before the quit, and ViTPose's fp16 fallback after it. With the fixture library, the re-analysis point gets two more plants, one run each: nostop, the log of a build without the stop (no stop line, an analysis line after the quit), must fail on after and ran-on; written, the swing's document changed after the run, must fail on written. Without the fixture they are skipped, and the self-test says so.

Costs and limits. About 7–8 minutes on the Mac, most of it the pose model's load: the warm-up's CoreML compile is cached in the scratch home the finishing pose points share (build/tests/Gui/quit_pins_work/pose-home, about 2.2 GB; the warm-up point keeps its own, about 0.4 GB), yet each run that lets the load finish still took 56–105 s on the Mac (after-warm-up, twice per run of the label). Unix only (the launcher is a shell script); serial, one app at a time. What they cannot reach, by the thread ids of the threads inventory (SE-6a): headless, no device part starts and no shot is taken, so these are not pinned (the hand-run quits at the studio were replaced, 26 Nov 2026, by quit pins on stand-in devices, above, for the camera and the sensors, none built yet; the others stay named as not pinned): the camera's four threads and its frame loops (Q1–Q4, J12), the microphone and speech in (Q5–Q7), speech out (Q8), the sensor scan and the sensors' I/O (Q10; Q11 runs, idle, in every pin), the event buffer's merger busy with a producer (S1, idle in every pin), the phone link (S3, S4), a shot in flight (J1: a quit during its post-roll, its analysis or its save), the Settings pose benchmark (S6, not started under the switch) and a quit before a macOS permission is answered (the transcription controller's callbacks). The language model's thread (Q9) is dark unless PINPOINT_ENABLE_LLM=1. The Windows quit during the warm-up (TerminateProcess, never yet run) is not pinned either: the pins are Unix only, and no visit holds it since 26 Nov 2026. Reachable headless but not pinned yet (they need a bigger fixture or a probe that starts them): the one pool busy (P1: a long catch-up needs a library of many stale sessions), and the jobs on Qt's global pool and the private pools that the threads inventory names J3–J11 and P2–P9: an export (J3; a one-swing zip ends before a quit lands), archive, restore and the trash purge (J4), the library's conversion (J5) and size (J6), the session report's reads (J7, P6's stills), the review's and the model browser's reads (J8, J9), and on Linux the updater's copy and signature check (J10, J11).

The capture test rig — capture_rig_test

What it is (#394; docs/implementation/platform_d_capture_seam.md, T1). The real ShotProcessor, driven by synthetic streams on a real event buffer, with no device and a scratch library: main.cpp's composition cut to what a shot passes through (the buffer, the settings, the session, swing and athlete stores, the Rig, both device managers under PINPOINT_HEADLESS_PROBE=1, the carousel model), wired as main.cpp wires it, on IsolatedStores, which turns the system trash off for the process; the rig also turns each store's off (setOsTrashForTest(false)). Its cases are named in docs/implementation/platform_refactor/duties/DUTIES-shot_processor.md.

Where it builds. The test tree cannot link FFmpeg, ONNX Runtime or the camera back-ends, so the rig is an app-tree target that compiles the app's own sources a second time (cmake/PinPointCaptureRig.cmake, read from the app target at the end of the root CMakeLists.txt; the app's own link is untouched). It is off by default and refused outside a single-configuration Debug tree, and excluded from all, so the app's build never builds it. In a Debug tree that already built the app, ccache makes its first build a matter of minutes.

cmake -DPP_CAPTURE_RIG=ON build/<Debug app tree>
cmake --build build/<Debug app tree> --target capture_rig_test -j 6
ctest --test-dir build/<Debug app tree> -R '^capture_rig$' -V      # PINPOINT_LOG_STDERR=1 adds the app's log

The stand-ins (#394, step 81; T2). With no camera and no bound sensor the analysis has nothing to read (no IMU and no pose data in window), so a camera-less swing writes no document. Three stand-ins reach the rest:

  • The stand-in camera (src/Video/video_input_standin.*, VideoInputFactory::Backend::StandIn): a back-end that opens no device and draws 320×240 BGRA frames at 60 fps. Its source is compiled into the rig only, and the factory creates one only where the rig's own generated header (<tree>/capture_rig/generated/pp_capture_rig.h, PP_STANDIN_CAMERA) is on the include path, so the app's copy of the factory never can. It is not one of the quit pins' PP_SYNTHETIC_DEVICES stand-ins: those are built into the Debug app and started by a switch; this one exists only in the rig. The rig registers it with the device enumerator, the camera manager lists it, and it is connected and started as a golfer's Connect and the session's start do (setSelected, startAll). Its swing is exported and saved: an .mp4, a thumb.jpg and the document, read back through the swing door.
  • The stand-in launch monitor (#396 step 92; src/LaunchMonitor/launch_monitor_standin.*, StandInLaunchMonitor): a connector that reads nothing and hands on the readings a case gives it (Rig::deliver), to the real LaunchMonitorController the rig wires as main.cpp does (the door to the Shots is a real App, and the carousel shows the session through its port). Its source is compiled into the rig only, and makeLaunchMonitor makes one in place of the inert connector only where the rig's header says PP_STANDIN_LAUNCH_MONITOR. Its kind is None, so it is never started, rebuilt or used for a standalone shot. Cases LM1–LM7 (--step92 runs them alone): a reading before and after the join (the live row names its device: #192), a camera-less shot rescued by its reading (its Shot's device-only document, with the golfer's handedness), a dropped shot's reading, a late reading after a switch of golfer (the document names the golfer who hit the shot), and one after a change of club and End (it carries the club and session type the shot was hit with).
  • The stand-in deferred source: the test's own implementation of pinpoint::DeferredSource (src/Gui/shot/deferred_source.h, the interface HmInstance implements), handed to the processor beside the sensor manager's through ShotProcessor::setDeferredSources, as main.cpp hands the sensor manager's. It records its reserve, polls and collect and holds the gather open as long as a test asks.

What the rig swaps out, so a test touches nothing real. It leaves two of the app's files out and defines their functions itself: src/Audio/ting_player.cpp (a camera instance's ting when a ball arrives: the rig's plays nothing, silent_ting_player.cpp) and, on macOS, src/Gui/app/macos_permissions.mm (the camera instance asks for the camera's permission before starting its back-end: the rig's asks macOS nothing, grants the camera, whose only listed one is the stand-in, and refuses the microphone and speech, rig_permissions.cpp). The known bugs (step 84) are each written to the right behaviour and registered as their own test on the same binary, capture_rig_xfail_<issue> (label capture_rig_known_bugs; capture_rig_test --xfail <issue>): it passes while today's code fails the right behaviour (XFAIL), fails as soon as the bug is fixed (XPASS: turn the case into an ordinary pin), and fails on a crash or when a check the case relies on fails. Today: #53 (a shot whose impact lies before ready is taken). The ready rule and one shot at a time (#281, by design) are ordinary pins: READY1 and ONE1; so are #188's two cases since the shot exists from its trigger (#396 step 90): E1 and E2, with E3–E5 (a drop gives the allocation back, End anyway on a session's only shot, the library re-pointed mid-shot). A shot stopped part-way (#396 step 91): DEV1–DEV4 (a camera deselected, reconnected or every device disconnected while the shot is analysed, or deselected in its post-roll: the shot is saved as the undisturbed one), W5 (a document that cannot be written: stated as not saved, and its card's edit refused) and E6 (End anyway with the analysis done: the save is finished). capture_rig_test --step91 runs those three cases alone.

Timing pins (step 83) run on real time, as the processor does (its post-roll and gather poll are QTimers and its gather deadline reads the buffer's clock), so each tolerance is stated beside its check; the two that wait out the gather's deadline (impact + 7.25 s, just past the library's: #423) are most of the run. The rig takes about two minutes, and the known bug about 7 s more. It does not run in the cabin's tests mode.

The architecture lint — architecture_lint_test

src/Gui/tests/architecture_lint_test.cpp is the guard for the refactor (docs/implementation/swe-audit/03-target-architecture.md §2 and §11). It is shaped like design_system_lint_test: it reads the source tree at run time (every C++ and QML/JS file under src/, skipping tests/, Testing/, third_party/ and build/), so it needs no rebuild when the code changes, and it is plain C++ on Qt Core, so it runs on every builder without Python.

  • The rules. A1, an #include from an inner ring into an outer one (Platform · Vocabulary · Rules · DomainModel · Application · Adapters), and, since step 2's S1-g (DEC-146), an Adapters-ring file outside src/Gui (or a src/Vocabulary/Recording file) including a src/Gui header. A2, QML creating a session- or athlete-scoped C++ type. A3, folder-name parsing outside SwingPaths and SessionIdentity (src/DomainModel/session_identity.*, step 2.1). A4, a session or athlete file name spelled outside its owner — every FILE-SESS and FILE-ATH name of the information model (§8.1), owned by src/Stores/session_files.h or src/Stores/athlete_files.h (step 2.8b: session.json, session_input.json, diagnostics.json, club_baseline.json, work_ons.json, archived.json, the report's report_meta.json, *_session-report.pdf and report-stills/, .pinpoint-last-swing, trunk_ceremony*.json; athlete.json, tendencies.json, swing_themes*.json, outcome_corrections.jsonl; fault_profile.json left the list when step 3.8-ii retired it); a writer elsewhere calls the owner's name function. A5, P11 (DEC-161; widened in S1-g from the rules directories): file or directory access (QFile, QSaveFile, QDir, QDirIterator, QFileInfo, QTemporaryFile, std::fstream, fopen, atomicWrite, FolderLock) or an include of a repository (the DomainModel interfaces and the stores and file doors of src/Stores) anywhere outside src/Stores and the Platform ring; src/DomainModel may include its repositories. Path text is not counted (QDir::cleanPath, a temporary QFileInfo(p).fileName(), …), nor an #include <QFile> line. A6, a Q_INVOKABLE, Q_PROPERTY, public slot or signal with a QVariantMap/QVariantList in any header. A7, a function over 300 lines in the Vocabulary and Rules rings. A8, src/Analysis including the ring buffer, device classes or app state, and any Vocabulary, Rules or Domain-model file including the settings handle (src/Core/pp_settings.h, which is Platform, so A1 no longer stops it). A9, R-CTX-1 (the information model's §2): an include from an earlier context into a later one (Acquisition → Diagnostics → Coaching), from a context into Domain + Application past the hub's five contract headers (hubContracts()), or from a Shared Vocabulary area or Platform into any context; it has no allow-list line, and the list refuses one. The header comment holds the details and the known limits; the ring table (directory defaults plus a per-file list for the directories that straddle) is in the test.
  • The allow-list. governance/allowlists/architecture_allowlist.txt holds today's violations, one line per file and rule: path | rule | count | WHY # step N. The tag is the refactor step that removes the entry (# step 1 … # step 8, or a sub-step such as # step 3.0; # platform refactor (capture) or # platform refactor (settings) for the refactor after step 8, 05 §1 / §2; # not domain (§8.3) for a file the information model classes as not domain, kept allowlisted by the Solution Architect's answer; # unplanned if nothing places it yet, which is a question for the Solution Architect; # kept or # kept (reason) if it is deliberate). A file over its count fails. A file under its count is printed as a note: so the count can be lowered in the same change. The test ends with the size of today's debt by step.
  • Never add a line to make it pass. A new entry is an architecture decision for the Solution Architect, exactly as for the design-system allow-list. When a refactor step removes a violation, lower or delete its line in the same commit.
  • A new directory under src/ fails the test until it is given a ring in dirRings(). That forces the choice to be made on purpose.
  • Placing a new directory. It needs two entries, a ring and a context, each from the information model's §4.1 (the Ring and Context columns), and its row there first: a new directory is an information-model change (§1.2), so the Solution Architect rules on both before it is built. Add the ring to dirRings() and the context to dirContexts() (Platform, Shared, Acquisition, Diagnostics, Coaching or Domain + Application); a file whose ring or context differs from its directory's goes in fileRings() or fileContexts() by its path under src/ without the extension. A new Vocabulary area is a directory like any other: it has no context until it is placed. The test fails on a C++ file with no context, and on a table entry that names nothing in the tree. A context that needs a Domain model header not in hubContracts() asks for a ruling; the header joins only if it declares interfaces and value types and no owner class or service (Q26).
  • Run: cmake --build build/tests --target architecture_lint_test -j 6, then ctest --test-dir build/tests -R '^architecture_lint_test$' --output-on-failure (about 2 s).

namespace_collision_test (src/Gui/tests/namespace_collision_test.cpp, platform refactor B1.20a) is shaped the same way and shares the lint's comment and string blanking (src/Gui/tests/lint_source_text.h). It reads every C++ file under src/, outside the same skipped folders. It fails when one (namespace, name) is defined in two files. The names it reads are a class, struct, enum or using X = alias at namespace scope. Two such definitions are an ODR violation the linker accepts: on 7 Oct 2026 the app had two pinpoint::analysis::DagEdge types. A forward declaration beside its definition passes, and an identical alias in two files fails. Anonymous namespaces are per file and not read. A detail namespace is not per file in C++, so a detail repeat with a site in a header fails like any other. One whose every site is a source file (.cpp, .cc, .mm) is printed as a note. The test has no allow-list: rename the type or give it its own namespace. Its header holds the rules and the known limits. Run it with ctest --test-dir build/tests -R '^namespace_collision_test$' --output-on-failure (about 2 s).

The QML names lint — qml_globals_lint_test

src/Gui/tests/qml_globals_check.cmake holds QML to R-QML-1 (the information model: "context globals are only devices, settings, logging and app"). It is a CMake script, not a C++ test: it reads the source at run time, so it needs no build, and it runs on every builder with no Python. It blanks strings, template literals and comments first. It has no allow-list.

  • The rules. (1) The context globals src/Gui/main.cpp registers are exactly the list at the top of the script; every setContextProperty call must name its global as a QStringLiteral. (2) No production QML or JS file (src/Gui, skipping tests/) reads one of the five names that moved under app bare (ttsController, controller, profiler, resourceMonitor, cudaRuntime). A property of the same name is allowed where it is in scope: in its own object (its braces), or the whole file when the file's root object declares it. A binding or object key (ttsController: page._voice) is not a read. (3) Every app.<member> such a file reads is a property, invokable or signal of GuiApp (src/Gui/app/gui_app.h) or App (src/App/app.h), or a QObject member. A misspelt member is undefined in QML without a word, so only this check sees one.
  • A new context global, or one more moved under app, changes the script's list in the same commit as main.cpp; the list is the application of R-QML-1, so a change to it is the Solution Architect's.
  • It does not see a name built at run time (app[name]), and it takes a property's scope as its object's braces, which also covers that object's children.
  • Run: ctest --test-dir build/tests -R '^qml_globals_lint_test$' --output-on-failure (about 1 s). A reconfigure picks the test up; nothing to build.
  • The headless start checks the same five at run time: probes/headless_start.qml's first stage fails unless each is an object on app and none of the old names resolves.

The post-shot bench — post_shot_bench, and reading [PostShot] and [GpuMem]

Two app-log lines and one headless tool measure what happens after a live shot (refactor 3.7-S and 3.7-I; build/refactor/step-3/3.7/NOTES-S.md, NOTES-G.md). Both lines are ppInfo, so they reach the one app log (PINPOINT_LOG_STDERR=1 echoes it), and both are always on: they change no behaviour and write nothing else.

  • [PostShot] (src/Core/post_shot_trace.h). One line per live shot: what the GUI thread spent, step by step, from ShotProcessor::onSwingDocWritten until the next shot lands or 4 s pass with no timed step. A step is a PostShotTrace::Scope("name"). It records only on the thread that opened the window and only while it is open; anywhere else (a worker, a tool, a test, Home) it costs two relaxed atomic loads. A window keeps at most 256 steps (the line ends (+N steps not kept)). A window the next shot's begin() closes while a step still runs is written, ending (window cut: N steps still running), never dropped. Pinned by post_shot_trace_test (src/Core/tests/, ctest): the format (nesting, timed, one decimal under 10), the thread gate, the cap, the quiet end and the cut.
    • Reading it. [PostShot] <shot> span S ms, timed T ms: join … (evt01, gpumem, notify, addShot, announce (lm.ball (lm.write (lock, doc (load, save)), refresh (read, review, emit)))), lm.club (lm.write …, refresh …, lm.rewritten …), owner, settle (rebuild (emit), persist (read, lock, json, commit), ingested), charts. Nested steps are in parentheses; a step repeated in a window appears once per run. span runs from the window's start to the end of its last step, timed is the sum of the top-level steps, and span − timed is GUI-thread time no scope names (QML polish and layout, other events).
    • Where each name is. shot_processor.cpp (join, evt01, gpumem, notify, addShot, announce); launch_monitor_controller.cpp (lm.ball, lm.club, lm.write, lm.applied, lm.rewritten); swing_store_repository.cpp (lock, doc); swing_doc_writer.cpp (load, save); shot_list_model.cpp (refresh, read, review, emit); session_diagnostics_model.cpp (settle, rebuild, emit, persist, ingested); session_diagnostics_io.h (read, lock, json); atomic_write.h (commit); session_diagnostics.cpp (owner); session_series_model.cpp (charts). The steps that run QML synchronously inside an emit are notify, rebuild/emit, refresh/emit, lm.rewritten, ingested and charts.
    • No hook step any more. The parallel run's comparison hook and its switch (PINPOINT_DIAG_PARALLEL=1) were deleted in refactor 3.10: since 3.7-e no old model was left in the app to compare, and refactor 5.4b deleted the old engine. Parity is regrade_ledger --dump against a baseline (step5c-baseline).
  • [GpuMem] (ProfilerController::logGpuMem, src/Gui/monitor/profiler_controller.cpp). One line every 30 s from the profiler's 1 s sampler (at=tick), one at each session start (at=session-start, written before the profiler's reset, so its peak is the window just closed), one at each session end (at=session-end), and one at each shot's EVT-01 (at=EVT-01 shot=<ref>: ShotProcessor::shotDocumentAnnounced, a relay main.cpp wires to the logger; timed as gpumem in that shot's [PostShot] line): [GpuMem] at=tick dedicated_mb=1712 shared_mb=128 peak_dedicated_mb=1712 private_mb=4450 working_set_mb=3900 source=DXGI
    • dedicated_mb is this process's GPU memory (Windows: DXGI's local segment, the same figure as typeperf's \GPU Process Memory(pid_*)\Dedicated Usage within a few MB; macOS: Metal's currentAllocatedSize, unified memory, source=Metal(unified)). shared_mb is DXGI's non-local segment, expected to equal typeperf's Shared Usage (not yet measured; the 3.7 combined cabin run checks it); - off Windows. peak_dedicated_mb is the high-water since the last session start. private_mb and working_set_mb are osmetrics::processMemory() (Windows PrivateUsage and WorkingSetSize; macOS phys_footprint and resident size). A figure the platform cannot give is -, never 0. The text is ProfilerController::gpuMemLine() (pure), pinned by profiler_controller_test (DXGI, Metal unified, unavailable); osmetrics::processMemory() by pp_os_metrics_test.
    • Cost. Two DXGI queries and one GetProcessMemoryInfo, microseconds, so it is not behind a switch. The sampler runs only when the profiler's baseline tier is compiled in (PINPOINT_PROFILE_BASELINE, on by default); the session and EVT-01 lines do not depend on it.
    • Reading it. NOTES-G's ORT bench puts PinPoint at about 1.4 GB between sessions and 1.7 GB inside one, with ORT alone. A climb per session or per shot is the window's (D3D11/Qt Quick) side; flat but high is its steady state.
  • post_shot_bench (tools/diagnostics/post_shot_bench.cpp). The post-shot GUI path, headless, for N shots of one session on a scratch library. It uses main.cpp's composition: the store, the swing door and reader, an Athlete, app, the carousel's ShotListModel and the panel's thin adapter over the session's owner, with the app's doors, as the app has run since 3.7-a. It has no other path1. Each shot follows the cabin's order: EVT-01, the replay detail converted to JS once, the row, the ball reading through app.completeCapture and the refreshes, then the previous shot's club data. It prints each shot's [PostShot] line and a table of every step's cost against the shot count (shot 1, the mean of shots 2–6, the mean of the last five, the slope in ms per shot). It reads each panel property and the card's roles once inside the emits (qml.panel, qml.row) as a floor for QML; the real QML costs more. Its line differs from the app's: it prints notify.js (the JS conversion alone) where the app prints notify (the emit and its bindings), it adds the qml.* floors, and it has no gpumem and no charts step.
    • Build and run. cmake --build build/tests --target post_shot_bench -j 6, then post_shot_bench --fixtures <folder of swing.ppsw copies> --library <empty scratch folder> [--shots 40] [--view 1|0] [--cards 12] [--csv out.csv] [--quiet] [--gc]. --cards N (3.7-c) reads the pip rows of the newest N carousel cards on each of the panel's surfaceChanged, as PpShotCard does (qml.pips, inside the emit of the model they read: the panel's with --view 1; with --view 0 the session's cards adapter, under owner/pips). After the run it prints J-46's check: each late reading's row as the controller's one refresh left it, compared with the same row after a second refresh. Fixtures are real capture documents copied into a scratch folder (NOTES-S used the ten swing_000N/swing.ppsw of 20 Nov's Wrist_01); they are rotated over the shots.
    • Not a ctest. It times rather than checks, and it writes the library it is given, so it refuses a --library that is not empty or new. It sets QStandardPaths test mode and the eight PINPOINT_CORE_* variables to the shipped content when they are unset. It drives no QML, no cameras, no analysis and no GPU.

The tools' one entry and the Python bridge (the shot-ownership plan's phase 3)

Every tool that reaches the library opens it through tools/entry/tool_entry.h and reads its own files through ToolFilesPort; every Python script reaches a shot, a session or an athlete through tools/pp_swingdoc.py. Their suites, all ctests of the tests tree but the last:

  • tool_entry_test (E1–E9): the corpus and library layouts, a read that writes nothing (no lock, no report split), a write through the Shot, sessions in progress refused, a swept run judged in memory (analysisRun), the trunk ceremony through its Session.
  • tool_files_test (T1–T7): the --out guard, writeOutsideLibrary, a tool's inputs, the read rule (a shot's and a session's own files are read only through their owners).
  • pp_swingdoc_test (S1–S15, Python, standard library only): documents type for type, the truth through the Shot, a failed truth write that loses nothing, the copies, the stamps, every session let go after every request, protocol 2, the binary found by fixed rules, the backend's stderr, a crash and its restart, PP_SWINGDOC_ALLOW_IN_PROGRESS.
  • pps_truth_test (P1–P7): the truth writer's refusals, and the replace rule checked with the write under the session's lock (P7 holds a writer between the two with PINPOINT_TEST_TRUTH_HOLD).
  • parity_baseline_cli_test (Python): a --self-test never becomes a real run.
  • swinglab_run_cli_check (tools/swinglab/tests/, run with cmake -P against a tools-tree swinglab_run, whose tree builds no tests): --out into the swing's own folder is refused and the document is untouched.

Parity dumps — regrade_ledger --dump and athlete_dump

The refactor's parity baseline (build/refactor/step-G/BRIEF.md §2) records what today's code produces so each later step can show it changed nothing it did not mean to. Two headless tools write the diagnostics and athlete halves of it. Both are built in the tests tree (src/Analysis/tests/CMakeLists.txt), are not registered with ctest because they write into the folders they are given, and share one canonical JSON writer, tools/diagnostics/parity_json.h: keys sorted, numbers %.17g, NaN as null, no timestamps or cache fingerprints, folders as <session> / <athlete>. Two runs on the same data diff byte for byte, even from two scratch copies at different paths.

  • The Charts series, old against new (charts_series_dump, refactor 5.5a) was retired in the shot-ownership plan's phase 3 (29 Nov 2026): its OLD half read the sessions' files by folder.
  • Session level, regrade_ledger --dump <out.json> <session-dir>…. It regrades each session through its own SessionDiagnostics (--engine new, the only engine)2; --engine old was removed with the old engine in refactor 5.4b and is refused. The engine must tell the golfers apart when each session's club baseline is frozen. It reads each session's athlete from its athlete folder's athlete.json (FILE-ATH-01), through AthleteRepository (since refactor 4-c, J-61); a folder with no athlete.json from athletes.json beside the session (pinpoint.athletes/1; the corpus's is corpus/swings/athletes.json, matched by the golfer's name in the session folder's name, and such a session freezes no club baseline: "club baseline not frozen: corpus run"; an entry's optional aliases are other ids the golfer's swings record, and a session whose swings record one is said to be the same golfer, while an id the file does not list is said too, not refused3); --athletes-ini <a copy of the app's settings> only as the last fallback, for a library M1 has not migrated. A session whose athlete no source names is refused (SKIP, exit 1, nothing written), so no golfer is pooled into another's baseline (regrade_ledger_new_needs_ini_test, 3.10 review B1, which also checks the new default and two golfers in one folder). It writes, per session, the parallel run's form P (src/Gui/diagnostics/diag_parallel_run.h, dumpVersion 2): the stage, the pattern set, every condition's ledger figures, every shot's rows, its outcome's facts and three factors, the shot and club mixes, carry today, the reasons, the work-ons and the usuals, in ids and numbers (no words, no view state). Until 3.10 a plain regrade dumped the old engine's form v1 (rows with every field, the composed outcome's words, the card order, the coverage line); a v1 baseline does not compare with a dump from 3.10 on. The first new-engine baseline is step3.10-baseline; step5-baseline (5.3c) was the first on the migrated library (build/refactor/step-5/5.3c/BASELINE.md)3; the reference since 5.5c is step5c-baseline, whose summaries carry dayReadings (build/refactor/step-5/5.5c/BASELINE.md).
  • Athlete level, athlete_dump --fresh --out <out.json> <athlete-dir>…. It runs the catch-up service and the new owners, described below, through the tools' one entry (its --engine old, Home's WorkOnsController, was retired in the shot-ownership plan's phase 3), and writes the tendencies, the club distances and each session's work_ons.json and club_baseline.json as each Session reads them. --fresh is a rebuild that deletes nothing: every shot fired again, every summary rewritten (DiagnosticsDoors::rebuild), and the athlete level reads none of its stored caches (DiagnosticsDoors::freshAthleteLevel); athlete_dump_ids_test proves both. The tool refuses any folder without a scratch component in its real path. Each athlete's id is the one its sessions' session.json files name, read through the session repository (refused, before anything is deleted, when they name more than one; only a folder with no session file keeps an id made from its name), and a folder holding sessions that leaves 0 counted fails the run with words (athlete_dump_ids_test)3. Step 3.6 added --engine new, the default since refactor 5.32 (--engine old is WorkOnsController, Home's path before 3.7-f): the catch-up service and the new owners (SessionDiagnostics headless, every shot fired again, each club baseline frozen from the predecessors' summaries; AthleteDiagnostics for the tendencies, distances, themes and athlete work-ons, from the summaries' compact per-shot facts). Both engines' dumps carry themes, athleteWorkOns and each session's boardAnnotations; the old engine's carries doWell (themes before the praise rule, praised after).
  • Content. Both need all eight PINPOINT_CORE_* variables (PACK, NORMS, FLIGHT_NORMS, CONTEXTS, SCREENS, DRILLS, GATE_WORDS, REFERENCES) set to src/Resources/diagnostics/*.json. The tools carry no Qt resources, so without the flight table no flight would be read. Each dump records the SHA-1 of every content file.
  • Order for a parity run, and the corpus sweep. Copy the sessions under /mnt/swingdata/scratch/ (cp -R, never the live library or the corpus). Copy each athlete folder's athlete.json with them; a copy of corpus/swings carries its athletes.json. Then run regrade_ledger --tag parity --dump (the new engine, the default) on every session (with --athletes-ini <a copy of the settings> only for a library not yet migrated), and then athlete_dump --fresh on each athlete folder. --help on either tool gives the JSON shape.
  • The writer is pinned by parity_json_test (ctest): sorted keys, full precision, run keys dropped and folders tokenised. club_baseline.json's rewrites[].at (when a rewrite ran) is dropped from each rewrite only, as frozenAt is everywhere; an at anywhere else is kept (refactor 3.10).

The step-2 migrations — migrate_step2_test and pps_migrate_step2

pps_migrate_step2 (tools/migrate/, refactor step 2.8a) runs the four step-2 data migrations M1–M4: the athlete record from the settings into athlete.json, a SessionId and session.json for every old session, the golfer's input out of diagnostics.json, and the Wrist ★ onto the athlete's record. The tool's header (tools/migrate/pps_migrate_step2.cpp) has the whole story. It is a dry run by default. --write refuses a library that is not under /mnt/swingdata/scratch/ unless the Solution Architect's approval flag is given.

  • The tool is built in the tools tree (root CMakeLists.txt, PINPOINT_BUILD_STORAGE_TOOLS): cmake --build build/tools-parity-ninja --target pps_migrate_step2 -j 6. On the cabin PC, tools/studio/studio-build.cmd migrate builds it in the same tree. That is a mode of its own, so a failure there never fails tool or both.
  • The test is in the tests tree (Analysis suite): cmake --build build/tests --target migrate_step2_test -j 6, then ctest --test-dir build/tests -R '^migrate_step2_test$' --output-on-failure (under a second). It compiles the tool's engine (tools/migrate/migrate_step2.*) and drives it on a fixture library in a QTemporaryDir. The fixture's settings file is its own, and QSettings::setPath points ppSettings() at it, so the real ones are never reached. The fixture holds legacy sessions (two on one day whose name order is not their start order, one whose name and shots disagree on the type, one with no swing), a renamed athlete, two uuids in one folder, two machines' records, an app-backfilled session.json (J-19), golfer input in the older keys (one entry for a shot that is gone), golfer input only a backup holds, and the ★ setting.
  • What it checks. The dry-run plan, before and after the Solution Architect's decisions. That a dry run writes nothing: every file of the fixture is hashed before and after. Every athlete-id decision is honoured or refused (this machine's id, the other machine's, or a uuid the folder's swings record), and M1 blocks when no swing records the id it would settle (J-58). The guards: a write outside the scratch roots, a held folder lock, the app running and backups inside an athlete folder are each refused, and nothing is written. Every path is compared resolved, so a symlink out of scratch is refused, whether it is the library or an athlete folder in it. An archive mirror outside scratch is refused, a lock in it refuses the write, and its old session.json is backed up. A failed review write, or a failed M3 check, leaves diagnostics.json byte-identical. A scratch write, read back through the app's own doors (AthleteStore, SessionStore, SessionDiagnosticsFiles::golferInput, the reviews). The backups' manifest. And that a second run plans nothing and leaves every file as it was.
  • Dry runs on live trees. build/refactor/step-2/2.8a/dry_run_proof.sh <label> <library> [<settings>] runs the tool twice. It proves the run wrote nothing: a listing of path, size and mtime before and after; the SHA-256 of every file the tool read, which the tool lists with --read-list; and the settings file and PinPoint plists, hashed and diffed.

Parity baseline — tools/parity/

The runner around the parity dumps. It takes one baseline run under a label, and compares two runs. Each refactor step re-runs it and diffs against the baseline taken at the commit Stage 0 lands on (build/refactor/step-G/BRIEF.md §2). The scripts are standard-library Python, run with python3 -I, and each has --help. A run reads the library and the corpus and writes only under /mnt/swingdata/scratch/parity/<label>/ (C:\PinPointStudio\scratch\parity\<label>\ on the cabin PC). It refuses any destination whose real path (symlinks resolved) is not inside that root, and it refuses a label that is already used.

  • The set, parity_set.json (written by parity_select.py, which reads the library and the corpus without writing them). It holds eight whole sessions, one per category, as paths relative to the library root: camera + IMU + launch monitor (18 Aug), launch monitor only (4 Aug), the Premier launch monitor (2 Nov), the untaped 6 iron (9 Sep), Jess and Nick (20 Oct), Chris, and one multi-club session. The file says why each one was chosen. It also lists the 61 pinned-pose swings of corpus/pose2, each with its pinned face-on pose and, for the 34 two-camera swings, its pinned DTL pose from corpus/pose2_dtl. ViTPose on CUDA is not deterministic, so both views must be pinned. Re-run parity_select.py only to change the set on purpose. A category with no candidate stops it.
  • Mac half, parity_baseline.py <label>. It copies the eight sessions to <label>/lib/, with each athlete folder's athlete.json (the record the new engine reads: refactor 4-c, J-61). It then runs regrade_ledger --engine new --tag parity --dump over them (the session's own SessionDiagnostics, since refactor 3.10), then athlete_dump --fresh over their athlete folders, checks that the athlete dump counted every session copied (run_mac.json athleteSessions; one short exits 1)3, and deletes the copies (--keep-copies keeps them). --athletes-ini <settings> is only for a library not yet migrated: the file is copied beside the session copies, passed on and deleted with them; there is no default, since the app's settings hold no athletes after the 22 Nov migrations. --athlete-files (step 2.8b) also copies every other plain file directly in each athlete folder (its caches); off by default. Output goes to out/diagnostics.json, out/athlete.json and out/run_mac.json (commit, binary hashes, exit codes, seconds per step), with the tools' logs in out/logs/. Build regrade_ledger and athlete_dump in the tests tree at the commit under test first. About 50 s in all: the copy takes 22 s, the session dump 18 s and the athlete dump 5–6 s.
  • Analysis half, on the cabin PC only (it is a 61-swing sweep). First build swinglab_run with tools/studio/studio-build.cmd tool. Then run ssh developer@GOLFSIMPC.local "cmd /c C:\Users\developer\Projects\PinPointStudio\tools\parity\run_analysis_golfsimpc.cmd <label>". It runs parity_baseline.py --half analysis: swinglab_run --out --doc-blocks with --pose (and --dtl-pose) per swing, in place in build\Release-Installer. It writes out/analysis.json, one digest per swing, and out/run_analysis.json (per-swing seconds and exit codes), then deletes the result trees. It takes about 6–8 s a swing. The digest is result.json minus three things: the wall times (analysis.timings, and skeleton3d.diagnostics.ms and .plane.branchMs, the only fields that moved between two runs of one swing), the source path, and the pose arrays, which become {count, sha1}. It also keeps runmeta's verdict (ok, error, score, …). --doc-blocks adds the swing document's summary block and this pass's imuIntegrity/captureIntegrity verdicts, as a write-back of the same analysis would store them. The verdicts are reached as reanalyzeSwingDir reaches them, and the source document goes through the production writer (RecordingRepository::create) and is read back. The cabin's swinglab_run must be built with that option. A swing fails, and the run exits 1, when it has no result.json, a non-zero exit, or a result.json with no summary (the doc-blocks write failed). Its runner log is kept as out/logs/<id>.runner.log. parity_baseline.py --self-test checks that rule. --only <id> runs a subset, for a one-swing smoke test on the Mac.
  • Compare, parity_diff.py <labelA> <labelB>. It compares analysis.json, diagnostics.json and athlete.json.
    • Whole numbers are compared exactly when both sides are whole: a JSON integer, or a float with no fraction. That covers counts, ids and ms or µs timestamps, which a relative tolerance would let move by milliseconds. 1 and 1.0 are equal.
    • Other numbers are equal within a relative tolerance, --rtol 1e-9 by default, or an absolute --atol 1e-12 near zero.
    • inf equals only the same-signed inf, and NaN only NaN. Neither ever passes the tolerance.
    • States, labels and types are compared exactly.
    • A key or a file in one run only is reported.
    • Arrays of objects are matched by their identity (session, swing, shotId, conditionId, id, key, …), so one extra shot does not shift every row after it. An order change is reported once.
    • The output is a Markdown list, first by field (path, count, largest relative change, one example) and then by swing or session, with an empty box on each line for "explained". --out writes it to a file.
    • Exit 0 means no difference and 1 means at least one. Exit 2 is a usage error, or nothing compared: both runs hold none of the three files, or a file is empty or not JSON. So a run that never wrote its outputs cannot pass.
    • parity_diff.py --self-test checks these rules on 27 built-in cases.
  • Order for a step's check. If tools/parity/ is not committed, copy it to /mnt/swingdata/scratch/parity/_tools/ and run C:\PinPointStudio\scratch\parity\_tools\run_analysis_golfsimpc.cmd instead; the .cmd finds its Python beside itself. Run both halves under the same label at the step's commit. Then run parity_diff.py <baseline> <label> --out <step folder>/parity-differences.md. Delete the run folder once its differences are judged, keeping the baseline.

10. File map

Path Role
tests/CMakeLists.txt Umbrella — builds all suites in one configure
tests/cmake/PinPointTests.cmake Shared infra: Qt prefix, pp_find_eigen, sanitizers, lazy gtest, pp_add_test
tests/CMakePresets.json tests / tests-asan / tests-tsan presets (run from tests/)
tests/MIGRATION.md Historical record of the consolidation + remaining cleanup
src/Analysis/tests/ 84 — by far the largest. Wrist-assessment engine, the stage mechanism and one test per stage, segmentation/metrics, shaft + clubhead + ball tracking, pose helpers, scoring and norms, the diagnostics/characteristic packs, orientation filters, IMU driver parse, the shot arbiter, and the Export round-trip. Reach for ctest -R <pattern> here, not the whole suite.
src/Buffer/tests/ Lock-free ring, timeline merge, watchdog, thread-policy, fuzz (8, GoogleTest, links pinpoint_buffer). Not migrated to pp_add_test — own gtest fetch, own PINPOINT_ENABLE_* sanitizer options.
src/Core/tests/ Resource profiler (core, concurrency/TSan, compile-out), OS + GPU metrics, stats log, profiler controller (7, GoogleTest; refactor 3.7-I adds processMemory() and the [GpuMem] line's text to the OS-metrics and controller tests); the standard club table and the Height field (2, GoogleTest); post_shot_trace_test — the [PostShot] step timer (post_shot_trace.h, refactor 3.7-I; GoogleTest with its own main): see "The post-shot bench" in §9; the two persistence mechanisms and the one worker pool (3, hand-rolled main, Qt Core only): atomic_write_test — the one atomic write (atomic_write.h, R-PERS-2): a file replaced whole, a missing folder made (or refused with intoExistingFolder), the original byte-identical after an unwritable folder, a read-only file or a refused rename, no temporary left, the streaming forms (a writer callback and AtomicFile held across calls), text mode; moved here from Diagnostics/tests/pack_io_test with the helper (refactor step 2.0), which now pins only pack_io's forwarding call — and folder_lock_test — the advisory folder lock (folder_lock.*, R-PERS-6): two lock objects (held → Locked, naming the holder, then free once let go), a lock left by another machine freed only by age (stale after 60 s), a missing folder not made, and (step 2.8b) lockOrJoin joining a hold the same thread already has — never another thread's, while a plain lock() on the same thread still answers Locked — and a hold taken through a symlink whose folder vanishes mid-hold leaving no stale entry behind (the registry key kept from acquisition) — and work_pool_test — the one worker pool, its serial lanes and the post-to-owner receiver (work_pool.*, R-CON-5; refactor step 3.1, D15): a lane keeps order (60 jobs on four workers, never two at once); two lanes do not block each other; a cancelled lane drops its waiting jobs and releases their values at once while its running job finishes, and a submit after cancelling a running lane waits behind the running job (the lane stays serial); destroying the pool with a job running and jobs waiting never runs the waiting ones, releases their values, and returns once the running one finishes; priorities (a higher priority first, then the foreground lane, then the earliest; a Low job with its thread set to LowPriority — Qt's stored value, not the OS's — and the worker back at NormalPriority after it, D24); the receiver drops a result whose session is not loaded, is another instance of it, or whose shot is gone, drops a superseded ask, and keeps only the shot's exact latest, telling the owner of every drop but the first two so its batch settles; a job posted through the pool arrives on the receiver's thread, delivery stays first in, first out when an owner spins an event loop inside its deliver, a throwing job still posts (its error set), and a released session's running job is dropped at the receiver; the process-wide counter never repeats a number across sessions or threads. Also clean under ThreadSanitizer (-DPP_SANITIZE=thread); isolated_stores.h, the one test-isolation helper (#187), with isolated_stores_test (hand-rolled main) and store_isolation_lint_test (registered by the umbrella): see "Per-user stores" in §9
src/Gui/tests/ TimelineLabels, chart metrics, SwingSeriesModel, ShotListModel, ReanalysisController, QML reactivity (6). Step 2.3: athlete_repository_test (AthleteStore, the Athlete and AthleteController on a temp library and a scratch INI — swing_export_developer_guide.md §15) beside athlete_session_guard_test (no switch mid-session; an edit never emits currentAthleteChanged), both from athlete_session_guard_tests.cmake, sharing athlete_test_library.h. Step 2.7b extends three: charts_traces_presenter_test (shotNumberAfterAGap: after a trashed swing the kicker reads "Shot 9 · 8 of 15", the against-the-previous label "shot 8", a shot before the gap "Shot 3 of 15"), charts_delivery_presenter_test (golfersDayNameDateType: under name-date-type the day's sibling is pooled and named "session 1" by its n-of-day; the kicker and the shape marks carry the swing number; golfersDay checks the scatter's sessionLabel and shotNo) and report_lm_test (section I: the launch monitor's rows, left-out list and notes by swing number after a gap).
src/IMU/tests/ Impact detector, ImuIoWorker, ESKF gyro-unit pin (3)
src/LaunchMonitor/tests/ LastShot.CSV parsing (columns by name not position, metric and imperial units as FSX2020 declares them, closure rate in dps or rpm, the derived values, malformed/torn/short input), shot attribution, and the standalone gate exhaustive over all 2^7 precondition states (3, GoogleTest; the pairing test writes its own fixtures into a QTemporaryDir and needs Qt6 Test)
src/Pose/tests/ v2 temporal ball tracker + its live/offline parity, BallDetector throttle contract, heatmap decode, pose-model selection (5)
src/Audio/tests/ Acoustic onset detector (1)
src/Diagnostics/tests/, src/Stores/tests/, src/Vocabulary/Metrics/tests/, src/Vocabulary/Identity/tests/, src/DomainModel/tests/ Sources only — no suite of their own. Compiled by the Analysis suite (counted in its 84) because they link swing_analysis.h / the pack types. See below. The last two (refactor step 2.1): identity_test — AthleteId, SessionId, ShotRef (src/Vocabulary/Identity/identity.h): each reads back the text it writes and nothing else (no folder name or path reads as one; no constructor from text, by static_assert), hashing, order, a QVariant round trip — and session_identity_test — SessionIdentity: a legacy folder name read under every naming pattern against the names SwingPaths composes, D3's name-based id against golden values from Python's uuid.uuid5, n-of-day by start time (by folder name when a day lacks start times — the app's order, not the per-type _NN: step 2.7a's N12, N13), the local day in a given time zone, the label. Step 2.2 adds session_repository_test (src/Stores/tests/) — SessionStore, the adapter of SessionRepository: session.json's keys, a newer schema read-only, resume (today's session of the same type, same SessionId), End (which never discards from step 3.4a-ii: the empty discard is Session::end's), a legacy folder read without a write, enumerate, one in-progress session per athlete, the allocator never reissuing a number, D7's store half (the old session ended where it is, or left in progress when unreachable, and a new one in the new library) and a held FolderLock refusing the write; and (step 2.8b, section J, J-18) a crash-left session ended by the next Start gets the latest of its swings' capture ends, marked endInferred, no end when none records a capture time, and an End is never marked; and (section G, D11: DEC-158) SessionStore::fileSaysInProgress, the tools' check: a session being recorded is in progress, an ended one, a legacy one, an unreadable file and no folder are not, and the check writes nothing. swing_paths_test's allocator sections (N, A, R, B, E, K) moved into it with the allocator; swing_paths_test keeps the names, sanitise and the trash. Step 2.5 adds golfer_input_test (src/Diagnostics/tests/, audit H-04's missing test, on the diagnostics model's link line): a focus, a run, a screen answer, a miss, a shot intent and a correction live in session_input.json and the shots' reviews, and survive diagnostics.json being deleted; a legacy session (its input in diagnostics.json's older keys only) reads identically, keeps the keys byte for byte through a regrade (setRebuildCache, as regrade_ledger runs it), takes an edit in the new home and holds a cleared answer explicitly; an envelope written before step 2.5 reads as its moved copy does; a newer envelope is read-only and the golfer told; session_input.json keeps unknown keys and refuses a newer schema; the older keys survive the cache being deleted mid-activation and a catch-up activation; a club-baseline freeze read off the GUI thread gives the synchronous freeze's baseline, grades nothing before it, and a golfer command or a re-activation during it waits for it or lets it go. Step 2.7a adds shot_number_test (src/Diagnostics/tests/, the same link line): after a trashed swing and one with no document, the ledger's "shot N" — the header's label, the review badge, every readout — is the swing number, a session with no gap reads as before; under the name-date-type pattern a session still has its day (a live panel freezes its club baseline over the day before: F-06), and two sessions of one day are placed by their session files' start times, which the tendencies "as of" a session follow. Step 3.3 adds two (src/Diagnostics/tests/, on FIRE_FINDINGS_TEST_SOURCES, the measure-dump link line plus fire_findings.cpp): fire_findings_test — fireFindings() and deriveShotData() (src/Diagnostics/engine/fire_findings.*) on one swing, lm_7iron: the same readings and inputs give the same record and stamp, and every field of FiringInputs moves firingStamp() — the pack, the norms, the cohort (a women's row read only for a woman) and the club baseline move the findings too, the flight table the derived data, SET-06 nothing else (recorded, not applied); a broken recording withholds every row; the derived data is composeShotOutcome + shotFactors — and rule_version_golden_test (R-STAMP-3, audit C-05) — fireFindings() on the four live_swings fixtures, against a frozen copy of the pack, norms and contexts (src/Diagnostics/tests/data/rule_version_golden/, never the shipped files, so a content edit cannot move it or hide a rule change), with its digest in rule_version_golden/golden.json keyed by kDiagSchemaVersion, kRowWordsVersion, kRowGradingVersion and kPhaseGridSchemaVersion: it fails when an output moves and no version did, when a version moved until the golden is re-recorded, and (its own check, frozenContent) when the frozen copy was edited (PP_RECORD_RULE_GOLDEN=1 ctest --test-dir build/tests -R '^rule_version_golden_test$'); each number is snapped to 0 below 1e-9 (−0 too) and rounded to 9 significant digits before the digest, and a mismatching record is written beside the build for diffing. Step 3.4a adds session_test (src/DomainModel/tests/, on the Recording store's link line plus the store, the Athlete, Session, Shot and app), over the real session store, swing door and reading door on a temporary library: a start ends the session running here first (EVT-09 before EVT-17); resume only today's session of the same type, with its own id (EVT-23), the session running here ended first, another type or yesterday's refused; an empty session ended is trashed by its Athlete (EVT-20, no EVT-09), one with a swing or a resumed one ends (EVT-09) and stays; addShot allocates (the folder, the high-water) then makes the Shot, with no EVT-01 until capture's document write is reported, then exactly one; trashShot (EVT-03) never reissues the number and deletes the Shot only when the event loop runs (deleteLater); the events in command order; a Shot and a Session have no public constructor (static_assert), one instance per ref and per id; a RecordingSource reads nothing once its session is unpublished; app.sessionAt through the current athlete, none for another athlete's folder; the id-keyed diagnostics files (J-42) written and read back where SessionFiles names them, an id not held refused; trashSession refuses a session in progress (J-46); and (step 3.4a-ii) a session started on demand is never the empty discard's and the store's own End never discards (S12), resuming the session already running here writes and emits nothing and leaves it resumed work (S13), addShot hands back the whole allocation with the caller's kind (S14). Both suites set their stores with SessionStore::setOsTrashForTest(false), so every trash lands in the library's own .pinpoint-trash inside the temporary folder (asserted), never in the OS trash. Step 3.4b-i adds shot_commands_test (src/DomainModel/tests/, on the diagnostics model's link line plus the Athlete, Session, Shot, the athlete store, app and ShotListModel), over the real athlete store, session store and swing door on a temporary library and temporary settings (QSettings::setPath): each of the Shot's commands (rate, note, setDeclaredClub, correctClub, excludeReading, setShotIntent — now and on a worker —, correctLabel, completeCapture for a reading and a phone clip's stream, setMarkupTruth) saves to today's key, then emits its event once (none for a rating, a note or the truth), and a save that changes nothing emits nothing; the Athlete appends one tuning-log line on EVT-06; on a shot with no document every command is refused with its reason and emits nothing (no tuning line); the Session's setSessionIntent / setIntentRun write field by field (the caller's value only for a field the file lacks) and emit EVT-10 / EVT-08; the door (app) reaches a held shot and not a folder no Session holds; the carousel's edits through the door save the one fact (a rating writes the rating alone) and emit EVT-21 / 04 / 05, and without a door keep today's write-through; the old diagnostics model's setShotIntent, correctOutcome, declareMiss, recordScreenResult, declareFocusFrom and setIntentFrom emit the same events, saved where they always were. Its stores trash nothing outside the temporary folder. Step 3.4b-ii adds three sections (C14–C16): Shot::applyAnalysis writes re-analysis's analysis back and emits EVT-02 once (nothing for a launch-monitor-only shot whose rows are current; NoDocument for a shot with none); the Shot's summary is its repository's cheap read field for field, follows its own saves and is read again after a re-analysis; the carousel's rows over the Shots — a session load lists the Session's shots (newest first, the swingDir as today's text), an edit's row shows what the Shot holds after its save (a save that fails, its folder made unwritable, leaves the row as the shot is), a live row's number and review facts are its Shot's, and the carousel's delete is Session::trashShot (EVT-03, the Shot let go, the number never reissued), with today's paths when no door is set; and ReanalysisController reads a held shot through its Shot's RecordingSource (the analysis is stubbed in the test and records what it was handed) and writes back through app (EVT-02 once), a launch-monitor-only shot's rows through the Shot too, and no door keeps today's path. Round 2 (review 1) adds C15k (a session its Athlete holds is answered by Athlete::sessionAt with its session file unreadable: nothing read again), C16f (a rescued camera shot — allocated captured, its document written device-only by the launch monitor — is routed by its document's classification: its rows refreshed through the Shot, never analysed) and C16g (the Shot's write-back of a camera shot writes the same document and the same swing-file bytes as HEAD's path, persistReanalysis straight to the repository). reanalysis_controller_test and recording_repository_test (Test 10, the write-back) take the new reanalyzeShot(RecordingSource) / reanalyseAndPersist(write, source, deviceOnly, …) forms. Step 3.5-i adds session_diagnostics_test (src/DomainModel/tests/, on FIRE_FINDINGS_TEST_SOURCES plus the Recording store's line, the session store, the Athlete, Session, Shot, SessionDiagnostics, the firing reader and the pool), over the real store, swing door, pool, receiver, the process's RuleData and the real fireFindings on a temporary library (every trash into its own .pinpoint-trash): most cases read the shots through a fake FiringReader that lays a club and a launch angle over lm_7iron's grid and can hold one read at a gate, so each race is staged on purpose — a club correction fires the shot once and derives both clubs' shots once each (J-2); a shot of another club in flight while a usual changes is kept (REVIEW-1); a superseded result is dropped and the batch settles once; a trashed shot's result is dropped (ItemGone) and settles; a session released and loaded again while its re-fire runs keeps none of the old instance's results (T1); one new shot derives exactly its club's shots once, none of another club, and a shot that leaves the usual unchanged asks nothing more (T2), with every earlier finding exactly as fired (a usual's change re-derives only, DEC-191); a read that fails mid-run (the session unpublished) is unread, the kept findings untouched, the mark persisted in diagnostics.json's unread and the next load re-asks exactly those (T3); a release writes what is kept first and a load re-asks exactly the stale and missing shots (T4); the real reader, headless, keeps what fireFindings gives on the document's own read (R); and a sweep holds at most one released session at a time, the running one and one in use refused (Q18). Round 2 (review 1) adds: a shot with a label correction and a shot intent, released and loaded again, derives the same outcome, its review read on the worker (WORD); golfer input only in diagnostics.json's older keys gives the same derived data as the same input in its new homes, by the one J-33 rule (golfer_input_rules.h) the old model's golferInput uses too (LEG); a derive that throws is marked and not asked again until an input moves, on the pool and headless (FAIL); the cohort is the record's on each shot's own date, and a sex / date-of-birth change re-fires every shot (COH). Also clean under ThreadSanitizer (build/tests-tsan). Step 3.5-ii adds (with session_reduction.cpp on its line): each shot's derived data is persisted with its findings, ids and numbers only, and a load takes it back — nothing fired or derived, no review read, each shot's facts as before — until a layer-3 input moves (DER; WORD and FAIL now load a file of the older shape, its derived taken out, so they still prove the load-time derive); the diagnosis on the lane, headless over the real reader: one reduction per settled batch, the typed results (three shots, three "because", the work-ons keyed by the folder's name, the owner's usuals), no "because" on a shot's own outcome (J-14 (b)), work_ons.json read by today's reader as today and by the typed reader with every DEC-192 field, the stage and closed written, an ended session closed from its Session's status, a declared focus (EVT-10) re-reduced with no shot asked (DIAG); the typed reader strict, lenient (an older schema read as it stands, without DEC-192's keys) and never for a newer schema (RJ). `regrade_ledger --engine=old
src/Update/tests/ Linux updater pure logic (version compare, arch-aware AppImage asset selection, GPG VALIDSIG parse, placeholder-key refusal), PlatformTarget arch tokens, and UpdateController state-machine + relaunch session-safety policy via a FakeUpdateBackend (3, GoogleTest; policy test needs Qt6 Qml + Test)
tools/migrate/tests/ Sources only. migrate_step2_test (refactor step 2.8a), compiled by the Analysis suite: pps_migrate_step2's engine on a fixture library (see "The step-2 migrations" in §9).

See also: the per-subsystem developer guides in this folder (e.g. shot_detector_developer_guide.md, resource_profiler_developer_guide.md) for what each suite actually asserts.

Footnotes

  1. --path old (the panel's own old engine) and its --parallel were removed in refactor item 5.3, 22 Nov 2026, ahead of step 5.4 deleting that engine. ↩

  2. The defaults of regrade_ledger and athlete_dump moved from old to new in refactor item 5.3, 22 Nov 2026, which also added the corpus's athletes.json (the Product Owner's answer 1 to step 5's questions). ↩ ↩2

  3. Refactor item 5.3c, 22 Nov 2026, after 5.3's review (REVIEW-5.3 R1, R2): on the migrated library athlete_dump made each athlete's id from the folder's name, matched none of the sessions' files, and dumped 0 sessions with exit 0. ↩ ↩2 ↩3 ↩4