tests: cover x2w_audio saturating counters, snapshots, and refusal totals #3747

Manually merged
github merged 1 commit from github-bot/gh-3745 into gh-pr/3745/base 2026-12-01 17:05:25 +00:00 AGit
Owner

@⁠Ammmae0x on GitHub · 2026-12-01 14:06 UTC · original
Ammmae0x:tests/audio-telemetry → main · +1063 −0 · 5 files · 1 commits · merged 2026-12-01 17:04 UTC

Refs #1149

Add portable C++17 unit, boundary, thread-saturation, and 1:1 header-mutation tests for x2w_audio (src/startup_stubs/audio_telemetry.h), with zero edits to existing files (5 new files only, +1063/-0).

24 cases in tests/audio_telemetry_check.cpp: saturating_add (zero amount on zero and UINT64_MAX, default 1, exact fit, overflow-by-1 clamp, adding UINT64_MAX to non-zero, concurrent exact sum and concurrent saturation near UINT64_MAX), OpusCounters/snapshot (zero init of all 11 fields, 11 distinct primes read back without swaps), saturating_total (in-place + return equality, exact fit, overflow-by-1 clamp), refused_total (ignores non-refusal fields, single-field isolation for all 8 refused_* fields, their sum, cross-field overflow clamp). tests/cmake/audio_telemetry.cmake registers per-case tests plus audio_telemetry_all and 6 WILL_FAIL TRUE header-copy controls; tests/audio_telemetry_meta_check.py audits the contract and kills each mutant natively with g++.

Linux checks (this host, g++ 13.3.0):

python3 -B tests/audio_telemetry_meta_check.py
PASS: audio_telemetry: 24 cases, 6/6 mutations killed (g++)

form_coverage_check.py, docs_links_check.py (208 files/802 links) and bidi_controls_check.py (2826 files) pass; git diff --check clean; scratch CMake + CTest 31/31; run_checks_parallel --from-dir tests/checks/python-linux: all 90 checks passed. Merge-tree against current origin/main exits 0 with no conflicts. No mingw on this host, so no Windows compile check; Windows verification is the arbiter.

AI-assisted.

Windows Verification (031af6e7)

  • git merge-tree --write-tree upstream/main HEAD -> 92e4ee6b (exit 0), git diff --check clean
  • Python checks: py_compile, form_coverage_check.py, docs_links_check.py (209 files, 806 links), bidi_controls_check.py (2830 files) passed
  • Commands:
cmake --build --preset dev --target audio_telemetry_check audio_telemetry_add_overflow_mut audio_telemetry_add_default_mut audio_telemetry_snapshot_swap_mut audio_telemetry_total_overflow_mut audio_telemetry_refused_includes_type3_mut audio_telemetry_refused_capacity_mut
ctest --preset dev --no-tests=error -R "^audio_telemetry" --output-on-failure
cmake --build --preset release --target audio_telemetry_check audio_telemetry_add_overflow_mut audio_telemetry_add_default_mut audio_telemetry_snapshot_swap_mut audio_telemetry_total_overflow_mut audio_telemetry_refused_includes_type3_mut audio_telemetry_refused_capacity_mut
ctest --preset release --no-tests=error -R "^audio_telemetry" --output-on-failure
  • Results: dev 31/31 passed (1.23s); release 31/31 passed (1.11s); audio_telemetry_check: PASS: audio_telemetry: 24/24 cases passed. AI-assisted.
**@⁠Ammmae0x** on GitHub · 2026-12-01 14:06 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3745) `Ammmae0x:tests/audio-telemetry` → `main` · +1063 −0 · 5 files · 1 commits · merged 2026-12-01 17:04 UTC Refs #1149 Add portable C++17 unit, boundary, thread-saturation, and 1:1 header-mutation tests for `x2w_audio` (`src/startup_stubs/audio_telemetry.h`), with zero edits to existing files (5 new files only, +1063/-0). 24 cases in `tests/audio_telemetry_check.cpp`: `saturating_add` (zero amount on zero and `UINT64_MAX`, default 1, exact fit, overflow-by-1 clamp, adding `UINT64_MAX` to non-zero, concurrent exact sum and concurrent saturation near `UINT64_MAX`), `OpusCounters`/`snapshot` (zero init of all 11 fields, 11 distinct primes read back without swaps), `saturating_total` (in-place + return equality, exact fit, overflow-by-1 clamp), `refused_total` (ignores non-refusal fields, single-field isolation for all 8 `refused_*` fields, their sum, cross-field overflow clamp). `tests/cmake/audio_telemetry.cmake` registers per-case tests plus `audio_telemetry_all` and 6 `WILL_FAIL TRUE` header-copy controls; `tests/audio_telemetry_meta_check.py` audits the contract and kills each mutant natively with g++. Linux checks (this host, g++ 13.3.0): ```text python3 -B tests/audio_telemetry_meta_check.py PASS: audio_telemetry: 24 cases, 6/6 mutations killed (g++) ``` `form_coverage_check.py`, `docs_links_check.py` (208 files/802 links) and `bidi_controls_check.py` (2826 files) pass; `git diff --check` clean; scratch CMake + CTest 31/31; `run_checks_parallel --from-dir tests/checks/python-linux`: all 90 checks passed. Merge-tree against current `origin/main` exits 0 with no conflicts. No mingw on this host, so no Windows compile check; Windows verification is the arbiter. AI-assisted. <!-- WIN-VERIFY: passed | sha=031af6e760872aecb422e45c603eecec1e8c4bd2 | targets=audio_telemetry_check audio_telemetry_add_overflow_mut audio_telemetry_add_default_mut audio_telemetry_snapshot_swap_mut audio_telemetry_total_overflow_mut audio_telemetry_refused_includes_type3_mut audio_telemetry_refused_capacity_mut | ctest=^audio_telemetry | release=true --> ### Windows Verification (`031af6e7`) - `git merge-tree --write-tree upstream/main HEAD` -> `92e4ee6b` (exit 0), `git diff --check` clean - Python checks: `py_compile`, `form_coverage_check.py`, `docs_links_check.py` (209 files, 806 links), `bidi_controls_check.py` (2830 files) passed - Commands: ```text cmake --build --preset dev --target audio_telemetry_check audio_telemetry_add_overflow_mut audio_telemetry_add_default_mut audio_telemetry_snapshot_swap_mut audio_telemetry_total_overflow_mut audio_telemetry_refused_includes_type3_mut audio_telemetry_refused_capacity_mut ctest --preset dev --no-tests=error -R "^audio_telemetry" --output-on-failure cmake --build --preset release --target audio_telemetry_check audio_telemetry_add_overflow_mut audio_telemetry_add_default_mut audio_telemetry_snapshot_swap_mut audio_telemetry_total_overflow_mut audio_telemetry_refused_includes_type3_mut audio_telemetry_refused_capacity_mut ctest --preset release --no-tests=error -R "^audio_telemetry" --output-on-failure ``` - Results: `dev` 31/31 passed (1.23s); `release` 31/31 passed (1.11s); `audio_telemetry_check`: `PASS: audio_telemetry: 24/24 cases passed`. AI-assisted.
Refs #1149

Add portable C++17 unit, boundary, thread-saturation, and 1:1
header-mutation tests for x2w_audio
(src/startup_stubs/audio_telemetry.h), with zero edits to existing
files (5 new files only). 24 cases: saturating_add (zero amount on
zero and UINT64_MAX, default 1, exact fit, overflow-by-1 clamp,
adding UINT64_MAX to non-zero, concurrent exact sum and concurrent
saturation near UINT64_MAX), OpusCounters/snapshot (zero init of
all 11 fields, 11 distinct primes read back without swaps),
saturating_total (in-place + return equality, exact fit,
overflow-by-1 clamp), refused_total (ignores non-refusal fields,
single-field isolation for all 8 refused_* fields, their sum,
cross-field overflow clamp). CMake registers per-case tests plus
audio_telemetry_all and 6 WILL_FAIL TRUE header-copy controls.

Linux checks (this host, g++ 13.3.0):
  python3 -B tests/audio_telemetry_meta_check.py
  PASS: audio_telemetry: 24 cases, 6/6 mutations killed (g++)
  form_coverage_check.py, docs_links_check.py (208 files/802 links),
  bidi_controls_check.py (2826 files) pass; git diff --check clean;
  scratch CMake + CTest 31/31; run_checks_parallel --from-dir
  tests/checks/python-linux: all 90 checks passed.
Windows verification pending (MSVC CTest ^audio_telemetry).
No mingw on this host, so no Windows compile check.

AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 14:06:46 +00:00
github-bot changed target branch from main to gh-pr/3745/base 2026-12-01 17:05:22 +00:00
github manually merged commit 031af6e760 into gh-pr/3745/base 2026-12-01 17:05:25 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.