tooling: add a measured progress dashboard #140

Merged
Kha73k merged 8 commits from upstream-pr/141 into main 2026-11-21 18:43:30 +00:00
Kha73k commented 2026-11-21 17:01:32 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Kha73k on 2026-11-21T17:01:32Z.


Measures instruction-form coverage from a CTest run. This PR holds only the measurement and its tests; README graphics would be a separate, later PR.

This is not a measure of port completion: it counts which forms from a reference list appear in a source-built fixture whose translation test passed.

  • tools/form_coverage.py out/test-results.xml [--json …] (stdlib only). A fixture's forms count only when its test passed. Skipped or failed tests add nothing; forms held back only by a skip are listed separately.
  • Denominators in docs/coverage/, built by tools/form_reference.py: 948 x64 mnemonics Zen 2 runs in user mode (iced-x86), 1,968 gfx1013 and 1,863 gfx1030 forms (LLVM 15's generated AMDGPU syntax docs).
  • tests/form_coverage_check.py (Linux Python job) checks the denominators, the example below, and the pass/skip/fail rules.

Example: tests/cpu/branch.asm contains mov cmp jb jae add jmp sub ret (jae is the INVERT_BRANCH build). These are 8 Integer forms, covered when cpu_leaf_aot_branches passes; when it is skipped, 0 are covered and the 8 are listed as held back.

Run at 3f1e504 (Windows 10, RTX 3070 Ti; 66 passed, 12 skipped): x64 34/948, gfx1013 34/1968, gfx1030 34/1863. If pixel_aot_warp and pixel_aot_hardware were skipped, gfx1013 would drop to 0 with 34 held back.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6531802716 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/141). Originally posted by [Kha73k](https://github.com/Kha73k) on 2026-11-21T17:01:32Z. --- Measures instruction-form coverage from a CTest run. This PR holds only the measurement and its tests; README graphics would be a separate, later PR. This is not a measure of port completion: it counts which forms from a reference list appear in a source-built fixture whose translation test passed. - `tools/form_coverage.py out/test-results.xml [--json …]` (stdlib only). A fixture's forms count only when its test passed. Skipped or failed tests add nothing; forms held back only by a skip are listed separately. - Denominators in `docs/coverage/`, built by `tools/form_reference.py`: 948 x64 mnemonics Zen 2 runs in user mode (iced-x86), 1,968 gfx1013 and 1,863 gfx1030 forms (LLVM 15's generated AMDGPU syntax docs). - `tests/form_coverage_check.py` (Linux Python job) checks the denominators, the example below, and the pass/skip/fail rules. Example: `tests/cpu/branch.asm` contains `mov cmp jb jae add jmp sub ret` (`jae` is the `INVERT_BRANCH` build). These are 8 Integer forms, covered when `cpu_leaf_aot_branches` passes; when it is skipped, 0 are covered and the 8 are listed as held back. Run at 3f1e504 (Windows 10, RTX 3070 Ti; 66 passed, 12 skipped): x64 34/948, gfx1013 34/1968, gfx1030 34/1863. If `pixel_aot_warp` and `pixel_aot_hardware` were skipped, gfx1013 would drop to 0 with 34 held back. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
upstream-sync closed this pull request 2026-11-24 06:41:31 +00:00
R0Y00 commented 2026-11-24 06:47:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T17:17:54Z.


Please separate the measurement tool and its source/denominator tests from the generated README graphics. For the first review, include one fixture-to-instruction example and show how a skipped test affects the count. Keep instruction-form coverage separate from a percentage of overall port completion.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7066368986 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/141#issuecomment-7066368986). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-21T17:17:54Z. --- Please separate the measurement tool and its source/denominator tests from the generated README graphics. For the first review, include one fixture-to-instruction example and show how a skipped test affects the count. Keep instruction-form coverage separate from a percentage of overall port completion.
Kha73k commented 2026-11-24 06:47:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Kha73k on 2026-11-21T17:22:36Z.


Thanks, done in 06c874a:

  • Split: the PR now contains only the measurement (tools/form_coverage.py), its denominators (docs/coverage/*.tsv, tools/form_reference.py) and tests/form_coverage_check.py. The renderer, generated dashboard, badges and README change are removed.
  • Example: branch.asm gives mov cmp jb jae add jmp sub ret, 8 Integer forms, covered only while cpu_leaf_aot_branches passes. The test also checks the denominators (x64 regenerated from iced-x86, gfx encodings and the doc parser).
  • Skips: a skipped or failed test adds nothing. Skips are reported separately as "held back": with cpu_leaf_aot_branches skipped the example covers 0 and lists 8 held back, and with both pixel_aot_* skipped gfx1013 drops from 34 to 0.
  • Wording: the output and docs say "instruction-form coverage" and state that it is not a measure of port completion.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7066434951 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/141#issuecomment-7066434951). Originally posted by [Kha73k](https://github.com/Kha73k) on 2026-11-21T17:22:36Z. --- Thanks, done in 06c874a: - Split: the PR now contains only the measurement (`tools/form_coverage.py`), its denominators (`docs/coverage/*.tsv`, `tools/form_reference.py`) and `tests/form_coverage_check.py`. The renderer, generated dashboard, badges and README change are removed. - Example: `branch.asm` gives `mov cmp jb jae add jmp sub ret`, 8 Integer forms, covered only while `cpu_leaf_aot_branches` passes. The test also checks the denominators (x64 regenerated from iced-x86, gfx encodings and the doc parser). - Skips: a skipped or failed test adds nothing. Skips are reported separately as "held back": with `cpu_leaf_aot_branches` skipped the example covers 0 and lists 8 held back, and with both `pixel_aot_*` skipped gfx1013 drops from 34 to 0. - Wording: the output and docs say "instruction-form coverage" and state that it is not a measure of port completion.
R0Y00 commented 2026-11-24 06:47:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T17:26:51Z.


The split and skipped-test example address the dashboard review. Linux CI on 06c874a now stops with Classify the new CPU fixture switch.asm in CPU_FIXTURES. Please classify the merged #86 fixture and verify that a skipped jump-table run contributes zero covered forms. Job.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7066488265 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/141#issuecomment-7066488265). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-21T17:26:51Z. --- The split and skipped-test example address the dashboard review. Linux CI on 06c874a now stops with `Classify the new CPU fixture switch.asm in CPU_FIXTURES`. Please classify the merged #86 fixture and verify that a skipped jump-table run contributes zero covered forms. [Job](https://github.com/R0Y00/Xbox2Windows/actions/runs/44929684076/job/136923347607).
Kha73k commented 2026-11-24 06:47:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Kha73k on 2026-11-21T17:30:05Z.


Done in the latest commits: main is merged in, and the CI conflict is resolved by keeping both Python check lines.

  • switch.asm maps to cpu_aot_jump_tables. two_imports.asm runs unchanged under pe_map, so its forms are known but never covered.
  • check_jump_tables() pins switch.asm's 18 forms. Passed, they cover 18. Skipped, they cover 0 and all 18 are listed as held back. Skipped next to a passing cpu_leaf_aot_branches, only branch.asm's 8 count.
  • Real run on current main (Windows 10, RTX 3070 Ti, 82 tests: 70 passed, 12 skipped): x64 38/948. With cpu_aot_jump_tables marked skipped it falls to 34, and neg not sar shr are listed as held back.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7066528345 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/141#issuecomment-7066528345). Originally posted by [Kha73k](https://github.com/Kha73k) on 2026-11-21T17:30:05Z. --- Done in the latest commits: main is merged in, and the CI conflict is resolved by keeping both Python check lines. - `switch.asm` maps to `cpu_aot_jump_tables`. `two_imports.asm` runs unchanged under `pe_map`, so its forms are known but never covered. - `check_jump_tables()` pins switch.asm's 18 forms. Passed, they cover 18. Skipped, they cover 0 and all 18 are listed as held back. Skipped next to a passing `cpu_leaf_aot_branches`, only branch.asm's 8 count. - Real run on current main (Windows 10, RTX 3070 Ti, 82 tests: 70 passed, 12 skipped): x64 38/948. With `cpu_aot_jump_tables` marked skipped it falls to 34, and `neg not sar shr` are listed as held back.
R0Y00 commented 2026-11-24 06:47:44 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T17:57:57Z.


The switch.asm mapping and the zero-coverage case for skipped jump-table tests address the previous review. Two merged changes now affect this test on main. #157 added tests/cpu/bink_descriptors.asm, which is missing from CPU_FIXTURES and triggers the unclassified-fixture exit. #129 expanded branch.asm with additional conditional branches, while check_example still expects eight forms. Please cover both fixtures on current main and rerun tests/form_coverage_check.py, including the skip cases.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7066899979 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/141#issuecomment-7066899979). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-21T17:57:57Z. --- The switch.asm mapping and the zero-coverage case for skipped jump-table tests address the previous review. Two merged changes now affect this test on main. #157 added tests/cpu/bink_descriptors.asm, which is missing from CPU_FIXTURES and triggers the unclassified-fixture exit. #129 expanded branch.asm with additional conditional branches, while check_example still expects eight forms. Please cover both fixtures on current main and rerun tests/form_coverage_check.py, including the skip cases.
Kha73k commented 2026-11-24 06:47:45 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Kha73k on 2026-11-21T18:06:54Z.


Done, and the check no longer depends on fixtures that change on main:

  • bink_descriptors.asm (#157) maps to cpu_bink_descriptors. rdna2_tools_check.py contains gfx text and is classified as non-translation input.
  • A fixture not yet in CPU_FIXTURES/SHADER_FIXTURES no longer exits. It is never counted and is listed as "Not counted until classified". A new fixture on main can no longer break this check or raise the numbers.
  • form_coverage_check.py measures small fixtures written inside the test (in a temporary tests/ tree) instead of the live branch.asm and switch.asm, so edits like #129 do not change its expectations. The cases are the same: branch passed gives 8 covered, skipped gives 0 with 8 held back, failed gives 0 with none held back. A skipped jump-table run gives 0, alone and next to a passing fixture. A new case checks that unclassified CPU and gfx fixtures add 0 even when every test passes.
  • Mutation checks: counting skips as passes, or counting unclassified fixtures, both make the check fail.
  • The CI line moved up the Python-check list, away from the end where new checks are appended.
  • Real run on current main (a352292; Windows 10 19045, RTX 3070 Ti driver 32.0.16.2124; 102 tests: 86 passed, 15 skipped, 1 failed): x64 40/948, gfx1013 42/1968, gfx1030 42/1863, nothing unclassified. cpu_bink_descriptors and cpu_leaf_aot_branches pass. Marking either one skipped drops x64 to 39, holding back int and jbe respectively.
  • The one failure is pixel_aot_warp in check_predicate_draws (the predicates.case draw exits 1) on the Windows 10 inbox WARP, driver 10.0.19041.7811. pixel_aot_hardware passes, and this PR does not touch the pixel files. Since no pixel test passed, marking pixel_aot_hardware skipped drops gfx1013 to 0 with 42 held back.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7067011953 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/141#issuecomment-7067011953). Originally posted by [Kha73k](https://github.com/Kha73k) on 2026-11-21T18:06:54Z. --- Done, and the check no longer depends on fixtures that change on main: - `bink_descriptors.asm` (#157) maps to `cpu_bink_descriptors`. `rdna2_tools_check.py` contains gfx text and is classified as non-translation input. - A fixture not yet in `CPU_FIXTURES`/`SHADER_FIXTURES` no longer exits. It is never counted and is listed as "Not counted until classified". A new fixture on main can no longer break this check or raise the numbers. - `form_coverage_check.py` measures small fixtures written inside the test (in a temporary `tests/` tree) instead of the live `branch.asm` and `switch.asm`, so edits like #129 do not change its expectations. The cases are the same: branch passed gives 8 covered, skipped gives 0 with 8 held back, failed gives 0 with none held back. A skipped jump-table run gives 0, alone and next to a passing fixture. A new case checks that unclassified CPU and gfx fixtures add 0 even when every test passes. - Mutation checks: counting skips as passes, or counting unclassified fixtures, both make the check fail. - The CI line moved up the Python-check list, away from the end where new checks are appended. - Real run on current main (a352292; Windows 10 19045, RTX 3070 Ti driver 32.0.16.2124; 102 tests: 86 passed, 15 skipped, 1 failed): x64 40/948, gfx1013 42/1968, gfx1030 42/1863, nothing unclassified. `cpu_bink_descriptors` and `cpu_leaf_aot_branches` pass. Marking either one skipped drops x64 to 39, holding back `int` and `jbe` respectively. - The one failure is `pixel_aot_warp` in `check_predicate_draws` (the `predicates.case` draw exits 1) on the Windows 10 inbox WARP, driver 10.0.19041.7811. `pixel_aot_hardware` passes, and this PR does not touch the pixel files. Since no pixel test passed, marking `pixel_aot_hardware` skipped drops gfx1013 to 0 with 42 held back.
R0Y00 commented 2026-11-24 06:47:45 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-21T18:11:58Z.


The independent CPU fixtures and unclassified-file control address the previous review. One measurable overcount remains at a3522920: gfx_mnemonics collects all Python string constants in pixel_aot_check.py, including s_nop 0, which is supplied to must_reject. A passing WARP run consequently credits s_nop as covered although that case was rejected. Please count the successful translation inputs, and add a regression where a rejection-only opcode stays out of covered.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7067075441 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/141#issuecomment-7067075441). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-21T18:11:58Z. --- The independent CPU fixtures and unclassified-file control address the previous review. One measurable overcount remains at `a3522920`: `gfx_mnemonics` collects all Python string constants in `pixel_aot_check.py`, including `s_nop 0`, which is supplied to `must_reject`. A passing WARP run consequently credits `s_nop` as covered although that case was rejected. Please count the successful translation inputs, and add a regression where a rejection-only opcode stays out of `covered`.
Kha73k commented 2026-11-24 06:47:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Kha73k on 2026-11-21T18:25:22Z.


Fixed in 4e90a61 (on current main, 7232663): gfx coverage now counts only programs the translator accepted.

  • pixel_aot_check.py wraps pixel_aot.lower and records the first word of each line of every program that lowered without an error. A program given to must_reject raises before it is recorded. At exit the record goes to FORM_COVERAGE_RECORD, which CMake sets for pixel_aot_warp and pixel_aot_hardware. The string scan of test files is removed.
  • form_coverage.py counts a record only when its test passed in the JUnit run, and only if the record was written inside that run's time window (timestamp + time), so a record and a status always come from the same run.
  • Regression in form_coverage_check.py:
    • assembly(False) with s_nop 0 in place of s_waitcnt lgkmcnt(0) is rejected and leaves nothing recorded.
    • The accepted program alone is covered.
    • Adding s_nop to the record raises covered by exactly one form.
    • The real check_controls() never records s_nop.
    • Pass gives the record's forms, skip gives 0 with all of them held back, fail gives 0. A stale record is ignored.
  • Mutation checks: each of the following makes the check fail.
    • Recording before lower returns.
    • Accepting stale records.
    • Counting skips as passes.
    • Ignoring the shader test's status.
  • Against the old scan of pixel_aot_check.py, on the same run:
    • s_nop, s_branch, v_cmp_class_f32 and v_cmpx_ge_f32_e64 drop out; they only reach must_reject.
    • Thirteen v_cmp_<predicate>_f32 forms built by predicate_group() f-strings are now counted.
  • x64 checked for the same issue:
    • The only fixture code that is not lifted is neighbor in chained.asm and BinkSetMemory in bink_heap.asm. Both contain only mov and ret, which lifted code also covers.
    • The rejected cpu_repeat_dropped variant only removes an instruction.
    • So no x64 form is credited by untranslated or rejection-only code.
    • repeat_call.asm and working_set_delta.asm are now classified.
  • Real run on 4e90a61 (Windows 10 19045, RTX 3070 Ti driver 32.0.16.2124; 107 tests: 91 passed, 15 skipped, 1 failed):
    • Coverage: x64 40/948, gfx1013 57/1968, gfx1030 57/1863.
    • Records were read from both pixel tests.
    • Marking pixel_aot_hardware skipped gives gfx1013 0 with 57 held back.
    • The failure is pixel_aot_warp in check_predicate_draws on the Windows 10 inbox WARP (10.0.19041.7811), unchanged by this PR. pixel_aot_hardware passes.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7067242974 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/141#issuecomment-7067242974). Originally posted by [Kha73k](https://github.com/Kha73k) on 2026-11-21T18:25:22Z. --- Fixed in 4e90a61 (on current main, 7232663): gfx coverage now counts only programs the translator accepted. - `pixel_aot_check.py` wraps `pixel_aot.lower` and records the first word of each line of every program that lowered without an error. A program given to `must_reject` raises before it is recorded. At exit the record goes to `FORM_COVERAGE_RECORD`, which CMake sets for `pixel_aot_warp` and `pixel_aot_hardware`. The string scan of test files is removed. - `form_coverage.py` counts a record only when its test passed in the JUnit run, and only if the record was written inside that run's time window (`timestamp` + `time`), so a record and a status always come from the same run. - Regression in `form_coverage_check.py`: - `assembly(False)` with `s_nop 0` in place of `s_waitcnt lgkmcnt(0)` is rejected and leaves nothing recorded. - The accepted program alone is covered. - Adding `s_nop` to the record raises covered by exactly one form. - The real `check_controls()` never records `s_nop`. - Pass gives the record's forms, skip gives 0 with all of them held back, fail gives 0. A stale record is ignored. - Mutation checks: each of the following makes the check fail. - Recording before `lower` returns. - Accepting stale records. - Counting skips as passes. - Ignoring the shader test's status. - Against the old scan of `pixel_aot_check.py`, on the same run: - `s_nop`, `s_branch`, `v_cmp_class_f32` and `v_cmpx_ge_f32_e64` drop out; they only reach `must_reject`. - Thirteen `v_cmp_<predicate>_f32` forms built by `predicate_group()` f-strings are now counted. - x64 checked for the same issue: - The only fixture code that is not lifted is `neighbor` in `chained.asm` and `BinkSetMemory` in `bink_heap.asm`. Both contain only `mov` and `ret`, which lifted code also covers. - The rejected `cpu_repeat_dropped` variant only removes an instruction. - So no x64 form is credited by untranslated or rejection-only code. - `repeat_call.asm` and `working_set_delta.asm` are now classified. - Real run on 4e90a61 (Windows 10 19045, RTX 3070 Ti driver 32.0.16.2124; 107 tests: 91 passed, 15 skipped, 1 failed): - Coverage: x64 40/948, gfx1013 57/1968, gfx1030 57/1863. - Records were read from both pixel tests. - Marking `pixel_aot_hardware` skipped gives gfx1013 0 with 57 held back. - The failure is `pixel_aot_warp` in `check_predicate_draws` on the Windows 10 inbox WARP (10.0.19041.7811), unchanged by this PR. `pixel_aot_hardware` passes.
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!140
No description provided.