tests: cover classify_null_binding precedence rules and 512-state truth table #3755

Manually merged
github merged 1 commit from github-bot/gh-3753 into main 2026-12-01 17:05:18 +00:00 AGit
Owner

@⁠Ammmae0x on GitHub · 2026-12-01 15:43 UTC · original
Ammmae0x:tests/null-binding-cause-unit → main · +1274 −0 · 5 files · 1 commits · merged 2026-12-01 17:04 UTC

Refs #1149.

Standalone, strict C++17 portable unit, truth-table, and 1:1 header-mutation tests for x2w_local::classify_null_binding and NullCause (src/startup_stubs/null_binding_cause.h), with zero edits to existing files (5 new files only, +1274/-0). tests/null_binding_cause_cases.h, tests/startup_null_cause_labels_check.cpp, tests/startup_null_views_check.cpp, and CMakeLists.txt are untouched; the null_binding_cause_unit prefix keeps CMake/CTest/target names disjoint.

What landed — commit 34ec53a1, in the null-binding-cause-unit worktree; main clone untouched.

  • tests/null_binding_cause_unit_check.cpp covers 10 cases: enum_label_contract (none == -1, dense 0..5, null_cause_count == 6, exact names "entry", "buffer", "token", "wrapper", "dimension", "ring_full"); ring_full_precedence (buffer ring failure beats bound=true, from_table && !entry_readable, and from_table && token_magic && !token_known); buffer_bound_precedence (bound buffer beats unreadable entry and unknown token); table_entry_precedence (unreadable entry for buffer and texture alike, and a texture with bound=true still reports table_entry); unknown_token_from_table_precedence (unknown token from a table beats wrapper/dimension/!bound, while a direct non-table unknown token behaves cleanly and !token_magic skips the check); texture_token_magic; texture_wrapper_dimension; texture_ring_ignored (ring_failed=true on a texture does NOT return ring_full); buffer_unreadable_default (default BindingFacts{} -> buffer_unreadable); and truth_table_512, an exhaustive 512-combination (2^9) truth table over the nine boolean fields against an independent priority specification, pinning absolute per-cause totals none 84, table_entry 80, buffer_unreadable 44, unknown_token 116, texture_wrapper 40, dimension_mismatch 20, ring_full 128.
  • Pure in-memory, no lambdas, clean -Wall -Wextra -Wpedantic -Werror and MSVC /W4-safe.
  • CMake: per-case CTests + _all, 7 WILL_FAIL TRUE header-copy controls (ring_full_texture, buffer_bound_precedence, table_entry_readable, unknown_token_from_table, texture_token_magic, texture_dimension, buffer_ring_before_bound — the last is the observable effect of reordering !texture && bound above ring_failed, modelled as the ring guard requiring !bound) with mutated copies at <mut>/startup_stubs/null_binding_cause.h and BEFORE PRIVATE include. The meta check mirrors them 1:1 with real C++ copies (g++ if present else cl, temp dirs removed in finally).

Verification (Linux, this host)

  • g++ -std=c++17 -O2 -Wall -Wextra -Wpedantic -Werror: PASS: null_binding_cause_unit: 10/10 cases passed
  • Meta check: PASS: null_binding_cause_unit: 10 cases, 7/7 mutations killed (g++)
  • Scratch CMake + CTest (fragment configured standalone via symlinked src/tests; full configure needs DXC, unavailable on Linux): 18/18 (10 per-case + _all + 7 WILL_FAIL mutation controls)
  • Form, docs (208 files / 802 links), and bidi (2827 files) checks pass; git diff --check clean; merge-tree exits 0.
  • Full python-linux suite: all 299 checks passed

Caveat: no mingw on this host, so no Windows compile check; WIN-VERIFY run is the arbiter.

Windows Verification (34ec53a1)

  • git merge-tree --write-tree upstream/main HEAD -> 271d76dd (exit 0), git diff --check upstream/main...HEAD clean
  • Repo checks: py_compile, form_coverage_check.py, docs_links_check.py (209 files, 806 links), bidi_controls_check.py (2830 files), null_binding_cause_unit_meta_check.py (cl: 10 cases, 7/7 mutations killed) passed
  • Commands:
cmake --build --preset dev --target null_binding_cause_unit_check null_binding_cause_unit_ring_full_texture_mut null_binding_cause_unit_buffer_bound_precedence_mut null_binding_cause_unit_table_entry_readable_mut null_binding_cause_unit_unknown_token_from_table_mut null_binding_cause_unit_texture_token_magic_mut null_binding_cause_unit_texture_dimension_mut null_binding_cause_unit_buffer_ring_before_bound_mut
ctest --preset dev --no-tests=error -j16 -R "^null_binding_cause_unit" --output-on-failure
cmake --build --preset release --target null_binding_cause_unit_check null_binding_cause_unit_ring_full_texture_mut null_binding_cause_unit_buffer_bound_precedence_mut null_binding_cause_unit_table_entry_readable_mut null_binding_cause_unit_unknown_token_from_table_mut null_binding_cause_unit_texture_token_magic_mut null_binding_cause_unit_texture_dimension_mut null_binding_cause_unit_buffer_ring_before_bound_mut
ctest --preset release --no-tests=error -j16 -R "^null_binding_cause_unit" --output-on-failure
  • Results: dev 18/18 passed (0.86s); release 18/18 passed (0.76s); direct null_binding_cause_unit_check.exe (dev & release): PASS: null_binding_cause_unit: 10/10 cases passed. AI-assisted.
**@⁠Ammmae0x** on GitHub · 2026-12-01 15:43 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3753) `Ammmae0x:tests/null-binding-cause-unit` → `main` · +1274 −0 · 5 files · 1 commits · merged 2026-12-01 17:04 UTC Refs #1149. Standalone, strict C++17 portable unit, truth-table, and 1:1 header-mutation tests for `x2w_local::classify_null_binding` and `NullCause` (`src/startup_stubs/null_binding_cause.h`), with zero edits to existing files (5 new files only, +1274/-0). `tests/null_binding_cause_cases.h`, `tests/startup_null_cause_labels_check.cpp`, `tests/startup_null_views_check.cpp`, and `CMakeLists.txt` are untouched; the `null_binding_cause_unit` prefix keeps CMake/CTest/target names disjoint. **What landed** — commit `34ec53a1`, in the `null-binding-cause-unit` worktree; main clone untouched. - `tests/null_binding_cause_unit_check.cpp` covers 10 cases: `enum_label_contract` (`none == -1`, dense `0..5`, `null_cause_count == 6`, exact names `"entry"`, `"buffer"`, `"token"`, `"wrapper"`, `"dimension"`, `"ring_full"`); `ring_full_precedence` (buffer ring failure beats `bound=true`, `from_table && !entry_readable`, and `from_table && token_magic && !token_known`); `buffer_bound_precedence` (bound buffer beats unreadable entry and unknown token); `table_entry_precedence` (unreadable entry for buffer and texture alike, and a texture with `bound=true` still reports `table_entry`); `unknown_token_from_table_precedence` (unknown token from a table beats wrapper/dimension/`!bound`, while a direct non-table unknown token behaves cleanly and `!token_magic` skips the check); `texture_token_magic`; `texture_wrapper_dimension`; `texture_ring_ignored` (`ring_failed=true` on a texture does NOT return `ring_full`); `buffer_unreadable_default` (default `BindingFacts{}` -> `buffer_unreadable`); and `truth_table_512`, an exhaustive 512-combination (`2^9`) truth table over the nine boolean fields against an independent priority specification, pinning absolute per-cause totals `none` 84, `table_entry` 80, `buffer_unreadable` 44, `unknown_token` 116, `texture_wrapper` 40, `dimension_mismatch` 20, `ring_full` 128. - Pure in-memory, no lambdas, clean `-Wall -Wextra -Wpedantic -Werror` and MSVC `/W4`-safe. - CMake: per-case CTests + `_all`, 7 `WILL_FAIL TRUE` header-copy controls (`ring_full_texture`, `buffer_bound_precedence`, `table_entry_readable`, `unknown_token_from_table`, `texture_token_magic`, `texture_dimension`, `buffer_ring_before_bound` — the last is the observable effect of reordering `!texture && bound` above `ring_failed`, modelled as the ring guard requiring `!bound`) with mutated copies at `<mut>/startup_stubs/null_binding_cause.h` and `BEFORE PRIVATE` include. The meta check mirrors them 1:1 with real C++ copies (g++ if present else `cl`, temp dirs removed in `finally`). **Verification (Linux, this host)** - `g++ -std=c++17 -O2 -Wall -Wextra -Wpedantic -Werror`: `PASS: null_binding_cause_unit: 10/10 cases passed` - Meta check: `PASS: null_binding_cause_unit: 10 cases, 7/7 mutations killed (g++)` - Scratch CMake + CTest (fragment configured standalone via symlinked src/tests; full configure needs DXC, unavailable on Linux): **18/18** (10 per-case + `_all` + 7 `WILL_FAIL` mutation controls) - Form, docs (208 files / 802 links), and bidi (2827 files) checks pass; `git diff --check` clean; merge-tree exits 0. - Full `python-linux` suite: **all 299 checks passed** Caveat: no mingw on this host, so no Windows compile check; WIN-VERIFY run is the arbiter. <!-- WIN-VERIFY: passed | sha=34ec53a16649fff151cec4c8c412a66644a251e4 | targets=null_binding_cause_unit_check null_binding_cause_unit_ring_full_texture_mut null_binding_cause_unit_buffer_bound_precedence_mut null_binding_cause_unit_table_entry_readable_mut null_binding_cause_unit_unknown_token_from_table_mut null_binding_cause_unit_texture_token_magic_mut null_binding_cause_unit_texture_dimension_mut null_binding_cause_unit_buffer_ring_before_bound_mut | ctest=^null_binding_cause_unit | release=true --> ### Windows Verification (`34ec53a1`) - `git merge-tree --write-tree upstream/main HEAD` -> `271d76dd` (exit 0), `git diff --check upstream/main...HEAD` clean - Repo checks: `py_compile`, `form_coverage_check.py`, `docs_links_check.py` (209 files, 806 links), `bidi_controls_check.py` (2830 files), `null_binding_cause_unit_meta_check.py` (`cl`: `10 cases, 7/7 mutations killed`) passed - Commands: ```text cmake --build --preset dev --target null_binding_cause_unit_check null_binding_cause_unit_ring_full_texture_mut null_binding_cause_unit_buffer_bound_precedence_mut null_binding_cause_unit_table_entry_readable_mut null_binding_cause_unit_unknown_token_from_table_mut null_binding_cause_unit_texture_token_magic_mut null_binding_cause_unit_texture_dimension_mut null_binding_cause_unit_buffer_ring_before_bound_mut ctest --preset dev --no-tests=error -j16 -R "^null_binding_cause_unit" --output-on-failure cmake --build --preset release --target null_binding_cause_unit_check null_binding_cause_unit_ring_full_texture_mut null_binding_cause_unit_buffer_bound_precedence_mut null_binding_cause_unit_table_entry_readable_mut null_binding_cause_unit_unknown_token_from_table_mut null_binding_cause_unit_texture_token_magic_mut null_binding_cause_unit_texture_dimension_mut null_binding_cause_unit_buffer_ring_before_bound_mut ctest --preset release --no-tests=error -j16 -R "^null_binding_cause_unit" --output-on-failure ``` - Results: `dev` 18/18 passed (0.86s); `release` 18/18 passed (0.76s); direct `null_binding_cause_unit_check.exe` (`dev` & `release`): `PASS: null_binding_cause_unit: 10/10 cases passed`. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 15:49:11 +00:00
github manually merged commit f0fcc41b80 into main 2026-12-01 17:05:18 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.