tests: cover upload_reservation queues, recycling, snapshot pools, and totals #3780

Manually merged
github merged 1 commit from github-bot/gh-3778 into gh-pr/3778/base 2026-12-02 12:18:01 +00:00 AGit
Owner

@⁠Ammmae0x on GitHub · 2026-12-01 19:26 UTC · original
Ammmae0x:tests/upload-reservation-unit → main · +1652 −0 · 5 files · 1 commits · merged 2026-12-02 12:12 UTC

Refs #1149.

Standalone portable C++17 unit + 1:1 header-mutation tests for upload_reservation (src/startup_stubs/upload_reservation.h), 5 new files only (+1652/-0), zero edits elsewhere; tests/upload_reservation_check.cpp and CMakeLists.txt untouched, disjoint prefix upload_reservation_unit.

21 cases: UploadQueue (sticky UINT64_MAX unsignalled bit across later signalled submits; completed() with target 0 and a null fence, target UINT64_MAX, a UINT64_MAX fence, and < vs == vs >; signalled value and mask incl. bit 39), hold() duplicate no double-count, discard_upload_chunks clearing the mask and both pools (indices 32..39), release_upload_chunks_at_submit + resubmitted_upload_chunks intact vs recycled (incl. the 31/39 boundary), SnapshotPoolTotals (note_reserved used - recycled + rounded and high water, note_refusal skipping invalid_size and stopping at 8 logged while counting all, report()), reserve_upload_chunk exact capacity and overflow-safe subtraction, reuse_upload_chunk blocking on recordings or an incomplete queue, bumping generation, and incrementing totals->reservations once, and reserve_existing_upload_chunk preferring an unused tail before recycling (then the first completed chunk).

6 WILL_FAIL TRUE CMake header-mutation controls, mirrored 1:1 in the meta check: unsignaled_sticky, fence_max_complete, resubmit_gen_check, refusal_log_budget, reuse_rec_guard, reuse_double_count.

Linux verification (this host, g++ -std=c++17 -O2 -Wall -Wextra -Wpedantic -Werror):

  • Meta check: PASS: upload_reservation_unit: 21 cases, 6/6 mutations killed (g++)
  • Scratch CMake + CTest: 100% tests passed, 0 tests failed out of 28 (21 per-case + all + 6 mutation controls)
  • form_coverage_check.py passes, docs_links_check.py passes (225 files, 874 links), bidi_controls_check.py passes (2877 files), git diff --check clean, merge-tree exits 0
  • Full python-linux suite (tools/run_checks_parallel.py, from the CI workflow): all 316 checks passed

Windows Verification (65ff0403b9ee95cc9b6443e32328d93b846f7b05)

ctest --preset dev --no-tests=error -j16 -R '^upload_reservation_unit' --output-on-failure
-> 100% tests passed, 0 tests failed out of 28 (0.94s)

ctest --preset release --no-tests=error -j16 -R '^upload_reservation_unit' --output-on-failure
-> 100% tests passed, 0 tests failed out of 28 (1.05s)

upload_reservation_unit_check.exe (dev + release): 21/21 cases passed
tests/upload_reservation_unit_meta_check.py (cl): 21 cases, 6/6 mutations killed (cl)

AI-assisted.

**@⁠Ammmae0x** on GitHub · 2026-12-01 19:26 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3778) `Ammmae0x:tests/upload-reservation-unit` → `main` · +1652 −0 · 5 files · 1 commits · merged 2026-12-02 12:12 UTC Refs #1149. Standalone portable C++17 unit + 1:1 header-mutation tests for `upload_reservation` (`src/startup_stubs/upload_reservation.h`), 5 new files only (+1652/-0), zero edits elsewhere; `tests/upload_reservation_check.cpp` and `CMakeLists.txt` untouched, disjoint prefix `upload_reservation_unit`. 21 cases: `UploadQueue` (sticky `UINT64_MAX` unsignalled bit across later signalled submits; `completed()` with target 0 and a null fence, target `UINT64_MAX`, a `UINT64_MAX` fence, and `<` vs `==` vs `>`; signalled value and mask incl. bit 39), `hold()` duplicate no double-count, `discard_upload_chunks` clearing the mask and both pools (indices 32..39), `release_upload_chunks_at_submit` + `resubmitted_upload_chunks` intact vs recycled (incl. the 31/39 boundary), `SnapshotPoolTotals` (`note_reserved` used - recycled + rounded and high water, `note_refusal` skipping `invalid_size` and stopping at 8 logged while counting all, `report()`), `reserve_upload_chunk` exact capacity and overflow-safe subtraction, `reuse_upload_chunk` blocking on recordings or an incomplete queue, bumping generation, and incrementing `totals->reservations` once, and `reserve_existing_upload_chunk` preferring an unused tail before recycling (then the first completed chunk). 6 `WILL_FAIL TRUE` CMake header-mutation controls, mirrored 1:1 in the meta check: `unsignaled_sticky`, `fence_max_complete`, `resubmit_gen_check`, `refusal_log_budget`, `reuse_rec_guard`, `reuse_double_count`. Linux verification (this host, `g++ -std=c++17 -O2 -Wall -Wextra -Wpedantic -Werror`): - Meta check: `PASS: upload_reservation_unit: 21 cases, 6/6 mutations killed (g++)` - Scratch CMake + CTest: `100% tests passed, 0 tests failed out of 28` (21 per-case + all + 6 mutation controls) - `form_coverage_check.py` passes, `docs_links_check.py` passes (225 files, 874 links), `bidi_controls_check.py` passes (2877 files), `git diff --check` clean, merge-tree exits 0 - Full `python-linux` suite (`tools/run_checks_parallel.py`, from the CI workflow): `all 316 checks passed` ### Windows Verification (`65ff0403b9ee95cc9b6443e32328d93b846f7b05`) ```text ctest --preset dev --no-tests=error -j16 -R '^upload_reservation_unit' --output-on-failure -> 100% tests passed, 0 tests failed out of 28 (0.94s) ctest --preset release --no-tests=error -j16 -R '^upload_reservation_unit' --output-on-failure -> 100% tests passed, 0 tests failed out of 28 (1.05s) upload_reservation_unit_check.exe (dev + release): 21/21 cases passed tests/upload_reservation_unit_meta_check.py (cl): 21 cases, 6/6 mutations killed (cl) ``` AI-assisted. <!-- WIN-VERIFY: passed | sha=65ff0403b9ee95cc9b6443e32328d93b846f7b05 -->
Refs #1149.

Standalone portable C++17 unit + 1:1 header-mutation tests for
upload_reservation (src/startup_stubs/upload_reservation.h):
UploadQueue (sticky UINT64_MAX unsignalled bit, completed() with
target 0 / UINT64_MAX / a UINT64_MAX fence, < vs == vs >),
hold() / discard_upload_chunks() over both pools (indices
32..39), release_upload_chunks_at_submit() +
resubmitted_upload_chunks() (intact vs recycled, incl. the 31 /
39 boundary), SnapshotPoolTotals (note_reserved used - recycled
+ rounded and the high water, note_refusal skipping invalid_size
and stopping at eight logged refusals, report()), and
reserve / reuse / reserve_existing chunk selection (exact
capacity, overflow-safe subtraction, reuse blocks on recordings
or an incomplete queue and counts reservations once, existing
tails preferred before recycling).
6 WILL_FAIL TRUE CMake header-mutation controls, mirrored 1:1
in the meta check.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 19:31:57 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-02 12:11 UTC · original · approved these changes

I checked the five-file test-only diff and the merge against current main. The fixture uses a synthetic fence and preserves the existing runtime and test suite. On Windows with MSVC, python -B tests/upload_reservation_unit_meta_check.py passed all 21 cases and caught all 6 one-line mutations, including the sticky unsignalled fence and double-counted recycling controls. The required Windows job and both Linux jobs passed.

**@⁠R0Y00** on GitHub · 2026-12-02 12:11 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3778#pullrequestreview-6150446964) · **approved these changes** I checked the five-file test-only diff and the merge against current main. The fixture uses a synthetic fence and preserves the existing runtime and test suite. On Windows with MSVC, `python -B tests/upload_reservation_unit_meta_check.py` passed all 21 cases and caught all 6 one-line mutations, including the sticky unsignalled fence and double-counted recycling controls. The required Windows job and both Linux jobs passed.
github-bot changed target branch from main to gh-pr/3778/base 2026-12-02 12:17:59 +00:00
github manually merged commit 65ff0403b9 into gh-pr/3778/base 2026-12-02 12:18:01 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.