tooling: ignore MASM labels, directives and assignments in form coverage #1980

Manually merged
github merged 2 commits from gh-pr/1980/head into gh-pr/1980/base 2026-11-26 23:47:21 +00:00
Owner

@⁠davutsimsekk on GitHub · 2026-11-24 22:33 UTC · original
davutsimsekk:fix/form-coverage-masm-tokens → main · +12 −3 · 2 files · 2 commits · merged 2026-11-24 23:04 UTC

tools/form_coverage.py:masm_mnemonics treated five non-instructions from the repository's MASM fixtures as mnemonics:

  • @@: anonymous labels (tests/cpu/adx.asm, bit_ops.asm, …)
  • elseifdef (chained.asm)
  • ifidni (flag_conditions.asm)
  • rept (exe_tls_template.asm)
  • word_index from the assembly-time assignment word_index = 0

They leaked into fixture_forms_not_in_reference, so the report claimed fixtures used forms the reference does not contain. Merged #227 had made that list empty; the guard was later narrowed to three old tokens.

This strips @@: labels, adds the missing conditional-assembly directives, and skips name = expression. It only affects the coverage report; no instruction measurement changes.

Test

python -B tests/form_coverage_check.py now asserts the five-token list is empty and checks a synthetic source with @@:, REPT, IFIDNI and an assignment.

python -B tests/form_coverage_check.py -> form coverage checks passed

No game data or GPU was used.

**@⁠davutsimsekk** on GitHub · 2026-11-24 22:33 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1980) `davutsimsekk:fix/form-coverage-masm-tokens` → `main` · +12 −3 · 2 files · 2 commits · merged 2026-11-24 23:04 UTC `tools/form_coverage.py:masm_mnemonics` treated five non-instructions from the repository's MASM fixtures as mnemonics: - `@@:` anonymous labels (`tests/cpu/adx.asm`, `bit_ops.asm`, …) - `elseifdef` (`chained.asm`) - `ifidni` (`flag_conditions.asm`) - `rept` (`exe_tls_template.asm`) - `word_index` from the assembly-time assignment `word_index = 0` They leaked into `fixture_forms_not_in_reference`, so the report claimed fixtures used forms the reference does not contain. Merged #227 had made that list empty; the guard was later narrowed to three old tokens. This strips `@@:` labels, adds the missing conditional-assembly directives, and skips `name = expression`. It only affects the coverage report; no instruction measurement changes. ## Test `python -B tests/form_coverage_check.py` now asserts the five-token list is empty and checks a synthetic source with `@@:`, `REPT`, `IFIDNI` and an assignment. ``` python -B tests/form_coverage_check.py -> form coverage checks passed ``` No game data or GPU was used.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:47:20 +00:00
github manually merged commit 14d6023ec6 into gh-pr/1980/base 2026-11-26 23:47:21 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-24 22:58 UTC · original

Kept the existing isolated branch and label fixture on its original input, with the new anonymous-label and directive assertions running separately. The complete Windows form_coverage_check.py passed.

**@⁠R0Y00** on GitHub · 2026-11-24 22:58 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1980#issuecomment-7146868883) Kept the existing isolated branch and label fixture on its original input, with the new anonymous-label and directive assertions running separately. The complete Windows form_coverage_check.py passed.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 22:48 UTC · original · reviewed

Review of head 5b2dadd713 (comment only, no approval).

Diff read in full (2 files, tooling and its test only; no CMakeLists change, no new third-party content). Anonymous labels (@@:), word_index = 0 assignments and the IFIDNI/REPT/ELSEIFDEF directives are no longer reported as instructions. The new test assertions match that intent. P1: 0. P2: 0.

Commands executed locally:

  • git merge-tree --write-tree --name-only origin/main HEAD: clean, no conflicts.
  • gh pr checks 1980: Windows, Linux and gfx1013 jobs pass; the /O2 job and chart job are skipped.
  • python3 tests/docs_links_check.py: PASS (18 files, 386 links).
  • python3 tests/bidi_controls_check.py: PASS.
  • git diff --check origin/main...HEAD: PASS.
  • python3 tests/form_coverage_check.py on Linux: cannot run here (iced_x86 not installed), so the new assertion was exercised through masm_mnemonics directly instead.
  • Mutation 1: drop the words[1] == "=" skip. The new snippet returns an extra word_index, so it is caught.
  • Mutation 2: remove ifidni and rept from MASM_DIRECTIVES. Both leak into the result, so it is caught.
  • python3 x2w_pipe.py win2025 1980 --wait 900, run twice: form_coverage PASSED, but cpu_aot_trap (#679) FAILED both times with FileNotFoundError ... cpu_trap_lifted_o2.dll. That is a build-output lookup in a test the PR does not touch, so it is probably a node or slot problem rather than this change. It still means the local Win2025 run is not green.

Result: no defects found in the change. Not merging from here because the local Win2025 run is not green.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-24 22:48 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1980#pullrequestreview-6048619284) · **reviewed** Review of head 5b2dadd713efaf7387a37da8517bb32ae19889c6 (comment only, no approval). Diff read in full (2 files, tooling and its test only; no CMakeLists change, no new third-party content). Anonymous labels (`@@:`), `word_index = 0` assignments and the `IFIDNI`/`REPT`/`ELSEIFDEF` directives are no longer reported as instructions. The new test assertions match that intent. P1: 0. P2: 0. Commands executed locally: - `git merge-tree --write-tree --name-only origin/main HEAD`: clean, no conflicts. - `gh pr checks 1980`: Windows, Linux and gfx1013 jobs pass; the /O2 job and chart job are skipped. - `python3 tests/docs_links_check.py`: PASS (18 files, 386 links). - `python3 tests/bidi_controls_check.py`: PASS. - `git diff --check origin/main...HEAD`: PASS. - `python3 tests/form_coverage_check.py` on Linux: cannot run here (`iced_x86` not installed), so the new assertion was exercised through `masm_mnemonics` directly instead. - Mutation 1: drop the `words[1] == "="` skip. The new snippet returns an extra `word_index`, so it is caught. - Mutation 2: remove `ifidni` and `rept` from `MASM_DIRECTIVES`. Both leak into the result, so it is caught. - `python3 x2w_pipe.py win2025 1980 --wait 900`, run twice: `form_coverage` PASSED, but `cpu_aot_trap` (#679) FAILED both times with `FileNotFoundError ... cpu_trap_lifted_o2.dll`. That is a build-output lookup in a test the PR does not touch, so it is probably a node or slot problem rather than this change. It still means the local Win2025 run is not green. Result: no defects found in the change. Not merging from here because the local Win2025 run is not green. AI-assisted; commands listed were executed locally.
This discussion has been locked. Commenting is limited to contributors.
No description provided.