Repository navigation
Conversation
Kam471
left a comment
There was a problem hiding this comment.
Ran this at 0d062f28 on Windows 11: tests/test_subprocess_text_errors.py -> 3 tests, OK; tests/test_bary_fallback_gs.py -> 27 tests, OK; git diff --check clean.
Every text-mode child process now names errors= explicitly (the guard test scans for it), so a child's non-UTF-8 output cannot crash a tool with a decode traceback. No blocking issue.
|
Independent Windows check of I exercised the actual changed |
|
Automated test:
Same machine and setup as my earlier manual reports. AI-assisted (Claude Code). |
|
Rebased onto
AI-assisted (Claude Code). |
0d062f2 to
9e865f9
Compare
|
Tested 9e865f9 merged onto main 98fa503 on an RTX 5090 (driver 616.92), Windows 11, Vulkan SDK 1.4.363. The GPU test programs were built from the same tree:
AI-assisted (Claude Code). |
|
Tested 9e865f9 merged with main 594f348 on Linux (WSL Ubuntu, Python 3.12.16) and native Windows (Python 3.13.1): pass
|
|
Tested Scope: the 32-wide half only (NVIDIA Volta). The AMD / 64-wide half still needs someone with an AMD GPU. (This PR has no GPU-specific code. I ran the GPU suite because it edits the runner and fixture build.) Setup: the PR diff applied to
No game files. AI-assisted (Claude Code); I ran the commands above and checked the numbers against the logs. |
|
Tested 9e865f9 on Windows 11 (MSVC BuildTools 2022, Ninja, RelWithDebInfo, -j 4; no Vulkan validation layer installed), one GPU at a time, device line confirmed: AMD Radeon RDNA2 iGPU (driver 26.10.1) and NVIDIA RTX 5080 (driver 616.92). Ran the full AI-assisted. |
|
Verified #4426 on a different setup than the one in the description. Environment: Windows 11 26200, Python 3.13.13 (not 3.15.2), AMD Radeon 860M Before (main 3faac55): runtime/test/shaders/build.py on its own dies at line 143 with After (your branch, build-1265-subprocess-errors): build.py runs to completion, tests/test_subprocess_text_errors.py: 3 tests OK. scripts/run_gpu_tests.py --build with the patch, on the same 860M:201/217 passed, 16 skipped, 0 failed, and no decode tracebacks in the run. (16 skips: 15 are "SKIP (run by d3d12_*_test)", 1 is ps_w64x_readlane on a 32..64 subgroup device.) One note: the guard test needs the tree to be a git checkout ("git ls-files"); in a No game files. AI-assisted. |
|
Tested
|
|
Non-blocking follow-up for Separately, a synthetic-child comparison of the SDK probe’s subprocess options preserved valid output and exit status, and replaced invalid UTF-8 on both stdout and stderr instead of raising. This was a focused Linux check, not a Windows/GPU or full-suite run. No game files. AI-assisted. |
|
@nanyoudegege Good catch, thanks. Fixed in |
|
One more non-blocking question on In a focused Linux Python 3.12.14 test with synthetic child processes and an explicitly selected CP1252 codec, the UTF-8 bytes for the entry-point name |
|
@nanyoudegege Agreed, done in |
|
Re-tested the current head
AI-assisted (Claude Code). |
|
Tested I merged the head onto
The status of each test (pass or skip) is the same as on
Correction (added later): in the AMD column of the |
|
Tested 0fa5dac on Intel UHD 630 (Coffee Lake GT2), Mesa 25.2.8 ANV, Ubuntu 24.04: the full build succeeds, and test_subprocess_text_errors (4 tests), test_run_gpu_tests (41) and test_bary_fallback_gs (28) pass. The full GPU suite with LEONIDA_VK_DEVICE=Intel gives 154/217 passed, 61 skipped, with only cs_fmt_int_narrow and cs_signed_zero_nan failing, the same counts and failures as the recorded main 3faac55 run on this GPU. cs_barrier_early_end passes 1/1 on Intel and fails with "no Vulkan physical device matches" under a nonexistent device name, so the filter applied. AI-assisted. |
|
Rebased onto Rebase. Main's newer code had changed the same
Tests:
AI-assisted (Claude Code). |
…d here In text mode CPython decodes captured output on the reader threads. A byte that isn't UTF-8 there loses that stream: a console-code-page warning on stderr came back as None, and a bad stdout left text None, so the version regex raised a TypeError that hid the cause (@nanyoudegege on ItsNotRexed#4426, CP936). spirv-dis now runs in binary mode. Its stdout is decoded as strict UTF-8 on the caller's thread, and a failure exits 2 with "spirv-dis output is not UTF-8", plus spirv-dis's stderr with errors="replace". spirv-as keeps its strict UTF-8 stdin. test_cli_reports_disassembly_that_is_not_utf8 runs a stand-in spirv-dis through SPIRV_DIS (non-UTF-8 stdout, a CP936 warning on stderr). It fails before this change with the traceback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0fa5dac to
c33d23f
Compare
shayderrr
left a comment
There was a problem hiding this comment.
Review
Reviewed test coverage in PR #4426: Text-mode child processes decode with errors="replace", plus a guard test (BUILD-1265).
Scope: make_game.py, runtime/test/shaders/build.py, runtime/test/shaders/check.py, +31 more
Diff: +232 / -75 across 34 file(s).
The change stays inside the stated scope and the touched files line up with the description. No unrelated production paths are pulled in, and the stated behavior is directly exercised by the diff. I'm approving this one.
Reviewed by shayderrr via automated batch review.
|
Thanks @mrp1no - I went through Text-mode child processes decode with errors="replace", plus a guard test (BUILD-1265) and the diff around |
|
Tested c33d23f (trial-merged onto main 561b65a) on NVIDIA GeForce RTX 5090 (610.88, subgroup 32..32) and AMD Radeon iGPU (RDNA2, AMD 32.0.21036.18, subgroup 32..64), Windows 11 Pro 26200: pass.
No game files. AI-assisted. |
|
Rebased onto Two new commits:
Tests against a
AI-assisted (Claude Code). |
c33d23f to
51b0fed
Compare
…d here In text mode CPython decodes captured output on the reader threads. A byte that isn't UTF-8 there loses that stream: a console-code-page warning on stderr came back as None, and a bad stdout left text None, so the version regex raised a TypeError that hid the cause (@nanyoudegege on ItsNotRexed#4426, CP936). spirv-dis now runs in binary mode. Its stdout is decoded as strict UTF-8 on the caller's thread, and a failure exits 2 with "spirv-dis output is not UTF-8", plus spirv-dis's stderr with errors="replace". spirv-as keeps its strict UTF-8 stdin. test_cli_reports_disassembly_that_is_not_utf8 runs a stand-in spirv-dis through SPIRV_DIS (non-UTF-8 stdout, a CP936 warning on stderr). It fails before this change with the traceback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…="replace" (BUILD-1265) A text-mode subprocess call decodes with errors="strict". When a child prints bytes the code page can't decode (a localized Windows console message in the OEM code page, wsl.exe's UTF-16LE errors, a path in another encoding), the output is lost: on POSIX run() raises UnicodeDecodeError; on Windows capture_output reads through threads, the reader thread dies with a traceback and stdout comes back as None with no exception in the caller. make_game.py (dotnet --list-sdks, the two vk_subgroup_info probes, the rpf9-explorer pin, the runtime probe), scripts/run_gpu_tests.py, scripts/bench_wave64.py and runtime/test/shaders/ (build.py, check.py, w64_graphics.py) now pass errors="replace", as make_game's other calls already did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The same change for the tools that run llvm-mc, spirv-as/spirv-val, vk_compute_test and other children in text mode: the fuzzers (crosslane, lds, valu, image, valu_int_diff), ps_oracle, the hw_oracle runner and DRM probe, ab_control_flow, cf_diff, spirv_gs_to_compute, bary_fallback_gs, fma_mix_probe, isa_coverage, mesh_compute_vs, probe_gfx1036_vcmp16, turing_atlas, bink_index, bvh_gpu_smoke, gen_gdk_runtime_classes, sandbox and rdna2spirv's assembler call; mc_command.run forwards the keyword to subprocess.run. tools/shader_disasm.py is left to ItsNotRexed#4395 (BUILD-1245), which fixes it with its own test. tests/test_bary_fallback_gs.py's stand-in subprocess.run functions take the new keyword. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…D-1265) test_subprocess_text_errors.py parses the tracked Python under tools/, scripts/, make_game.py and runtime/test/shaders/ with ast and fails on a run/check_output/Popen/call/check_call call that decodes text (text= or universal_newlines= not False, or encoding=) without errors=. A negative control checks that the checker flags exactly the calls missing it, and a third test shows what is at stake: a child printing 0x8a (an OEM code-page letter) comes back replaced with errors="replace", and is lost without it (UnicodeDecodeError on POSIX, stdout None on Windows). tools/shader_disasm.py is skipped until ItsNotRexed#4395 lands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tracked_python() split git ls-files' text output on whitespace, so a path with a space was cut in two and a path with a non-ASCII letter (which git prints quoted) was dropped by the prefix filter: neither file was checked (@nanyoudegege's review). It now reads `git ls-files -z` as bytes and splits on NUL. A new test tracks tools/plain.py, "tools/with space.py" and tools/é.py in a scratch repository and expects all three; with the old parsing it gets ['tools/plain.py', 'tools/with']. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
spirv-dis's output is assembly source that goes back to spirv-as through stdin, and its OpEntryPoint/OpName strings are UTF-8 in SPIR-V. errors="replace" in the locale's code page could turn a non-ASCII name into other bytes on the way back (@nanyoudegege's review). Both calls now pass encoding="utf-8" and errors="strict": the text is exact, and a byte that doesn't decode is an error instead of a silent replacement. The guard test still sees an explicit errors= on both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ince (BUILD-1265) The rebase onto 561b65a brought eight new subprocess.run calls that decode child output (glslc, spirv-as, vk_harness, clang --version, glslangValidator, the ps_sweep runs, git rev-parse, the w64 graphics harness) without errors=; the guard test lists them. They only read the output for messages, so they take errors="replace" like the others. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d here In text mode CPython decodes captured output on the reader threads. A byte that isn't UTF-8 there loses that stream: a console-code-page warning on stderr came back as None, and a bad stdout left text None, so the version regex raised a TypeError that hid the cause (@nanyoudegege on ItsNotRexed#4426, CP936). spirv-dis now runs in binary mode. Its stdout is decoded as strict UTF-8 on the caller's thread, and a failure exits 2 with "spirv-dis output is not UTF-8", plus spirv-dis's stderr with errors="replace". spirv-as keeps its strict UTF-8 stdin. test_cli_reports_disassembly_that_is_not_utf8 runs a stand-in spirv-dis through SPIRV_DIS (non-UTF-8 stdout, a CP936 warning on stderr). It fails before this change with the traceback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(BUILD-1265) tools/vk_fuzz_run.py came to main after the last rebase. It reads llvm-mc, the translator and the GPU runner output only for messages and the "error:" check, so those calls take errors="replace" like the others. The guard test lists them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test came with main after the last rebase. It asserts the exact subprocess.run call of the ld.lld step in Oracle._assemble, which this PR gives errors="replace" like every other text-mode child process. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested
No game files. AI-assisted (Claude Code). |
51b0fed to
c0e750b
Compare
|
Thanks @lunarminus. Rebased again onto |
BUILD-1265 (@AirKyzzZ's finding). Claim: #4257 (comment)
A text-mode
subprocesscall (text=True,universal_newlines=Trueorencoding=) decodes witherrors="strict". When a child prints bytes the code page can't decode, the output is lost. The bytes can be a localized Windows console message in the OEM code page (cmd.exe's"non \x8a riconosciuto"in Italian),wsl.exe's UTF-16LE errors, or a path in another encoding. The failure looks different per platform, and on Windows it's quiet:run()raisesUnicodeDecodeError, so the tool dies with a traceback instead of its own error.capture_outputreads through threads. The decode error kills the reader thread, which prints a traceback to stderr, andr.stdoutcomes back asNonewith no exception in the caller. The tool then treats it as "no output". Checked here with Python 3.15.2 on Windows 11.Commits
make_game.py,scripts/run_gpu_tests.py,scripts/bench_wave64.py,runtime/test/shaders/(build.py,check.py,w64_graphics.py): 16 calls geterrors="replace".make_game.py's own five did not have it:dotnet --list-sdks, the twovk_subgroup_infoprobes, the rpf9-explorer pin and the runtime probe.tools/: the other 46 calls get the same.ps_oracle,hw_oracle,ab_control_flow,cf_diff,spirv_gs_to_compute,bary_fallback_gs,fma_mix_probe,isa_coverage,mesh_compute_vs,probe_gfx1036_vcmp16,turing_atlas,bink_indexand two inrdna2spirv.mc_command.runforwards**kwargstosubprocess.run, so its 7 calls take the keyword as-is.tools/shader_disasm.pyis left to shader_disasm: decode llvm-mc's output with errors="replace" (BUILD-1245) #4395 (BUILD-1245), which fixes it with its own test.subprocess.runintests/test_bary_fallback_gs.pytakes the new keyword.tests/test_subprocess_text_errors.py, a stdlib guard. It parses the tracked Python undertools/,scripts/,make_game.pyandruntime/test/shaders/withast, and fails on arun/check_output/Popen/call/check_callcall that decodes text withouterrors=.0x8a: witherrors="replace"that byte comes back as U+FFFD; without it the output is lost (an exception, orNoneon Windows).shader_disasm.pyuntil shader_disasm: decode llvm-mc's output with errors="replace" (BUILD-1245) #4395 lands; that one line can go then.All 62 edits are the same insertion, made with
astright after the existing text-mode keyword, so nothing else changes.compileallis clean.The guard is scoped to code that runs on the user's machine.
tests/has about 450 more such calls, but they decode our own Python children's output; changing them would touch dozens of open PRs.Tested (Windows 11, Python 3.15.2)
pytest tests --ignore=tests/semantic -n 10: 6,450 passed. The 8 failures are the onesmainhas on this machine, each with an open fix:test_build_llvm_mc_batch(tests: start _build.cmd as .\_build.cmd in the two batch-writer tests #3380),test_meta_to_xml_paths(Write metadata conversion failure reports as UTF-8 #3344),test_check_no_game_data(tests: test_check_no_game_data cleans up its git repository on Windows #3897) andtest_u16_high_half(rdna2spirv: declare the format-size table's constants with the rest of them #4071).main: fails and lists all 62 calls.scripts/run_gpu_tests.py --filter textureon an RTX 3060 (NVIDIA 610.88): 6/6 passed with the edited runner and fixture build.No game files. AI-assisted (Claude Code).
🤖 Generated with Claude Code