Skip to content

Name the encoding on the sd.cpp nvidia-smi probe - #18295

Merged
danielhanchen merged 1 commit into
mainfrom
ci/sd-cpp-nvidia-smi-encoding
Nov 18, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci/sd-cpp-nvidia-smi-encoding

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Name the encoding on the sd.cpp nvidia-smi probe

studio/backend/tests/test_text_io_encoding.py::test_text_io_names_its_encoding[sd_cpp_backend.py] fails on main since #18210. On staging it shows up as (Python 3.13, rest) failing on unrelated PRs, for example #17694 and #18275:

E       sd_cpp_backend.py:3146: subprocess(text = True) without encoding
E   assert not ['sd_cpp_backend.py:3146: subprocess(text = True) without encoding']

Cause

#18210 added _sole_nvidia_card_mib(), which reads nvidia-smi's output with subprocess.run(..., text = True) but no encoding. That falls back to locale.getencoding(), the ANSI codepage on Windows, which is exactly what this lint exists to catch.

The other three subprocess.run(text = True) calls in sd_cpp_backend.py already pass encoding = "utf-8", errors = "replace". The new probe just missed it.

Fix

The probe now passes encoding = "utf-8", errors = "replace" like its neighbours. nvidia-smi's CSV output is ASCII, so what the probe parses does not change. A stray byte can no longer raise inside the probe.

Verification

  • tests/test_text_io_encoding.py: fails on main on this line and passes with this change.
  • tests/test_sd_cpp_backend.py also passes: 1289 passed across both files.
  • ruff is clean.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T09:52:26.695772Z 46c5c32 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-18T09:51:49.405065Z
We couldn’t complete this review. Comment @codex review to try again.
46c5c32 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 46c5c327fc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit b73c7c1 into main Nov 18, 2026
@danielhanchen
danielhanchen deleted the ci/sd-cpp-nvidia-smi-encoding branch November 18, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant