tests: cover ClearCensus size classes, overflow, and delta reports #3867

Manually merged
github merged 2 commits from github-bot/gh-3865 into gh-pr/3865/base 2026-12-02 15:36:54 +00:00 AGit
Owner

@⁠Ammmae0x on GitHub · 2026-12-02 15:12 UTC · original
Ammmae0x:tests/clear-census-unit → main · +1144 −0 · 5 files · 2 commits · merged 2026-12-02 15:31 UTC

Refs #1149.

Finer-grained portable C++17 unit + header-mutation tests for
x2w_startup::clear_size_class, ClearKey, and ClearCensus
(src/startup_stubs/clear_census.h), under the disjoint
clear_census_unit prefix. The existing
tests/startup_clear_census_check.cpp coverage is untouched;
this suite re-pins the same contract with one CTest test per
boundary instead of four combined cases.

What landed (5 new files only, +1144/-0, zero edits elsewhere):

  • tests/clear_census_unit_check.cpp — 12 cases
  • tests/cmake/clear_census_unit.cmake — one CTest test per
    case plus clear_census_unit_all, and 6 WILL_FAIL TRUE
    header-mutation controls
  • tests/clear_census_unit_meta_check.py — audits the
    contract and runs the real check plus every mutation natively
    (1:1 with the CMake set)
  • tests/checks/python-linux/clear_census_unit.txt
  • docs/experiments/clear-census-unit.md

Cases (12): size_class_zero_one (0/1 are class 0),
size_class_small (2..7), size_class_pow2 (8, 16, 2^32,
2^63), size_class_pow2_plus1 (9, 17, 2^32+1, 2^63+1),
size_class_max (UINT64_MAX is class 64), key_equality
(direct operator== assertions varying exactly one field at
a time: kind, format, dimension, width/height/depth class,
each bits word), note_merge_first_frame (repeat keeps
first_seen_frame, counts calls), note_cap_overflow
(128-shape cap, 129th/130th overflow, re-noting an overflowed
shape counts overflow again, repeating a stored shape does
not), report_empty (no-op, either mode),
report_delta_only_if_changed (suppression, then re-emit of
only modified entries), report_always
(only_if_changed=false re-emits and does not consume the
delta), report_kind_names_formats (all four ClearKind
names with exact literal lines, including %08x zero
padding).

New pins over the combined check: size classes at the 2^32
boundary, direct per-field operator== assertions, literal
(rather than format-copy) report lines, and the re-note of an
overflowed shape.

Mutation controls (6, each killed by its control case):
size_class (drops the - 1, 1 lands one class too high),
key_bits (drops the bits comparison),
note_merge (merge resets calls to 1),
overflow (overflow stops being counted),
report_watermark (watermark updated on forced reports
instead of periodic ones), report_entry_skip (per-entry
delta test dropped, periodic reports emit the header only).

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

  • PASS: clear_census_unit: 12 cases, 6/6 mutations killed (g++)
  • Scratch CMake + CTest ^clear_census_unit: 19/19 (12 cases
    • all + 6 mutants)
  • form_coverage_check.py: passed; docs_links_check.py:
    checked 242 files and 921 links; bidi_controls_check.py:
    checked 2960 files, no bidirectional controls
  • Full Python Linux suite (tools/run_checks_parallel.py,
    CI python-linux command): all 329 checks passed
  • diff --check clean; git merge-tree --write-tree origin/main HEAD exits 0

Remote mapping: the task said push to origin, but in this
clone origin is R0Y00/Xbox2Windows upstream, so as with all
prior PRs it went to fork (Ammmae0x/Xbox2Windows, branch
tests/clear-census-unit, no force-push).

Windows Verification (828af8b37aec994d1f8759ba03e8bcbf6384a694)

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

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

clear_census_unit_check.exe (dev + release): 12/12 cases passed
tests/clear_census_unit_meta_check.py (cl): 12 cases, 6/6 mutations killed (cl)

AI-assisted.

**@⁠Ammmae0x** on GitHub · 2026-12-02 15:12 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3865) `Ammmae0x:tests/clear-census-unit` → `main` · +1144 −0 · 5 files · 2 commits · merged 2026-12-02 15:31 UTC Refs #1149. Finer-grained portable C++17 unit + header-mutation tests for `x2w_startup::clear_size_class`, `ClearKey`, and `ClearCensus` (`src/startup_stubs/clear_census.h`), under the disjoint `clear_census_unit` prefix. The existing `tests/startup_clear_census_check.cpp` coverage is untouched; this suite re-pins the same contract with one CTest test per boundary instead of four combined cases. What landed (5 new files only, +1144/-0, zero edits elsewhere): - `tests/clear_census_unit_check.cpp` — 12 cases - `tests/cmake/clear_census_unit.cmake` — one CTest test per case plus `clear_census_unit_all`, and 6 `WILL_FAIL TRUE` header-mutation controls - `tests/clear_census_unit_meta_check.py` — audits the contract and runs the real check plus every mutation natively (1:1 with the CMake set) - `tests/checks/python-linux/clear_census_unit.txt` - `docs/experiments/clear-census-unit.md` Cases (12): `size_class_zero_one` (0/1 are class 0), `size_class_small` (2..7), `size_class_pow2` (8, 16, 2^32, 2^63), `size_class_pow2_plus1` (9, 17, 2^32+1, 2^63+1), `size_class_max` (`UINT64_MAX` is class 64), `key_equality` (direct `operator==` assertions varying exactly one field at a time: kind, format, dimension, width/height/depth class, each `bits` word), `note_merge_first_frame` (repeat keeps `first_seen_frame`, counts calls), `note_cap_overflow` (128-shape cap, 129th/130th overflow, re-noting an overflowed shape counts overflow again, repeating a stored shape does not), `report_empty` (no-op, either mode), `report_delta_only_if_changed` (suppression, then re-emit of only modified entries), `report_always` (`only_if_changed=false` re-emits and does not consume the delta), `report_kind_names_formats` (all four `ClearKind` names with exact literal lines, including `%08x` zero padding). New pins over the combined check: size classes at the 2^32 boundary, direct per-field `operator==` assertions, literal (rather than format-copy) report lines, and the re-note of an overflowed shape. Mutation controls (6, each killed by its control case): `size_class` (drops the `- 1`, 1 lands one class too high), `key_bits` (drops the `bits` comparison), `note_merge` (merge resets `calls` to 1), `overflow` (overflow stops being counted), `report_watermark` (watermark updated on forced reports instead of periodic ones), `report_entry_skip` (per-entry delta test dropped, periodic reports emit the header only). Linux verification (this host, g++ 13, `-std=c++17 -O2 -Wall -Wextra -Wpedantic -Werror`): - `PASS: clear_census_unit: 12 cases, 6/6 mutations killed (g++)` - Scratch CMake + CTest `^clear_census_unit`: 19/19 (12 cases + all + 6 mutants) - `form_coverage_check.py`: passed; `docs_links_check.py`: checked 242 files and 921 links; `bidi_controls_check.py`: checked 2960 files, no bidirectional controls - Full Python Linux suite (`tools/run_checks_parallel.py`, CI `python-linux` command): all 329 checks passed - `diff --check` clean; `git merge-tree --write-tree origin/main HEAD` exits 0 Remote mapping: the task said push to `origin`, but in this clone `origin` is R0Y00/Xbox2Windows upstream, so as with all prior PRs it went to `fork` (Ammmae0x/Xbox2Windows, branch `tests/clear-census-unit`, no force-push). ### Windows Verification (`828af8b37aec994d1f8759ba03e8bcbf6384a694`) ```text ctest --preset dev --no-tests=error -j16 -R '^clear_census_unit' --output-on-failure -> 100% tests passed, 0 tests failed out of 19 (0.72s) ctest --preset release --no-tests=error -j16 -R '^clear_census_unit' --output-on-failure -> 100% tests passed, 0 tests failed out of 19 (0.67s) clear_census_unit_check.exe (dev + release): 12/12 cases passed tests/clear_census_unit_meta_check.py (cl): 12 cases, 6/6 mutations killed (cl) ``` AI-assisted. <!-- WIN-VERIFY: passed | sha=828af8b37aec994d1f8759ba03e8bcbf6384a694 -->
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 15:16:59 +00:00
Author
Owner

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

Independent Windows/MSVC Debug validation: ctest --preset dev --no-tests=error -R '^clear_census_unit' --output-on-failure passed 19/19, including all six mutation controls. Compared the tested head 828af8b3 with bf1cb175: the only difference is the unrelated packed mesh fixture fix from main. Test targets and fixture inputs are identical.

**@⁠R0Y00** on GitHub · 2026-12-02 15:23 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3865#pullrequestreview-6153791448) · **approved these changes** Independent Windows/MSVC Debug validation: `ctest --preset dev --no-tests=error -R '^clear_census_unit' --output-on-failure` passed 19/19, including all six mutation controls. Compared the tested head 828af8b3 with bf1cb175: the only difference is the unrelated packed mesh fixture fix from main. Test targets and fixture inputs are identical.
github-bot changed target branch from main to gh-pr/3865/base 2026-12-02 15:36:52 +00:00
github manually merged commit bf1cb175e3 into gh-pr/3865/base 2026-12-02 15:36:54 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.