Summary
When combining --list-device and --list-ep with --format json, winml sys prints two separate JSON arrays back-to-back instead of a single valid JSON document. Any downstream consumer calling json.loads() or json.load() fails with JSONDecodeError: Extra data.
Steps to Reproduce
winml sys --list-device --list-ep --format json
Actual Output
[
{
"priority": 1,
"type": "CPU",
"name": "AMD EPYC 7763 64-Core Processor",
...
}
]
[
{
"name": "DmlExecutionProvider",
"device": "GPU",
"path": null
},
...
]
Expected Output
A single valid JSON object, e.g.:
{
"devices": [...],
"executionProviders": [...]
}
Root Cause
src/winml/modelkit/commands/sys.py lines 617–639: the --list-device and --list-ep branches each independently call their own JSON output function, emitting two separate arrays with no wrapping structure.
Impact
Breaks scripting use cases. winml sys --list-device --list-ep --format json | python -c "import sys,json; json.load(sys.stdin)" raises JSONDecodeError.
Severity
P2
Summary
When combining
--list-deviceand--list-epwith--format json,winml sysprints two separate JSON arrays back-to-back instead of a single valid JSON document. Any downstream consumer callingjson.loads()orjson.load()fails withJSONDecodeError: Extra data.Steps to Reproduce
Actual Output
[ { "priority": 1, "type": "CPU", "name": "AMD EPYC 7763 64-Core Processor", ... } ] [ { "name": "DmlExecutionProvider", "device": "GPU", "path": null }, ... ]Expected Output
A single valid JSON object, e.g.:
{ "devices": [...], "executionProviders": [...] }Root Cause
src/winml/modelkit/commands/sys.pylines 617–639: the--list-deviceand--list-epbranches each independently call their own JSON output function, emitting two separate arrays with no wrapping structure.Impact
Breaks scripting use cases.
winml sys --list-device --list-ep --format json | python -c "import sys,json; json.load(sys.stdin)"raisesJSONDecodeError.Severity
P2