Wine-NSPA RT Test Harness

This page documents the current Wine-NSPA validation harness: the two-layer full-suite boundary, the default PE validation matrix, the native ntsync suite, and the targeted validators that sit outside the archived matrix.

Table of Contents

  1. Validation model
  2. Current archived boundary
  3. Layer 2 default PE matrix
  4. Layer 1 native ntsync suite
  5. Targeted validators outside the full-suite archive
  6. Runners and output
  7. Safety
  8. Extending the harness
  9. Environment and prerequisites

1. Validation model

The current test surface is split into four categories:

The important maintenance rule is that these categories are not interchangeable. If a carry is validated only by a targeted harness, the public docs should say that explicitly instead of silently folding it into the matrix totals.

Wine-NSPA validation model archived full-suite boundary Layer 1 native suite + Layer 2 default PE matrix current archived snapshot: `v9-validation-default` native: kernel invariants PE matrix: Win32 / ntdll / wineserver / kernel path targeted validators focused checks for newer carries scheduler probes, memory shell harnesses, workload A/Bs documented as targeted validation, not matrix totals opt-in perf tests `srw-bench`, `seqlock-bound`, and similar CPU-heavy probes useful for perf snapshots, excluded from the default matrix historical comparison old totals only compare cleanly within the same methodology family see the comparison page for the v3-v9 boundaries

2. Current archived boundary

The current archived full-suite snapshot is:

Item Value
Archive v9-validation-default
Archive timestamp 2026-05-03 12:54:16 -0500
Layer 1 native suite 3 PASS / 0 FAIL / 0 SKIP
Layer 2 PE matrix 32 PASS / 0 FAIL / 0 TIMEOUT
Layer 2 test count 16 default tests x 2 modes
Modes baseline and rt

Layer 2 in this archived snapshot covers:

Mode definitions:

One detail worth preserving in the docs: socket-io currently reports an implicit verdict in the suite archive (PASS*) because the test exits 0 without printing an explicit PASS line. The suite still counts it as a pass, but the output format difference is intentional and should stay documented.

The newer subsystem carries that were validated after this archive should be described as targeted validators unless and until another full archived matrix is cut.


3. Layer 2 default PE matrix

The current default PE matrix is driven by nspa/run_rt_tests.sh. It is a validation set, not a “run every possible subcommand” set.

3.1 Default validation tests

Test Surface Primary contract
rapidmutex CRITICAL_SECTION fast path integrity and wait-bound behavior under hot contention
philosophers transitive PI chain no starvation or deadlock through the chain
fork-mutex process spawn path repeated CreateProcess + child exit stays clean
cs-contention CS-PI slow path RT waiter is bounded behind a normal-priority holder
signal-recursion virtual_mutex + fault path recursive PAGE_GUARD fault path stays deadlock-free
large-pages large-page alloc + mapping + reporting allocation, SEC_LARGE_PAGES, and QueryWorkingSetEx semantics
ntsync-d4 / d8 / d12 userspace sync -> /dev/ntsync PI, priority wakeup, chain semantics, WFMO
socket-io deferred socket path latency / completion correctness on RECVMSG + SENDMSG
condvar-pi Win32 condvar PI bridge waiter wake / mutex reacquire path stays PI-clean
nt-timer local NT timer path timer create/set/cancel/query/wait semantics
wm-timer local WM_TIMER path message delivery, coalescing, kill semantics
rpc-bypass irpcss bypass path functional parity across the RPC bypass surface
irot-bypass Running Object Table bypass path functional parity across the ROT bypass surface
dispatcher-burst gamma dispatcher hot path same-path request/reply correctness and burst-drain behavior

3.2 Optional tests outside the default matrix

Test Gate Why it is excluded by default
priority INCLUDE_PRIORITY=1 it sleeps for manual ps / chrt inspection and is not a routine matrix test
srw-bench WITH_BENCH=1 CPU-heavy perf benchmark rather than contract validation
seqlock-bound WITH_BENCH=1 workload-bound perf / retry probe, not default validation

3.3 Dispatcher-specific PE coverage

dispatcher-burst remains important because most other PE tests do not stress the gamma dispatcher path directly. It is the PE-side oracle for:

Archived v9-validation-default result:

Metric Result
baseline verdict PASS
rt verdict PASS
archive position part of the 16-test default matrix

The earlier 2026-04-30 A/B numbers remain useful historically, but the current public fact is that dispatcher coverage is part of the default full-suite boundary rather than a side harness.


4. Layer 1 native ntsync suite

Layer 1 is driven by wine/nspa/tests/run-rt-suite.sh native. These tests exercise kernel-only invariants that the PE layer cannot reach directly.

4.1 Default native tests

Test Coverage
test-event-set-pi EVENT_SET_PI smoke and boost shape
test-channel-recv-exclusive channel receive wake behavior
test-aggregate-wait aggregate-wait coverage including mixed object/fd and kitchen-sink cases

Archived v9-validation-default result:

4.2 Opt-in native stress tests

These are not part of the default validation boundary:

Test Gate Purpose
test-channel-stress WITH_NATIVE_STRESS=1 channel churn / cleanup hammer
test-event-set-pi-stress WITH_NATIVE_STRESS=1 EVENT_SET_PI stress
test-mixed-load-stress WITH_NATIVE_STRESS=1 mixed-driver soak
test-mutex-pi-stress WITH_NATIVE_STRESS=1 mutex PI contention hammer

4.3 SKIPPED_BY_DESIGN

Two tests remain excluded because they assert behavior that is no longer part of the active kernel/userspace contract:

They are kept as source history and canaries, not as active validation.


5. Targeted validators outside the full-suite archive

These checks matter, but they are not the same thing as the archived matrix.

Surface Validator Public use
sched-hosted local_timer / local_wm_timer run-rt-probe-validation.sh targeted scheduler-host validation
socket RECVMSG / SENDMSG tuning socket-io plus workload captures latency / throughput follow-on measurement
thread/process shared-state readers dedicated A/B harnesses query-class and zero-time-wait correctness
msg-ring empty-poll and TEB carries workload counters hot-path cost measurement
RT-keyed memory follow-ons shell harnesses such as test-mlock-ws.sh, test-huge-auto.sh, test-heap-hugepage.sh memory-specific correctness and behavior

This separation is what keeps the public numbers honest: the archived full-suite totals stay stable, while newer subsystem carries can still be documented with their own validators.


6. Runners and output

6.1 Two-layer runner

wine/nspa/tests/run-rt-suite.sh drives the public two-layer suite:


wine/nspa/tests/run-rt-suite.sh
wine/nspa/tests/run-rt-suite.sh native
wine/nspa/tests/run-rt-suite.sh wine

It:

6.2 PE runner

nspa/run_rt_tests.sh is the Layer 2 orchestrator. It:

Verdict resolution order:

  1. timeout -> TIMEOUT
  2. explicit PASS line -> PASS
  3. explicit FAIL line -> FAIL
  4. fallback to exit code -> PASS* / FAIL*

6.3 Build


i686-w64-mingw32-gcc -O2 -static programs/nspa_rt_test/main.c -o nspa_rt_test.exe -lws2_32

Native ntsync tests are built on demand by run-rt-suite.sh.


7. Safety

The harness has two layers of timeout protection:

Other safety rules:

These are part of the methodology, not just implementation detail: they keep the validation suite usable on a real development machine.


8. Extending the harness

8.1 Adding a PE validation test

  1. Add a new cmd_foo() handler to programs/nspa_rt_test/main.c.
  2. Register it in the commands[] table.
  3. Decide whether it belongs in:
  4. If it belongs in the default matrix, add it to the tests=() array in nspa/run_rt_tests.sh.

8.2 Adding a native test

  1. Add test-foo.c under wine/nspa/tests/.
  2. Add test-foo to NATIVE_TESTS=() or NATIVE_STRESS_TESTS=().
  3. Use exit code 77 for skip.

The important maintenance rule is classification: do not put a perf probe into the default validation matrix unless it is actually validating a contract.


9. Environment and prerequisites

9.1 Common runner variables

Variable Purpose
WINE Wine binary path
WINEPREFIX prefix used for Layer 2
TEST_EXE nspa_rt_test.exe path
LOG_DIR per-run Layer 2 logs
TIMEOUT_SECS shell-level timeout
RT_PRIO / RT_POLICY RT-mode settings

9.2 Optional gates

Variable Effect
INCLUDE_PRIORITY=1 include priority in Layer 2
WITH_BENCH=1 include srw-bench and seqlock-bound
WITH_NATIVE_STRESS=1 enable native stress tests
NATIVE_STRESS_DURATION=N per-stress-test duration

9.3 Prerequisites

Requirement Why it matters
/dev/ntsync present Layer 1 and ntsync Layer 2 tests
RT-capable kernel RT-mode scheduling behavior
hugepages configured large-pages path
RT privilege / CAP_SYS_NICE FIFO promotion in RT mode

For matrix lineage and comparability rules, see nspa-test-comparison.