fix: resolve 6 bug bash issues (#228 #229 #230 #231 #232 #233)#246
Merged
Conversation
- fix #228: replace non-ASCII arrow (U+2192) with ASCII -> in capability and rewrite-rule descriptions so winml optimize --help works on cp1252 terminals (graph.py, layernorm.py, surgery.py, rewrite_rules.py) - fix #231: convert debug print() statements in QDQGenerator to logger.debug() to stop stdout pollution during winml analyze - fix #229: winml sys --list-device --list-ep --format json now emits a single valid JSON object {devices, executionProviders} instead of two separate arrays - fix #232: winml sys --list-device/--list-ep --format compact now produces compact single-line output instead of silently falling back to text format; also remove dead _output_device_json/_output_ep_json - fix #230: add stderr=subprocess.DEVNULL to all PowerShell subprocess calls in sysinfo/helper.py to prevent error noise leaking to terminal when no NPU is present - fix #233: change Text/column overflow from 'ellipsis' to 'crop' in hub list view to avoid emitting U+2026 (ellipsis char) on cp1252 terminals Tests: add regression coverage for all 6 fixes
chinazhangchao
approved these changes
Apr 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes 6 issues found during bug bash testing on the main branch.
winml optimize --helpcrashes withUnicodeEncodeErroron Windows cp1252 terminals: replaced U+2192→with ASCII->in all capability/rewrite-ruledescriptionstrings (graph.py,layernorm.py,surgery.py,rewrite_rules.py)QDQGeneratordebugprint()statements pollute stdout duringwinml analyze --run-unknown-op: converted all bareprint()calls tologger.debug()inqdq_gen.pywinml sys --list-device --list-ep --format jsonemits two separate JSON arrays (invalid JSON): restructured to emit a single object{"devices": [...], "executionProviders": [...]}and removed the now-dead_output_device_json/_output_ep_jsonhelperswinml sys --list-device --format compactsilently ignores--format compactand falls back to text: added a compact output path that prints a single line per flagstderr=subprocess.DEVNULLto all foursubprocess.check_outputcalls insysinfo/helper.pywinml hublist table usesoverflow="ellipsis"which emits U+2026…(unrepresentable in cp1252): changed tooverflow="crop"on bothTextobjects and table columnsTests added
tests/regression/test_design_gaps.pyTestA1HelpTextAsciiSafe(3 tests)--help,--list-capabilities,--list-rewritesoutput is ASCII-safetests/unit/analyze/core/test_qdq.pytest_initialization_does_not_print_to_stdoutQDQGenerator.__init__writes nothing to stdouttests/unit/commands/test_hub.pytest_fmt_model_id_overflow_is_ascii_safe_fmt_model_idusesoverflow="crop"tests/unit/commands/test_cli.pytest_sys_list_device_list_ep_json_is_valid_single_objecttests/unit/commands/test_cli.pytest_sys_list_device_compacttests/unit/commands/test_cli.pytest_sys_list_ep_compactAll 3947 tests pass (120 skipped for NPU/hardware requirements).