Repository navigation
tooling: skip BOM and commented labels in scan_unsupported_shaders assembly parsing - #1986
Merged
Merged
Conversation
…sembly parsing parse_assembly_file kept a UTF-8 BOM on the first line (so a file written by Windows PowerShell 5 reported '\ufeffs_endpgm' as an unknown opcode) and kept llc-style labels with a trailing comment such as 'pixel: ; @pixel' as opcodes. Open with utf-8-sig and test for a bare label after stripping the comment, using the same comment rule as extract_opcode.
tedin7
reviewed
Nov 24, 2026
tedin7
left a comment
Collaborator
There was a problem hiding this comment.
Review of head 24e5a1714f3bad5a0d7405a5d5a2f9b2120d587c.
Diff: tools/scan_unsupported_shaders.py (parse_assembly_file reads with utf-8-sig, and a label line is now recognized after stripping //, ;, # comments) plus one test in tests/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 main
Mutations (both killed by the new test, then reverted):
utf-8-sigback toutf-8: the BOM assertion fails.- Label check back to
stripped.endswith(":"): the commented-label assertion fails.
P1: 0. P2: 0.
AI-assisted; commands listed were executed locally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.