Repository navigation
bvh_tri_probe: name a --json directory as typed, not through repr() - #6708
Conversation
repr() quotes the path and doubles every backslash on Windows, while the write-error line below it already prints the path as typed.
Fails on the previous commit: repr() turned C:\\Users\\...\\tmp into 'C:\\\\Users\\\\...\\\\tmp'.
… as '' With the path echoed as typed, a blank value would leave a gap in the message; say (empty) instead.
|
Tested
|
|
Independent Windows CPU verification (Python 3.14.3, Windows 11 Build 26300, head
Clean and ready to merge. AI-assisted. |
shayderrr
left a comment
There was a problem hiding this comment.
Summary
tools/bvh_tri_probe.py changes the --json path diagnostic from {args.json_out!r} to {args.json_out.strip() or '(empty)'}. repr() doubled every Windows backslash; a blank value now prints (empty). Tests assert the exact one-line messages for a directory path and whitespace-only input.
Why merge
The error names the path the user actually typed and stays readable on Windows, matching the tool's other diagnostics.
Verdict: Approve
Summary
Why mergeThe error names the path the user actually typed and stays readable on Windows, matching the tool's other diagnostics. Verdict: Approve |
ItsNotRexed#6708 added two --json tests at the same spot in tests/test_bvh_tri_probe.py. Both blocks stay; 18 tests pass.
EGEN-BVHTRIPROBE-JSONPATH
tools/bvh_tri_probe.pyrefuses a--jsonvalue that is a directory (or blank) withThe
repr()there quotes the path and doubles every backslash on Windows, while the write-error line 10 lines below (error: cannot write --json {args.json_out}: ...) already prints the path as typed. The guard now echoes the value as typed, and says(empty)for a blank one instead of a pair of quotes.Test
tools/bvh_tri_probe.pyas onmain(the two new cases present, the tool not yet changed):FAILED (failures=2), bothtest_json_directory_is_named_as_typedandtest_json_empty_is_a_named_error.Ran 17 tests in 0.700s,OK.No GPU needed: CPU-only unit tests; the hardware path is covered with a stand-in oracle.
Notes
(empty)rather than nothing for a blank value: echoing a blank path as typed would leave a double space in the message. A whitespace-only value is treated like an empty one, which is what the guard already did withnot args.json_out.strip().--write-kernelswrite path in the same file); this changes only the--jsonargument guard and adds its two cases.AI-assisted.