Skip to content

keep an unknown GPU memory limit out of the history - #48

Merged
JamesLinYJ merged 1 commit into
mainfrom
cursor/gpu-unknown-memory-history
Nov 9, 2026
Merged

JamesLinYJ merged 1 commit into
mainfrom
cursor/gpu-unknown-memory-history

Conversation

@JamesLinYJ

Copy link
Copy Markdown
Owner

Summary

AdapterHistory::push treated a missing or zero GPU memory limit as 0% usage. memory_percentage still returns that clamp for the meter placeholder, but the history no longer stores it.

  • A dedicated or shared sample whose limit is None or 0 leaves the previous history point in place.
  • A later sample with a non-zero limit and real 0 usage still pushes 0%.
  • memory_percentage is unchanged, including memory_percentage(1, None) == 0 and memory_percentage(1, Some(0)) == 0.

Test

unknown_memory_limit_does_not_advance_history seeds a real dedicated and shared point, checks that usage with no limit and usage with a zero limit do not move either series, then checks that a real zero with a real limit does.

This environment cannot compile the Windows resource script (llvm-rc is not installed), so cargo test did not run here. cargo fmt --all -- --check passed.

Open in Web Open in Cursor 

A missing or zero dedicated or shared limit is not measured 0% usage.
Leave the previous history point, and still record a real zero once a
non-zero limit is available.

Co-authored-by: jameslincn <jameslincn@outlook.sg>
@chatgpt-codex-connector

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

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T06:02:36.712130Z 7aa8118 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.

@JamesLinYJ
JamesLinYJ merged commit b63061a into main Nov 9, 2026
3 checks passed
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.

2 participants