fix(tools): stop listing opcodes counted through their variants as uncounted #13615

Merged
SandstromPL merged 1 commit from upstream-pr/13615 into main 2026-10-31 09:23:39 +00:00
SandstromPL commented 2026-10-30 19:42:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SandstromPL on 2026-10-30T19:42:24Z.


What

The shader section of the progress page ends with "Decoded opcodes not present in AMD's public list are not counted", followed by the opcodes collect_shaders puts in extra. On main that list has 24 entries. Four of them are counted:

Opcode Counted as
VAddI32 V_ADD_CO_U32
VSubI32 V_SUB_CO_U32
VSubrevI32 V_SUBREV_CO_U32
SCbranchCdbg S_CBRANCH_CDBGSYS, S_CBRANCH_CDBGUSER, S_CBRANCH_CDBGSYS_OR_USER, S_CBRANCH_CDBGSYS_AND_USER

collect_shaders adds an opcode's OPCODE_VARIANTS to the counted set. It then adds the opcode itself to extra whenever the opcode's own name isn't in rdna_isa.txt, even when its variants were just counted. Now an opcode goes in extra only when neither its name nor any of its variants is in the list. Counting doesn't change.

Tested

Linux (Ubuntu 24.04, Python 3.12), main 16345cad6a:

  • New case in tools/tests/test_progress.py: an enum with VAddI32 and VMulLoI32 and an ISA list with only V_ADD_CO_U32. It expects one counted instruction and extra == ["VMulLoI32"]. On main it fails (['VAddI32', 'VMulLoI32'] != ['VMulLoI32']); with this PR it passes.
  • All tools/tests/test_progress*.py pass, as do test_import_audit.py and test_nid_names.py.
  • python3 tools/progress.py --json: shaders stay at 1166/1166, and extra goes from 24 entries to 20. The four above leave the list; the rest (VMulLoI32, the Ds*Src2* opcodes and the SDcache* opcodes) stay.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5090111209 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13615). Originally posted by [SandstromPL](https://github.com/SandstromPL) on 2026-10-30T19:42:24Z. --- ### What The shader section of the progress page ends with "Decoded opcodes not present in AMD's public list are not counted", followed by the opcodes `collect_shaders` puts in `extra`. On `main` that list has 24 entries. Four of them are counted: | Opcode | Counted as | |---|---| | `VAddI32` | `V_ADD_CO_U32` | | `VSubI32` | `V_SUB_CO_U32` | | `VSubrevI32` | `V_SUBREV_CO_U32` | | `SCbranchCdbg` | `S_CBRANCH_CDBGSYS`, `S_CBRANCH_CDBGUSER`, `S_CBRANCH_CDBGSYS_OR_USER`, `S_CBRANCH_CDBGSYS_AND_USER` | `collect_shaders` adds an opcode's `OPCODE_VARIANTS` to the counted set. It then adds the opcode itself to `extra` whenever the opcode's own name isn't in `rdna_isa.txt`, even when its variants were just counted. Now an opcode goes in `extra` only when neither its name nor any of its variants is in the list. Counting doesn't change. ### Tested Linux (Ubuntu 24.04, Python 3.12), `main` 16345cad6a: - New case in `tools/tests/test_progress.py`: an enum with `VAddI32` and `VMulLoI32` and an ISA list with only `V_ADD_CO_U32`. It expects one counted instruction and `extra == ["VMulLoI32"]`. On `main` it fails (`['VAddI32', 'VMulLoI32'] != ['VMulLoI32']`); with this PR it passes. - All `tools/tests/test_progress*.py` pass, as do `test_import_audit.py` and `test_nid_names.py`. - `python3 tools/progress.py --json`: shaders stay at 1166/1166, and `extra` goes from 24 entries to 20. The four above leave the list; the rest (`VMulLoI32`, the `Ds*Src2*` opcodes and the `SDcache*` opcodes) stay. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
blawesom commented 2026-10-30 20:21:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-30T20:21:53Z.

Review: APPROVED


Verified e699d93a62 on Linux x86-64 (GCC 16.2.1, CachyOS kernel 6.2.10, Release, BUILD_TESTING=ON). Python-only change to tools/progress.py.

  • Diff read: extra now only receives an opcode when neither its own name nor any of its OPCODE_VARIANTS resolved into the ISA list — previously an opcode counted via its variants was still listed as uncounted. The counted set is unchanged (variants still added before the check).
  • python3 -m unittest tools.tests.test_progress (pytest not installed; file is unittest-based): Ran 57 tests ... OK, including the new test_opcodes_counted_through_variants_are_not_listed_as_uncounted (enum VAddI32/VMulLoI32, ISA with only V_ADD_CO_U32 → done=1, extra=[VMulLoI32]).
  • Smoke: python3 tools/progress.py --json at the PR head → shaders 1166/1166 unchanged, extra 24 → 20 entries (VAddI32, VSubI32, VSubrevI32, SCbranchCdbg dropped; the Ds*Src2* and SDcache* opcodes remain), matching the PR body exactly.
  • Checklist items are accurate for this change (tools-only, no NIDs/stubs, no debt-doc implications, n/a GPU claims). No repo conventions violated (no comments added).

No build needed (no C++ touched). Nothing left open.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5718212575 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13615#pullrequestreview-5718212575). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-30T20:21:53Z. **Review:** APPROVED --- Verified e699d93a62 on Linux x86-64 (GCC 16.2.1, CachyOS kernel 6.2.10, Release, BUILD_TESTING=ON). Python-only change to tools/progress.py. - Diff read: `extra` now only receives an opcode when neither its own name nor any of its `OPCODE_VARIANTS` resolved into the ISA list — previously an opcode counted via its variants was still listed as uncounted. The counted set is unchanged (variants still added before the check). - `python3 -m unittest tools.tests.test_progress` (pytest not installed; file is unittest-based): **Ran 57 tests ... OK**, including the new `test_opcodes_counted_through_variants_are_not_listed_as_uncounted` (enum `VAddI32`/`VMulLoI32`, ISA with only `V_ADD_CO_U32` → done=1, extra=[VMulLoI32]). - Smoke: `python3 tools/progress.py --json` at the PR head → shaders 1166/1166 unchanged, `extra` 24 → 20 entries (`VAddI32`, `VSubI32`, `VSubrevI32`, `SCbranchCdbg` dropped; the `Ds*Src2*` and `SDcache*` opcodes remain), matching the PR body exactly. - Checklist items are accurate for this change (tools-only, no NIDs/stubs, no debt-doc implications, n/a GPU claims). No repo conventions violated (no comments added). No build needed (no C++ touched). Nothing left open.
MarcZX10 commented 2026-10-30 20:23:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T20:23:15Z.

Review: APPROVED


Reviewed — looks good

I approve head e699d93a62a01583c12063b99d2cb87adbc66f1e: opcodes counted through a listed variant are no longer reported as uncounted, and the new regression test fails on the base behavior.

What I ran

Reviewed exact head e699d93a62a01583c12063b99d2cb87adbc66f1e against PR base 1c793c03ade93d92a9a4b10c638a0228249b1ef6. The no-build merge preview was clean against current main 73ffb45110da8a9960267124941316bc006998ea. Environment: Linux x86-64, Python 3.11.2. No project build or compile was run.

python3 -m py_compile tools/progress.py
python3 -m unittest tools.tests.test_progress
python3 tools/check_test_registration.py --scripts
git diff --check 1c793c03ade93d92a9a4b10c638a0228249b1ef6...e699d93a62a01583c12063b99d2cb87adbc66f1e
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13615

Results

Check Result
Python syntax Passed.
tools.tests.test_progress Passed: 57 tests.
Test registration Passed: 226 test scripts are registered by an add_test or workflow.
Diff, conventions, merge preview Passed.
Negative control on base The new regression test failed by assertion on base, as expected.
Hosted CI Linux and Windows relinker jobs, relinker ASan, conventions, intake, labels, eligibility, and report passed; macOS relinker jobs were pending. Full Linux/Windows builds and specialized jobs were skipped.
Unedited test and negative-control output

python3 -m unittest tools.tests.test_progress:

.........................................................
----------------------------------------------------------------------
Ran 57 tests in 0.532s

OK

python3 tools/check_test_registration.py --scripts:

226 test script(s), each run by an add_test or a workflow

The precheck's negative-control run against base 1c793c03ade93d92a9a4b10c638a0228249b1ef6:


............................F............................
======================================================================
FAIL: test_opcodes_counted_through_variants_are_not_listed_as_uncounted (tools.tests.test_progress.ProgressTests.test_opcodes_counted_through_variants_are_not_listed_as_uncounted)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13615-e699d93a62a0/negative-control-base-0351ad1a/tools/tests/test_progress.py", line 365, in test_opcodes_counted_through_variants_are_not_listed_as_uncounted
    self.assertEqual(shaders["extra"], ["VMulLoI32"])
AssertionError: Lists differ: ['VAddI32', 'VMulLoI32'] != ['VMulLoI32']

First differing element 0:
'VAddI32'
'VMulLoI32'

First list contains 1 additional elements.
First extra element 1:
'VMulLoI32'

- ['VAddI32', 'VMulLoI32']
+ ['VMulLoI32']

----------------------------------------------------------------------
Ran 57 tests in 0.546s

FAILED (failures=1)

Negative control

Assertion Base-code change Did the new test fail?
A variant-listed opcode is omitted from extra, while an unrelated unsupported opcode remains Ran the new test against base 1c793c03ade93d92a9a4b10c638a0228249b1ef6, which lacks this fix Yes, by the expected assertion.

Sources

Not verified

The two macOS relinker jobs were still pending at the final check snapshot. The no-build precheck's optional test-quality helper was absent from its isolated checkout; its warning did not affect the direct Python tests, registration check, or negative control.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5718225647 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13615#pullrequestreview-5718225647). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T20:23:15Z. **Review:** APPROVED --- # Reviewed — looks good I approve head `e699d93a62a01583c12063b99d2cb87adbc66f1e`: opcodes counted through a listed variant are no longer reported as uncounted, and the new regression test fails on the base behavior. ## What I ran Reviewed exact head `e699d93a62a01583c12063b99d2cb87adbc66f1e` against PR base `1c793c03ade93d92a9a4b10c638a0228249b1ef6`. The no-build merge preview was clean against current `main` `73ffb45110da8a9960267124941316bc006998ea`. Environment: Linux x86-64, Python 3.11.2. No project build or compile was run. ```sh python3 -m py_compile tools/progress.py python3 -m unittest tools.tests.test_progress python3 tools/check_test_registration.py --scripts git diff --check 1c793c03ade93d92a9a4b10c638a0228249b1ef6...e699d93a62a01583c12063b99d2cb87adbc66f1e python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13615 ``` ## Results | Check | Result | |---|---| | Python syntax | Passed. | | `tools.tests.test_progress` | Passed: 57 tests. | | Test registration | Passed: 226 test scripts are registered by an `add_test` or workflow. | | Diff, conventions, merge preview | Passed. | | Negative control on base | The new regression test failed by assertion on base, as expected. | | Hosted CI | Linux and Windows relinker jobs, relinker ASan, conventions, intake, labels, eligibility, and report passed; macOS relinker jobs were pending. Full Linux/Windows builds and specialized jobs were skipped. | <details> <summary>Unedited test and negative-control output</summary> `python3 -m unittest tools.tests.test_progress`: ```text ......................................................... ---------------------------------------------------------------------- Ran 57 tests in 0.532s OK ``` `python3 tools/check_test_registration.py --scripts`: ```text 226 test script(s), each run by an add_test or a workflow ``` The precheck's negative-control run against base `1c793c03ade93d92a9a4b10c638a0228249b1ef6`: ```text ............................F............................ ====================================================================== FAIL: test_opcodes_counted_through_variants_are_not_listed_as_uncounted (tools.tests.test_progress.ProgressTests.test_opcodes_counted_through_variants_are_not_listed_as_uncounted) ---------------------------------------------------------------------- Traceback (most recent call last): File "/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-13615-e699d93a62a0/negative-control-base-0351ad1a/tools/tests/test_progress.py", line 365, in test_opcodes_counted_through_variants_are_not_listed_as_uncounted self.assertEqual(shaders["extra"], ["VMulLoI32"]) AssertionError: Lists differ: ['VAddI32', 'VMulLoI32'] != ['VMulLoI32'] First differing element 0: 'VAddI32' 'VMulLoI32' First list contains 1 additional elements. First extra element 1: 'VMulLoI32' - ['VAddI32', 'VMulLoI32'] + ['VMulLoI32'] ---------------------------------------------------------------------- Ran 57 tests in 0.546s FAILED (failures=1) ``` </details> ## Negative control | Assertion | Base-code change | Did the new test fail? | |---|---|---| | A variant-listed opcode is omitted from `extra`, while an unrelated unsupported opcode remains | Ran the new test against base `1c793c03ade93d92a9a4b10c638a0228249b1ef6`, which lacks this fix | Yes, by the expected assertion. | ## Sources - [Variant matching and `extra` classification at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/e699d93a62a01583c12063b99d2cb87adbc66f1e/tools/progress.py#L236-L247) - [Regression test at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/e699d93a62a01583c12063b99d2cb87adbc66f1e/tools/tests/test_progress.py#L355-L365) ## Not verified The two macOS relinker jobs were still pending at the final check snapshot. The no-build precheck's optional test-quality helper was absent from its isolated checkout; its warning did not affect the direct Python tests, registration check, or negative control.
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
boykopovar/AnyPS5!13615
No description provided.