Handle non-UTF-8 program output in the native case runner
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- devtools, testing-qa
Research direction
Start by examining the subprocess handling in tools/run_tests.py (classify_program) and tools/process_tree.py. The reproduction script shows how to trigger the UnicodeDecodeError. The goal is to modify the output decoding to handle arbitrary bytes gracefully, ensuring test reports are still generated. Run the provided reproduction to verify the fix.
Written by the indexing model from the issue text.
Description
Problem
The native runner uses text-mode subprocess output without a robust decoding policy. A successful program that writes arbitrary bytes can raise UnicodeDecodeError, aborting the suite before its report is written.
Start in classify_program in tools/run_tests.py and its subprocess handling in tools/process_tree.py.
Reproduction
Run this focused runner reproduction from the repository root:
import sys
from tools import run_tests as r
metadata = r.parse_test_metadata("tests/cases/shared/test1.wave")
r.classify_program(
"binary-output", "tests/cases/shared/test1.wave",
[sys.executable, "-c", "import sys; sys.stdout.buffer.write(bytes([255]))"],
metadata, None,
)
Save it as /tmp/repro.py, then run PYTHONPATH=. python3 /tmp/repro.py. Replace sys.stdout with sys.stderr to exercise the other stream.
Tested at 01955d715dda275de993948037091140bb859174 on Fedora Linux 43, x86_64, with Python 3.14.
The child exits 0, but either stream makes the runner raise:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
A Wave program writing a u8 value of 255 through io_write_all also compiles and exits 0 at O0/O2, emitting ff. This is an output-handling issue, separate from string escapes (#599) or manifest input decoding (#688).
Completion criteria
- Define a robust decoding policy for runtime stdout/stderr and retain bounded JSON diagnostics.
- Binary output on either stream does not raise or prevent report generation.
- Nonzero exits and artifact failures are still classified correctly; ordinary UTF-8 output is preserved.
- Keep source and manifest input decoding strict.
Difficulty: easy.
- Dominant language
- Rust
- Stars
- 56
- Forks
- 21
- Avg merge
- 3h 24m
- Merged PRs (30d)
- 52
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from wavefnd/Wave
-
enhancement good first issue needs testing
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
enhancement good first issue needs testing
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug ci good first issue needs testing
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug good first issue needs testing
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug good first issue os compatibility
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
BurntSushi/jiff#653 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ZcashFoundation/zeeder#106 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
oxidize-rb/rb-sys#807 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
todo:ticket
Difficulty 2/5 1-2 days Newbie friendliness 74/100