Skip to content

shader: decode the RDNA 2 scanner's CLI output as UTF-8 - #845

Merged
R0Y00 merged 1 commit into
R0Y00:mainfrom
lukaslw-lab:shader/rdna2-scanner-utf8
Nov 23, 2026
Merged

R0Y00 merged 1 commit into
R0Y00:mainfrom
lukaslw-lab:shader/rdna2-scanner-utf8

Conversation

@lukaslw-lab

Copy link
Copy Markdown
Contributor

Change

test_cli_scanner runs tools/scan_unsupported_shaders.py with PYTHONIOENCODING=utf-8 and decodes its output as UTF-8, instead of text=True in the locale encoding. With PYTHONIOENCODING=utf-8 on a non-UTF-8 Windows code page, the scanner printed its block progress bar as UTF-8 and the test failed to decode it (stdout was None). The test now also requires \N{FULL BLOCK}, so it always covers that output. Test-only; the scanner is unchanged. Fixes #844.

#704 and #531 also edit tests/rdna2_tools_check.py, but not test_cli_scanner.

Verification

Commit 68d849a on Windows 10 22H2 (build 19045, ANSI code page 1250), Python 3.13.7.

$env:PYTHONIOENCODING = '<value>'   # or PYTHONUTF8=1
python -B tests/rdna2_tools_check.py TestRdna2Scanner.test_cli_scanner
Caller environment Base (b358dc1) This change
PYTHONIOENCODING unset OK OK
PYTHONIOENCODING=utf-8 FAILED (errors=1) OK
PYTHONIOENCODING=utf-8:surrogateescape FAILED (errors=1) OK
PYTHONIOENCODING=cp1252 OK (ASCII bar) OK
PYTHONUTF8=1 OK OK
ctest --preset dev --no-tests=error -R '^rdna2_tools_check$'

100% passed, both with PYTHONIOENCODING=utf-8:surrogateescape and with it unset. The whole file runs 72 tests: OK (skipped=1) both ways; the skip is test_llvm_comparison (LLVM_LIB not set). Not run: Linux or macOS. There the locale is usually UTF-8 already, and the test now sets the child's encoding itself.

Evidence and follow-up

Synthetic assembly input already in the test; no new fixture. Negative control: the base fails both UTF-8 rows above. The other text=True calls in the file run disasm_rdna2.py and extract_shaders.py, which print only ASCII, so they are unchanged.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted: prepared with Claude Code; the commands and results above were run on the author's PC.

🤖 Generated with Claude Code

test_cli_scanner ran the scanner with text=True, so the parent decoded
in the locale encoding. With PYTHONIOENCODING=utf-8 on a non-UTF-8 code
page the scanner prints its block progress bar as UTF-8 and the decode
failed, leaving stdout None. Run the scanner with PYTHONIOENCODING=utf-8
and decode as UTF-8, and require the block character so the test always
covers that output.

Fixes R0Y00#844

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@R0Y00
R0Y00 merged commit e97090a into R0Y00:main Nov 23, 2026
5 checks passed
@lukaslw-lab
lukaslw-lab deleted the shader/rdna2-scanner-utf8 branch November 23, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rdna2_tools_check: test_cli_scanner fails when PYTHONIOENCODING=utf-8 on a non-UTF-8 code page

2 participants