GPU-SPIRV-AS-DIAGNOSTICS: Preserve spirv-as diagnostics containing undecodable bytes #1839
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!1839
Loading…
Reference in a new issue
No description provided.
Delete branch "gpu-spirv-as-diagnostics"
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?
Pull request successfully merged and closed
Claimed in the coordination issue as: GPU-SPIRV-AS-DIAGNOSTICS
Claim: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7163027205
Use UTF-8 for external helper shader assembly and escape undecodable output bytes. A synthetic assembler emitting an invalid byte previously lost its diagnostic; the new regression test checks that the original message remains visible.
Targeted checks on Windows: python -m unittest discover -s tests -p test_run_gpu_tests_python_assembler.py and git diff --check. No game files. AI-assisted (Codex).
Tested
65c673e3fon Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), againstmain384abe5b0(GPU tooling; no GPU run):python3 -I tests/test_run_gpu_tests_python_assembler.py: OK at this head; the same file onmainerrors 1 — the undecodable-byte diagnostic case is the new coverage.spirv-asemitting invalid bytes; the regression uses a synthetic assembler. The defaultllvm-mc/spirv-aspaths are unaffected by the change.AI-assisted; synthetic fixtures only, no game data.
Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main.
python -m pytest -q tests/test_run_gpu_tests_python_assembler.py:(AI-assisted test run; output checked by hand.)
Verified by OreoFR
4a54aedcb+ PR head65c673e3fpython -I tests/test_run_gpu_tests_python_assembler.pyAI-assisted (Claude Code, Claude Opus 5.5).
Independent verification on Windows 11 (
10.0.26200, x64) with65c673e3femerged ontoorigin/main(53b77df14f,0merge conflicts), tested under bothPython 3.12.10andPython 3.14.5:origin/mainscripts/run_gpu_tests.py+#1839tests/test_run_gpu_tests_python_assembler.py):python -I -B tests/test_run_gpu_tests_python_assembler.py:Ran 11 tests,FAILED (failures=1)on bothPython 3.12.10andPython 3.14.5.cp1252(python -Iwithout UTF-8 mode), an unassignedcp1252byte onspirv-asstderr (b"diag \x81\x8d") is even worse onorigin/main:subprocess._readerthreadraisesUnicodeDecodeError: 'charmap' codec can't decode byte 0x81, leavingp.stderr = Noneand crashingp.stderr.strip()withAttributeError.65c673e3femerged ontoorigin/main):python -I -B tests/test_run_gpu_tests_python_assembler.py:Ran 11 tests,OKon bothPython 3.12.10(2.15 s) andPython 3.14.5(2.11 s).b"diag \x81\x8d"on stderr,spirv_as()now cleanly raisesRuntimeErrorcontainingdiag \x81\x8dwith no_readerthreadexception.git diff --check,python -I -m compileall -q, andpython -I scripts/check_no_game_data.pyexited0, andgit merge-treewith#1966is clean (0conflicts).AI-assisted.
Merged. Tested by @OreoFR on head 65c673e3f (CPU only (python tool)): red: 1 failure (byte replaced by U+FFFD); green 11 OK. Correction: no CI check run or commit status exists for this head, so CI did not validate it. My earlier sentence about red jobs was wrong. Thanks @delysidemanYT1!
AI-assisted: yes