tooling: skip BOM and commented labels in scan_unsupported_shaders assembly parsing #1979
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1986"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by RenzoWit35 on 2026-11-24T22:36:53Z.
Change
parse_assembly_fileintools/scan_unsupported_shaders.pyreturned non-instruction text as instructions, which skews the support percentage and the missing-opcode ranking.utf-8, so a UTF-8 BOM (written by Windows PowerShell 5>/Out-File -Encoding utf8) stayed on the first line. A fileEF BB BF+s_endpgmparsed to['\ufeffs_endpgm'], reported as an unrecognized opcode (0% supported). It now opens withutf-8-sig(errors="replace"kept).pixel: ; @pixel,.LBB0_1: ; %bb.1), which were counted as opcodespixel:/.LBB0_1:. The filter now strips the comment first, using the same rule asextract_opcode(//,;,#), and skips the line if the remaining code is a bare label. Real instructions are still appended unchanged, sos_endpgm ; done:is kept.Verification
Environment: Windows 11, Python 3.14.5.
python -B tests/rdna2_tools_check.py: after the changeRan 153 tests ... OK (skipped=19), new test included; the new test istest_parse_assembly_file_skips_bom_and_commented_labels, next to the existing scan test with the barepixel:label.tools/scan_unsupported_shaders.pyrestored toorigin/main, the file givesFAILED (failures=1, skipped=19), first mismatch['\ufeffs_endpgm']vs['s_endpgm'].Not run: other test files, Linux/macOS.
Evidence and follow-up
Rebased on current
main. Open PRs #1923, #1680, #1670, #1644, #1612, #1584, #1466, #713 and #528 touch this file's opcode tables;gh pr diffgreps show none touchesparse_assembly_file. No issue is linked.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T22:45:03Z.
Review: COMMENTED
Review of head
24e5a1714f3bad5a0d7405a5d5a2f9b2120d587c.Diff:
tools/scan_unsupported_shaders.py(parse_assembly_filereads withutf-8-sig, and a label line is now recognized after stripping//,;,#comments) plus one test intests/rdna2_tools_check.py. No CMake changes, clean-room.Commands executed locally:
python3 -I tests/rdna2_tools_check.py -k test_parse_assembly_file_skips: PASSpython3 tests/docs_links_check.py: PASS (18 files, 387 links)python3 tests/bidi_controls_check.py: PASSgit diff --check origin/main...HEAD: cleanpython3 x2w_pipe.py win2025 1986 --wait 900: Debug 80/80 and Release /O2 80/80 passedgh pr checks 1986: Linux, Windows and gfx1013 fixtures all pass; no merge conflicts with mainMutations (both killed by the new test, then reverted):
utf-8-sigback toutf-8: the BOM assertion fails.stripped.endswith(":"): the commented-label assertion fails.P1: 0. P2: 0.
AI-assisted; commands listed were executed locally.