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

Merged
davutsimsekk merged 2 commits from upstream-pr/1980 into main 2026-11-24 23:04:50 +00:00
davutsimsekk commented 2026-11-24 22:33:31 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by davutsimsekk on 2026-11-24T22:33:31Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6592752317 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1980). Originally posted by [davutsimsekk](https://github.com/davutsimsekk) on 2026-11-24T22:33:31Z. --- `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.
tedin7 commented 2026-11-24 23:03:24 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T22:48:59Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6048619284 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1980#pullrequestreview-6048619284). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T22:48:59Z. **Review:** COMMENTED --- 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.
R0Y00 commented 2026-11-24 23:03:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T22:58:46Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7146868883 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1980#issuecomment-7146868883). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T22:58:46Z. --- 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.
upstream-sync closed this pull request 2026-11-25 00:04:46 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!1973
No description provided.