tests: fold NativeCopyRanges coverage into startup_native_copy_ranges #3868

Manually merged
github merged 5 commits from github-bot/gh-3866 into gh-pr/3866/base 2026-12-02 20:27:50 +00:00 AGit
Owner

@⁠Ammmae0x on GitHub · 2026-12-02 15:37 UTC · original
Ammmae0x:tests/native-copy-ranges-unit → main · +185 −28 · 4 files · 5 commits · merged 2026-12-02 20:22 UTC

Addresses @⁠R0Y00's CHANGES_REQUESTED review: the duplicate suite is gone and only the existing startup_native_copy_ranges suite is extended (Refs #1149).

What changed

All 5 native_copy_ranges_unit files are removed (git rm):

  • docs/experiments/native-copy-ranges-unit.md
  • tests/checks/python-linux/native_copy_ranges_unit.txt
  • tests/cmake/native_copy_ranges_unit.cmake
  • tests/native_copy_ranges_unit_check.cpp
  • tests/native_copy_ranges_unit_meta_check.py

Only the 4 existing startup_native_copy_ranges* files are modified (net diff vs origin/main: 4 files, +185/-28). No src/ change, no other files touched. Merged origin/main 7eebdb44 cleanly (merge commit 8b398f6f).

Newly caught cases (all in the existing suite)

In split_middle() (tests/startup_native_copy_ranges_check.cpp):

  • Left-overhang trim: [10, 20) minus [5, 15) -> [15, 20), plus touching no-ops [0, 15) and [20, 30) on the trimmed span.
  • Multi-span loop early stop: [0, 10), [20, 30), [40, 50) minus [0, 35) leaves [40, 50) untouched (the loop only visits spans beginning before the write ends).
  • Near-UINT64_MAX (kMax = UINT64_MAX): [kMax - 32, kMax - 16) + [kMax - 16, kMax) -> [kMax - 32, kMax) in both insertion orders; middle split by [kMax - 24, kMax - 8) -> [kMax - 32, kMax - 24), [kMax - 8, kMax); empty/inverted adds add(kMax, kMax) / add(kMax, kMax - 1) are no-ops.

In boundary_coverage():

  • Near-UINT64_MAX partial edge (kMax - 17, kMax - 15) on [kMax - 16, kMax) -> partial, and one-byte full suffix (kMax - 1, kMax) -> full.

One correction to the review request as written: it asked to add (0, 11) over [0, 10) -> partial, but that assertion already existed in boundary_coverage() (line 311) and was not duplicated. It is the pin that catches the new coverage_full control below.

Three new mutation controls (9 total, 1:1 in the meta check)

In tests/cmake/startup_native_copy_ranges.cmake (each fails configure loudly if its anchor is gone):

Control Dropped guard Caught by
startup_native_copy_ranges_cpu_write_left_trim_mut cpu_write suffix trim it->begin = end becomes = begin split_middle: left-overhang trim comes back [5, 20) instead of [15, 20)
startup_native_copy_ranges_cpu_write_split_begin_mut cpu_write split insert {end, old.end} becomes {begin, old.end} split_middle: the halves overlap, and touch at UINT64_MAX ([kMax - 24, kMax) vs [kMax - 32, kMax - 24))
startup_native_copy_ranges_coverage_full_mut coverage full test drops && end <= row->end boundary_coverage: (0, 11), (5, 25), (20, 31) all report full instead of partial

tests/startup_native_copy_ranges_meta_check.py now tests all 9 mutations 1:1 (6 existing + 3 new) and supports cl alongside g++ (Linux keeps -std=c++17 -O2 -Wall -Wextra -Werror). docs/experiments/startup-native-copy-ranges.md documents the added cases and controls.

Linux verification (this host)

  • python3 -B tests/startup_native_copy_ranges_meta_check.py — PASS: startup native copy ranges: 6 cases, 9/9 mutations killed (g++)
  • Scratch CMake + ctest -R '^startup_native_copy_ranges' — 16/16 tests passed (6 cases + all + 9 WILL_FAIL TRUE controls, each failing cleanly)
  • tests/form_coverage_check.py — passed
  • tests/docs_links_check.py — passed (248 Markdown files, 942 links)
  • tests/bidi_controls_check.py — passed (2977 files, no bidirectional controls)
  • git diff --check origin/main...HEAD — clean
  • git merge-tree --write-tree origin/main HEAD — exits 0

The full Python Linux suite was not waited on locally in this round; GitHub Actions runs the full workflow on push. No Windows CTest / MSVC run on this Linux host, so Windows verification stays the arbiter. Do not merge.

Windows Verification (d3cb0e78)

  • Clean git merge-tree --write-tree upstream/main HEAD and git diff --check.
  • MSVC dev: cmake --preset dev, built all 10 targets (startup_native_copy_ranges_check + 9 _mut targets), ctest --preset dev --no-tests=error -R '^startup_native_copy_ranges' --output-on-failure passed 16/16 (1.15s); direct startup_native_copy_ranges_check.exe printed PASS: startup_native_copy_ranges: 6/6 cases passed.
  • MSVC release: cmake --preset release, built all 10 targets, ctest --preset release --no-tests=error -R '^startup_native_copy_ranges' --output-on-failure passed 16/16 (0.92s).
  • Native cl meta check: python -B tests/startup_native_copy_ranges_meta_check.py printed PASS: startup native copy ranges: 6 cases, 9/9 mutations killed (cl).
  • Repo static checks on Windows: tests/docs_links_check.py (248 files, 942 links) and tests/bidi_controls_check.py (2977 files) passed.

AI-assisted.

**@⁠Ammmae0x** on GitHub · 2026-12-02 15:37 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3866) `Ammmae0x:tests/native-copy-ranges-unit` → `main` · +185 −28 · 4 files · 5 commits · merged 2026-12-02 20:22 UTC Addresses @⁠R0Y00's CHANGES_REQUESTED review: the duplicate suite is gone and only the existing `startup_native_copy_ranges` suite is extended (Refs #1149). ## What changed All 5 `native_copy_ranges_unit` files are removed (`git rm`): - `docs/experiments/native-copy-ranges-unit.md` - `tests/checks/python-linux/native_copy_ranges_unit.txt` - `tests/cmake/native_copy_ranges_unit.cmake` - `tests/native_copy_ranges_unit_check.cpp` - `tests/native_copy_ranges_unit_meta_check.py` Only the 4 existing `startup_native_copy_ranges*` files are modified (net diff vs `origin/main`: 4 files, +185/-28). No `src/` change, no other files touched. Merged `origin/main` `7eebdb44` cleanly (merge commit `8b398f6f`). ## Newly caught cases (all in the existing suite) In `split_middle()` (`tests/startup_native_copy_ranges_check.cpp`): - Left-overhang trim: `[10, 20)` minus `[5, 15) -> [15, 20)`, plus touching no-ops `[0, 15)` and `[20, 30)` on the trimmed span. - Multi-span loop early stop: `[0, 10), [20, 30), [40, 50)` minus `[0, 35)` leaves `[40, 50)` untouched (the loop only visits spans beginning before the write ends). - Near-`UINT64_MAX` (`kMax = UINT64_MAX`): `[kMax - 32, kMax - 16) + [kMax - 16, kMax) -> [kMax - 32, kMax)` in both insertion orders; middle split by `[kMax - 24, kMax - 8) -> [kMax - 32, kMax - 24), [kMax - 8, kMax)`; empty/inverted adds `add(kMax, kMax)` / `add(kMax, kMax - 1)` are no-ops. In `boundary_coverage()`: - Near-`UINT64_MAX` partial edge `(kMax - 17, kMax - 15)` on `[kMax - 16, kMax) -> partial`, and one-byte full suffix `(kMax - 1, kMax) -> full`. One correction to the review request as written: it asked to add `(0, 11)` over `[0, 10) -> partial`, but that assertion already existed in `boundary_coverage()` (line 311) and was not duplicated. It is the pin that catches the new `coverage_full` control below. ## Three new mutation controls (9 total, 1:1 in the meta check) In `tests/cmake/startup_native_copy_ranges.cmake` (each fails configure loudly if its anchor is gone): | Control | Dropped guard | Caught by | | --- | --- | --- | | `startup_native_copy_ranges_cpu_write_left_trim_mut` | `cpu_write` suffix trim `it->begin = end` becomes `= begin` | `split_middle`: left-overhang trim comes back `[5, 20)` instead of `[15, 20)` | | `startup_native_copy_ranges_cpu_write_split_begin_mut` | `cpu_write` split insert `{end, old.end}` becomes `{begin, old.end}` | `split_middle`: the halves overlap, and touch at `UINT64_MAX` (`[kMax - 24, kMax)` vs `[kMax - 32, kMax - 24)`) | | `startup_native_copy_ranges_coverage_full_mut` | `coverage` full test drops `&& end <= row->end` | `boundary_coverage`: `(0, 11)`, `(5, 25)`, `(20, 31)` all report `full` instead of `partial` | `tests/startup_native_copy_ranges_meta_check.py` now tests all 9 mutations 1:1 (6 existing + 3 new) and supports `cl` alongside `g++` (Linux keeps `-std=c++17 -O2 -Wall -Wextra -Werror`). `docs/experiments/startup-native-copy-ranges.md` documents the added cases and controls. ## Linux verification (this host) - `python3 -B tests/startup_native_copy_ranges_meta_check.py` — `PASS: startup native copy ranges: 6 cases, 9/9 mutations killed (g++)` - Scratch CMake + `ctest -R '^startup_native_copy_ranges'` — `16/16 tests passed` (6 cases + `all` + 9 `WILL_FAIL TRUE` controls, each failing cleanly) - `tests/form_coverage_check.py` — passed - `tests/docs_links_check.py` — passed (248 Markdown files, 942 links) - `tests/bidi_controls_check.py` — passed (2977 files, no bidirectional controls) - `git diff --check origin/main...HEAD` — clean - `git merge-tree --write-tree origin/main HEAD` — exits 0 The full Python Linux suite was not waited on locally in this round; GitHub Actions runs the full workflow on push. No Windows CTest / MSVC run on this Linux host, so Windows verification stays the arbiter. Do not merge. ## Windows Verification (`d3cb0e78`) - Clean `git merge-tree --write-tree upstream/main HEAD` and `git diff --check`. - MSVC `dev`: `cmake --preset dev`, built all 10 targets (`startup_native_copy_ranges_check` + 9 `_mut` targets), `ctest --preset dev --no-tests=error -R '^startup_native_copy_ranges' --output-on-failure` passed `16/16` (`1.15s`); direct `startup_native_copy_ranges_check.exe` printed `PASS: startup_native_copy_ranges: 6/6 cases passed`. - MSVC `release`: `cmake --preset release`, built all 10 targets, `ctest --preset release --no-tests=error -R '^startup_native_copy_ranges' --output-on-failure` passed `16/16` (`0.92s`). - Native `cl` meta check: `python -B tests/startup_native_copy_ranges_meta_check.py` printed `PASS: startup native copy ranges: 6 cases, 9/9 mutations killed (cl)`. - Repo static checks on Windows: `tests/docs_links_check.py` (248 files, 942 links) and `tests/bidi_controls_check.py` (2977 files) passed. AI-assisted. <!-- WIN-VERIFY: passed | sha=d3cb0e784905c7bf70d8d382eb883becde30f016 | ctest=^startup_native_copy_ranges | dev=16/16 | release=16/16 | cl_meta=6cases_9of9 -->
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 15:43:50 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-02 15:45 UTC · original · requested changes

Independent MSVC Debug ctest --preset dev --no-tests=error -R '^native_copy_ranges_unit' --output-on-failure passed 15/15, including the six mutation executables. The overlap remains: #3656 already checks empty/reversed spans, adjacency, bridge, split, trims and coverage, with differential fuzzing and six header mutations. This was also the reason #3702 was closed. A distinct CTest prefix avoids name collisions while both suites still compile and run the same coverage in CI. Please add only the new assertions and any uniquely distinguishing controls to the existing check. In particular, show which near-UINT64_MAX cases or mutation failures are newly caught.

**@⁠R0Y00** on GitHub · 2026-12-02 15:45 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3866#pullrequestreview-6154168172) · **requested changes** Independent MSVC Debug `ctest --preset dev --no-tests=error -R '^native_copy_ranges_unit' --output-on-failure` passed 15/15, including the six mutation executables. The overlap remains: #3656 already checks empty/reversed spans, adjacency, bridge, split, trims and coverage, with differential fuzzing and six header mutations. This was also the reason #3702 was closed. A distinct CTest prefix avoids name collisions while both suites still compile and run the same coverage in CI. Please add only the new assertions and any uniquely distinguishing controls to the existing check. In particular, show which near-`UINT64_MAX` cases or mutation failures are newly caught.
Author
Owner

@⁠Ammmae0x on GitHub · 2026-12-02 16:33 UTC · original

@⁠R0Y00 Addressed your review in d3cb0e78 (tests: fold NativeCopyRanges coverage into startup_native_copy_ranges):

  • Removed all five duplicate native_copy_ranges_unit* files; only the four existing startup_native_copy_ranges* files are touched (+185/-28, src/ unchanged).
  • Added only non-overlapping cases in tests/startup_native_copy_ranges_check.cpp: left-overhang trim + touching no-ops + early-stop multi-span write + explicit near-UINT64_MAX touching coalesces and split (split_middle), plus near-UINT64_MAX partial/full boundary checks (boundary_coverage, keeping existing (0, 11) on line 311 unduplicated).
  • Added 3 uniquely distinguishing WILL_FAIL TRUE controls (cpu_write_left_trim_mut, cpu_write_split_begin_mut, coverage_full_mut -> 9 total) in tests/cmake/startup_native_copy_ranges.cmake and tests/startup_native_copy_ranges_meta_check.py (with cl support alongside g++).
  • Windows verification on d3cb0e78: MSVC dev CTest 16/16 (1.15s), release CTest 16/16 (0.92s), python -B tests/startup_native_copy_ranges_meta_check.py 6 cases, 9/9 mutations killed (cl). Ready for re-review!

AI-assisted.

**@⁠Ammmae0x** on GitHub · 2026-12-02 16:33 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3866#issuecomment-7352123845) @⁠R0Y00 Addressed your review in `d3cb0e78` (`tests: fold NativeCopyRanges coverage into startup_native_copy_ranges`): - Removed all five duplicate `native_copy_ranges_unit*` files; only the four existing `startup_native_copy_ranges*` files are touched (`+185/-28`, `src/` unchanged). - Added only non-overlapping cases in `tests/startup_native_copy_ranges_check.cpp`: left-overhang trim + touching no-ops + early-stop multi-span write + explicit near-`UINT64_MAX` touching coalesces and split (`split_middle`), plus near-`UINT64_MAX` partial/full boundary checks (`boundary_coverage`, keeping existing `(0, 11)` on line 311 unduplicated). - Added 3 uniquely distinguishing `WILL_FAIL TRUE` controls (`cpu_write_left_trim_mut`, `cpu_write_split_begin_mut`, `coverage_full_mut` -> 9 total) in `tests/cmake/startup_native_copy_ranges.cmake` and `tests/startup_native_copy_ranges_meta_check.py` (with `cl` support alongside `g++`). - Windows verification on `d3cb0e78`: MSVC `dev` CTest `16/16` (`1.15s`), `release` CTest `16/16` (`0.92s`), `python -B tests/startup_native_copy_ranges_meta_check.py` `6 cases, 9/9 mutations killed (cl)`. Ready for re-review! AI-assisted.
github-bot changed title from tests: cover NativeCopyRanges coalescing, splits, and coverage to tests: fold NativeCopyRanges coverage into startup_native_copy_ranges 2026-12-02 17:10:45 +00:00
Address @R0Y00's CHANGES_REQUESTED on PR #3866: remove the duplicate
native_copy_ranges_unit suite (it re-covered #3654, the reason #3700
was closed) and extend only the existing startup_native_copy_ranges
suite with non-overlapping near-UINT64_MAX assertions plus three new
WILL_FAIL TRUE mutation controls (cpu_write_left_trim,
cpu_write_split_begin, coverage_full); 9/9 mutations killed on Linux.
Author
Owner

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

Reviewed d3cb0e78. The new near-UINT64_MAX and split/trim assertions now run in the existing fixture, and its original differential fuzz check remains. Independent Windows/MSVC Debug ctest --preset dev --no-tests=error -j 1 -R '^startup_native_copy_ranges' passed 16/16, including all nine mutation controls.

**@⁠R0Y00** on GitHub · 2026-12-02 16:42 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3866#pullrequestreview-6155112014) · **approved these changes** Reviewed d3cb0e78. The new near-UINT64_MAX and split/trim assertions now run in the existing fixture, and its original differential fuzz check remains. Independent Windows/MSVC Debug `ctest --preset dev --no-tests=error -j 1 -R '^startup_native_copy_ranges'` passed 16/16, including all nine mutation controls.
Author
Owner

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

Revalidated 8c50c14f after GitHub Update branch brought the #3885 fix into this PR. The four owned files are unchanged from d3cb0e78. Independent MSVC Debug ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^startup_native_copy_ranges' passed 16/16, including all nine mutation controls. The old Windows job's only failure was startup_indirect_mesh_lease_warp_dual-trace finding no req_*.m86; the new check is running on the fixed baseline.

**@⁠R0Y00** on GitHub · 2026-12-02 19:32 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3866#pullrequestreview-6157516623) · **approved these changes** Revalidated 8c50c14f after GitHub Update branch brought the #3885 fix into this PR. The four owned files are unchanged from d3cb0e78. Independent MSVC Debug `ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^startup_native_copy_ranges'` passed 16/16, including all nine mutation controls. The old Windows job's only failure was `startup_indirect_mesh_lease_warp_dual-trace` finding no `req_*.m86`; the new check is running on the fixed baseline.
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-02 19:37 UTC · original · reviewed

The updated Windows job passed, including the previously failing dual-trace WARP fixture. The remaining Linux job fails on standin_exports_check.py with d3d12_xs entries 84 != 83; I independently reproduced that failure on main. #3887 updates the export inventory. I'll recheck this branch when that fix lands.

**@⁠R0Y00** on GitHub · 2026-12-02 19:37 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3866#pullrequestreview-6157600247) · **reviewed** The updated Windows job passed, including the previously failing dual-trace WARP fixture. The remaining Linux job fails on `standin_exports_check.py` with `d3d12_xs entries 84 != 83`; I independently reproduced that failure on main. #3887 updates the export inventory. I'll recheck this branch when that fix lands.
Author
Owner

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

Revalidated 3a696326 after GitHub Update branch brought #3887 into the baseline. The PR's own files are unchanged. Independent Windows/MSVC Debug ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^startup_native_copy_ranges' passed 16/16, including nine mutation controls. python -B tests/standin_exports_check.py passed all 476 checks and six mutation controls.

**@⁠R0Y00** on GitHub · 2026-12-02 20:05 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3866#pullrequestreview-6158025571) · **approved these changes** Revalidated 3a696326 after GitHub Update branch brought #3887 into the baseline. The PR's own files are unchanged. Independent Windows/MSVC Debug `ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^startup_native_copy_ranges'` passed 16/16, including nine mutation controls. `python -B tests/standin_exports_check.py` passed all 476 checks and six mutation controls.
github-bot changed target branch from main to gh-pr/3866/base 2026-12-02 20:27:48 +00:00
github manually merged commit 3a69632623 into gh-pr/3866/base 2026-12-02 20:27:50 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.