ci: run the startup audio timeline check in CTest and the Python job #1863

Merged
Asimmimx merged 1 commit from upstream-pr/1870 into main 2026-11-24 21:12:35 +00:00
Asimmimx commented 2026-11-24 19:52:03 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Asimmimx on 2026-11-24T19:52:03Z.


Change

tests/startup_audio_timeline_check.py (the control for tools/startup_audio_timeline.py, added in #1763 and extended in #1842) is not registered anywhere: it has no CTest entry and it is not in the platform-independent Python job. Only docs/startup-audio-timeline.md gives its command (python -B tests/startup_audio_timeline_check.py), so neither ctest nor CI runs it and the cases added in #1842 are not exercised on new changes.

This PR only registers the existing check. It does not touch the check or the tool.

  • CMakeLists.txt: add_test(NAME startup_audio_timeline ...) through ${INTAKE_PYTHON} -B, inside an if(EXISTS "${INTAKE_PYTHON}") guard like the other Python-driven tests, with TIMEOUT 60. It sits after startup_audio_provider with the other startup audio tests.
  • .github/workflows/windows.yml: added to the python-linux "Run Python checks" list after tests/awc_metadata_check.py.
  • AGENTS.md: the same entry at the same position in the "Pure-Python checks" list, so the two lists stay in the same order.

The check is platform-independent. It uses only csv, json, pathlib, subprocess, sys, tempfile and unittest, and runs the tool (which imports argparse, csv, dataclasses, json, math and pathlib) on generated packet statistics in a temporary directory. It needs no audio device, GPU, Windows API or game files.

Verification

Base: afddddbd (current main). Windows 11 Pro 26300.9974, Python 3.12.10 (out/pe-env).

> out/pe-env/Scripts/python.exe -B tests/startup_audio_timeline_check.py
Ran 3 tests in 0.626s
OK                                     (exit 0)

> out/pe-env/Scripts/python.exe -B tools/run_checks_parallel.py tests/awc_metadata_check.py tests/startup_audio_timeline_check.py
all 2 checks passed

> out/pe-env/Scripts/python.exe -B tests/docs_links_check.py
Self-test passed.
Checked 18 Markdown files and 370 links.   (exit 0)

> out/pe-env/Scripts/python.exe -B tests/bidi_controls_check.py
Self-test passed.
Checked 1324 tracked source, script and build/CI files: no bidirectional controls.   (exit 0)

CMake registration, configure only (nothing built; the test needs no binaries):

> . .\tools\dev.ps1
> cmake --preset dev -DINTAKE_PYTHON=<repo>/out/pe-env/Scripts/python.exe
-- Configuring done / -- Generating done   (exit 0)
> ctest --preset dev --no-tests=error -R '^startup_audio_timeline$' -V
101: Test command: ...\python.exe "-B" ".../tests/startup_audio_timeline_check.py"
101: Test timeout computed to be: 60
101: Ran 3 tests in 0.713s
101: OK
1/1 Test #101: startup_audio_timeline ...........   Passed    0.84 sec
100% tests passed, 0 tests failed out of 1

Workflow YAML parsed with PyYAML. The python-linux "Run Python checks" step lists 59 unique paths, all of which exist, and the new entry is at index 13.

Negative control: on afddddbd, CMakeLists.txt and .github/workflows/windows.yml have no startup_audio_timeline entry (grep -c returns 0). The same ctest --no-tests=error -R '^startup_audio_timeline$' filter would therefore select nothing there. I inferred this from the grep and did not configure main separately.

Evidence and follow-up

No new fixture. The check generates its own packet CSV and input JSONL in a temporary directory.

Separate question: tests/pixel_fp32_vulkan_check.py is the only other tests/*check*.py that neither CMake nor the workflows reference. It needs Vulkan, so it does not belong in the pure-Python job, and I left it alone. Should it get a CTest entry with a capability skip (77), or is it meant to stay manual?

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6590132043 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1870). Originally posted by [Asimmimx](https://github.com/Asimmimx) on 2026-11-24T19:52:03Z. --- ## Change `tests/startup_audio_timeline_check.py` (the control for `tools/startup_audio_timeline.py`, added in #1763 and extended in #1842) is not registered anywhere: it has no CTest entry and it is not in the platform-independent Python job. Only `docs/startup-audio-timeline.md` gives its command (`python -B tests/startup_audio_timeline_check.py`), so neither `ctest` nor CI runs it and the cases added in #1842 are not exercised on new changes. This PR only registers the existing check. It does not touch the check or the tool. - `CMakeLists.txt`: `add_test(NAME startup_audio_timeline ...)` through `${INTAKE_PYTHON} -B`, inside an `if(EXISTS "${INTAKE_PYTHON}")` guard like the other Python-driven tests, with `TIMEOUT 60`. It sits after `startup_audio_provider` with the other startup audio tests. - `.github/workflows/windows.yml`: added to the `python-linux` "Run Python checks" list after `tests/awc_metadata_check.py`. - `AGENTS.md`: the same entry at the same position in the "Pure-Python checks" list, so the two lists stay in the same order. The check is platform-independent. It uses only `csv`, `json`, `pathlib`, `subprocess`, `sys`, `tempfile` and `unittest`, and runs the tool (which imports `argparse`, `csv`, `dataclasses`, `json`, `math` and `pathlib`) on generated packet statistics in a temporary directory. It needs no audio device, GPU, Windows API or game files. ## Verification Base: `afddddbd` (current `main`). Windows 11 Pro 26300.9974, Python 3.12.10 (`out/pe-env`). ```text > out/pe-env/Scripts/python.exe -B tests/startup_audio_timeline_check.py Ran 3 tests in 0.626s OK (exit 0) > out/pe-env/Scripts/python.exe -B tools/run_checks_parallel.py tests/awc_metadata_check.py tests/startup_audio_timeline_check.py all 2 checks passed > out/pe-env/Scripts/python.exe -B tests/docs_links_check.py Self-test passed. Checked 18 Markdown files and 370 links. (exit 0) > out/pe-env/Scripts/python.exe -B tests/bidi_controls_check.py Self-test passed. Checked 1324 tracked source, script and build/CI files: no bidirectional controls. (exit 0) ``` CMake registration, configure only (nothing built; the test needs no binaries): ```text > . .\tools\dev.ps1 > cmake --preset dev -DINTAKE_PYTHON=<repo>/out/pe-env/Scripts/python.exe -- Configuring done / -- Generating done (exit 0) > ctest --preset dev --no-tests=error -R '^startup_audio_timeline$' -V 101: Test command: ...\python.exe "-B" ".../tests/startup_audio_timeline_check.py" 101: Test timeout computed to be: 60 101: Ran 3 tests in 0.713s 101: OK 1/1 Test #101: startup_audio_timeline ........... Passed 0.84 sec 100% tests passed, 0 tests failed out of 1 ``` Workflow YAML parsed with PyYAML. The `python-linux` "Run Python checks" step lists 59 unique paths, all of which exist, and the new entry is at index 13. Negative control: on `afddddbd`, `CMakeLists.txt` and `.github/workflows/windows.yml` have no `startup_audio_timeline` entry (`grep -c` returns 0). The same `ctest --no-tests=error -R '^startup_audio_timeline$'` filter would therefore select nothing there. I inferred this from the grep and did not configure `main` separately. ## Evidence and follow-up No new fixture. The check generates its own packet CSV and input JSONL in a temporary directory. Separate question: `tests/pixel_fp32_vulkan_check.py` is the only other `tests/*check*.py` that neither CMake nor the workflows reference. It needs Vulkan, so it does not belong in the pure-Python job, and I left it alone. Should it get a CTest entry with a capability skip (77), or is it meant to stay manual? ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted (Claude Code).
tedin7 commented 2026-11-24 20:01:12 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T19:55:02Z.

Review: COMMENTED


Review of head be9862b6483911c8f1b63bca69fc786aa4a745a5 (base origin/main at dd753176 when I fetched). Comment only, not an approval.

Verdict: 0 P1 / 0 P2. The check is registered in all three places it needs to be, and it runs on Linux.

Linux limits. Linux x86_64, Python 3, CMake available but not the Windows toolchain. I did not run GitHub Actions and did not configure the real CMakeLists.txt (it needs the Windows SDK targets). PyYAML is not installed here, so I did not parse the workflow with a YAML loader; I read the edited region instead.

Diff (3 files, +9): one add_test in CMakeLists.txt, one line in the python-linux list of .github/workflows/windows.yml, one line in AGENTS.md. The tool and the check are untouched. The workflow line sits inside the existing backslash-continued run: block with the same 12-space indent and a trailing \, between tests/awc_metadata_check.py and tests/sgd5_effects_check.py. The AGENTS.md list has the same order.

What I ran at this SHA

  • python3 -B tests/startup_audio_timeline_check.py: "Ran 3 tests ... OK" (Python 3.14, exit 0).
  • tests/docs_links_check.py: 18 files, 370 links, clean. tests/bidi_controls_check.py: 1324 files, clean. git diff --check origin/main...HEAD: clean.
  • CMake registration smoke: I copied the new if(EXISTS ...) add_test(...) set_tests_properties(... TIMEOUT 60) endif() block into a throw-away CMakeLists with INTAKE_PYTHON=/usr/bin/python3, then ctest --no-tests=error -R '^startup_audio_timeline$': 1/1 passed. This proves the syntax and the filter, not the real project configure.
  • Mutations of tools/startup_audio_timeline.py, each followed by the check and git checkout -- . (tree clean afterwards):
Mutation check
packet validation 0 <= rms <= peak <= 1 reduced to 0 <= rms fail
frames < 1 relaxed to frames < 0 fail
window end made inclusive (packet.start >= end to >) pass
--sample-rate < 1 validation removed pass

Findings (non-blocking)

  1. P3, scope: this PR only registers the check, so it is right not to change it. Two behaviours of the tool (the exclusive end of the window, and the sample-rate argument validation) are not pinned by the check. Worth a follow-up now that the check will actually run.
  2. P3, style: neighbouring startup_* Python tests in this file use ${CMAKE_CURRENT_SOURCE_DIR}; this one uses ${CMAKE_SOURCE_DIR} (as INTAKE_PYTHON itself does). Same result at the top level; only a consistency note.
  3. P3, placement: the block lands between the startup_audio_provider properties and the startup_dump_fence_check setup lines, so it is mixed into the C++ audio targets rather than the if(EXISTS "${INTAKE_PYTHON}") group near line 166. Harmless, since it has its own guard.

The author's Windows run (configure plus ctest passing 1/1) is theirs; I did not reproduce it. Their question about tests/pixel_fp32_vulkan_check.py is for a maintainer.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6046335740 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1870#pullrequestreview-6046335740). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T19:55:02Z. **Review:** COMMENTED --- Review of head `be9862b6483911c8f1b63bca69fc786aa4a745a5` (base `origin/main` at `dd753176` when I fetched). Comment only, not an approval. **Verdict: 0 P1 / 0 P2.** The check is registered in all three places it needs to be, and it runs on Linux. **Linux limits.** Linux x86_64, Python 3, CMake available but not the Windows toolchain. I did not run GitHub Actions and did not configure the real `CMakeLists.txt` (it needs the Windows SDK targets). PyYAML is not installed here, so I did not parse the workflow with a YAML loader; I read the edited region instead. **Diff** (3 files, +9): one `add_test` in `CMakeLists.txt`, one line in the `python-linux` list of `.github/workflows/windows.yml`, one line in `AGENTS.md`. The tool and the check are untouched. The workflow line sits inside the existing backslash-continued `run:` block with the same 12-space indent and a trailing `\`, between `tests/awc_metadata_check.py` and `tests/sgd5_effects_check.py`. The AGENTS.md list has the same order. **What I ran at this SHA** - `python3 -B tests/startup_audio_timeline_check.py`: "Ran 3 tests ... OK" (Python 3.14, exit 0). - `tests/docs_links_check.py`: 18 files, 370 links, clean. `tests/bidi_controls_check.py`: 1324 files, clean. `git diff --check origin/main...HEAD`: clean. - CMake registration smoke: I copied the new `if(EXISTS ...) add_test(...) set_tests_properties(... TIMEOUT 60) endif()` block into a throw-away CMakeLists with `INTAKE_PYTHON=/usr/bin/python3`, then `ctest --no-tests=error -R '^startup_audio_timeline$'`: 1/1 passed. This proves the syntax and the filter, not the real project configure. - Mutations of `tools/startup_audio_timeline.py`, each followed by the check and `git checkout -- .` (tree clean afterwards): | Mutation | check | |---|---| | packet validation `0 <= rms <= peak <= 1` reduced to `0 <= rms` | fail | | `frames < 1` relaxed to `frames < 0` | fail | | window end made inclusive (`packet.start >= end` to `>`) | **pass** | | `--sample-rate < 1` validation removed | **pass** | **Findings (non-blocking)** 1. P3, scope: this PR only registers the check, so it is right not to change it. Two behaviours of the tool (the exclusive end of the window, and the sample-rate argument validation) are not pinned by the check. Worth a follow-up now that the check will actually run. 2. P3, style: neighbouring `startup_*` Python tests in this file use `${CMAKE_CURRENT_SOURCE_DIR}`; this one uses `${CMAKE_SOURCE_DIR}` (as `INTAKE_PYTHON` itself does). Same result at the top level; only a consistency note. 3. P3, placement: the block lands between the `startup_audio_provider` properties and the `startup_dump_fence_check` setup lines, so it is mixed into the C++ audio targets rather than the `if(EXISTS "${INTAKE_PYTHON}")` group near line 166. Harmless, since it has its own guard. The author's Windows run (configure plus ctest passing 1/1) is theirs; I did not reproduce it. Their question about `tests/pixel_fp32_vulkan_check.py` is for a maintainer. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-24 21:27:25 +00:00
ChazY11 commented 2026-11-24 21:27:39 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T21:07:14Z.


The claim checks out, and the registration works

On origin/main (d30004d4) the check really is unreachable from both entry points — counting occurrences of the name in the
three files the PR touches:

CMakeLists.txt                   main 中出现 0 次
AGENTS.md                        main 中出现 0 次
.github/workflows/windows.yml    main 中出现 0 次

On the PR branch, after a configure that regenerated the test files:

$ cmake --preset dev
-- Configuring done (0.5s)
-- Generating done (2.6s)

$ ctest --preset dev -N
Test #101: startup_audio_timeline

$ ctest --preset dev -R '^startup_audio_timeline$' -V
101: Test command: ...python.exe "-B" ".../tests/startup_audio_timeline_check.py"
1/1 Test #101: startup_audio_timeline ........... Passed 1.90 sec
100% tests passed, 0 tests failed out of 1

The guard is the same shape as its neighbours (if(EXISTS "${INTAKE_PYTHON}") … TIMEOUT 60), it sits next to
startup_audio_provider, and adding it to the Linux list puts it in the same job as the other device-free checks.

One caveat from my own run, worth knowing

My first cmake --preset dev after switching to this branch printed -- Configuring done but the generated
out/build/dev/CTestTestfile.cmake did not contain startup_audio_timeline, and ctest -N showed only
startup_audio_provider. A second configure added it. I did not chase the cause (most likely a regeneration decision after the
branch switch), but anyone verifying a newly registered test should confirm it appears in ctest -N rather than assuming a
configure was enough — a test that silently fails to register looks exactly like this PR's problem.

What this does and does not buy

It buys: the cases added in #1842 now run in ctest and in the Linux Python job, so a change to tools/startup_audio_timeline.py
that breaks them is caught. The check itself already has positive/quiet/gap/missing rows and compares an RMS estimate
(((0.5**2 + 0.25**2) / 2)**0.5), i.e. it is not a smoke test.

It does not buy: any statement about real audio output. That is startup_audio_provider's territory and stays there.

Verdict

Reviewed. The problem statement is accurate to the byte (0 occurrences on main), the fix is the minimal registration, and the
test runs and passes here. No objections.

Notes

  • AI-assisted review.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7144502008 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1870#issuecomment-7144502008). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-24T21:07:14Z. --- ## The claim checks out, and the registration works On `origin/main` (`d30004d4`) the check really is unreachable from both entry points — counting occurrences of the name in the three files the PR touches: ```text CMakeLists.txt main 中出现 0 次 AGENTS.md main 中出现 0 次 .github/workflows/windows.yml main 中出现 0 次 ``` On the PR branch, after a configure that regenerated the test files: ```text $ cmake --preset dev -- Configuring done (0.5s) -- Generating done (2.6s) $ ctest --preset dev -N Test #101: startup_audio_timeline $ ctest --preset dev -R '^startup_audio_timeline$' -V 101: Test command: ...python.exe "-B" ".../tests/startup_audio_timeline_check.py" 1/1 Test #101: startup_audio_timeline ........... Passed 1.90 sec 100% tests passed, 0 tests failed out of 1 ``` The guard is the same shape as its neighbours (`if(EXISTS "${INTAKE_PYTHON}")` … `TIMEOUT 60`), it sits next to `startup_audio_provider`, and adding it to the Linux list puts it in the same job as the other device-free checks. ## One caveat from my own run, worth knowing My **first** `cmake --preset dev` after switching to this branch printed `-- Configuring done` but the generated `out/build/dev/CTestTestfile.cmake` did not contain `startup_audio_timeline`, and `ctest -N` showed only `startup_audio_provider`. A second configure added it. I did not chase the cause (most likely a regeneration decision after the branch switch), but anyone verifying a *newly registered* test should confirm it appears in `ctest -N` rather than assuming a configure was enough — a test that silently fails to register looks exactly like this PR's problem. ## What this does and does not buy It buys: the cases added in #1842 now run in `ctest` and in the Linux Python job, so a change to `tools/startup_audio_timeline.py` that breaks them is caught. The check itself already has positive/quiet/gap/missing rows and compares an RMS estimate (`((0.5**2 + 0.25**2) / 2)**0.5`), i.e. it is not a smoke test. It does not buy: any statement about real audio output. That is `startup_audio_provider`'s territory and stays there. ## Verdict Reviewed. The problem statement is accurate to the byte (0 occurrences on main), the fix is the minimal registration, and the test runs and passes here. No objections. ## Notes - AI-assisted review.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!1863
No description provided.