Skip to content

Studio: computer use sends Qwen3.x a larger screenshot of a large screen; Nemotron Bolt points on the grid - #18188

Open
danielhanchen wants to merge 2 commits into
mainfrom
studio-computer-use-4k-screenshots
Open

danielhanchen wants to merge 2 commits into
mainfrom
studio-computer-use-4k-screenshots

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Issue #18137: will fix.

On a 4K screen, computer use clicks miss by hundreds of pixels. Two separate causes:

  1. Studio shrinks every screenshot to 1008 px on its long edge. On 3840x2160 that leaves icons and small buttons 4 to 13 px wide in the picture the model sees. The coordinate mapping itself is exact (Gemma 4 26B and Qwen3.8 27B both hit 16 of 16 large labelled buttons on a 4K screen at 1008 px, median miss 4 to 9 px); the model just cannot see small targets.
  2. Nemotron 3.5 Bolt answers on the 0 to 1000 grid, but Auto reads its answers as screenshot pixels. With large labelled buttons it hits 0 of 32 as pixels and 32 of 32 as grid points.

This PR:

  • Sends local Qwen3-VL and Qwen3.5+ models a screenshot at half the captured screen's size, between 1008 and 2016 px. A 4K screen goes out at 1904x1064; screens up to 2016 px wide (1080p and smaller) are unchanged.
  • Adds Nemotron 3.5 Bolt (the 74B-A9B and the Gemma 4 based E4B) to the grid families.

Measurement

Studio's own code built each picture on both sides: each tree's screen.take, envelope and the shared image decoder, then Studio's exact computer tool definition, tool result text and zoom action (up to 4 turns, as in a chat). UD-Q4_K_XL GGUF with the BF16 mmproj on Studio's prebuilt llama.cpp (b12347, cuda13-older on a Colab A100), temperature 0, grid mode. Real targets: 30 4K desktop screenshots from ScreenSpot-Pro (Windows and Linux "common" sets, targets 14 to 50 px on screen). Buttons: 32 screens of 12 labelled buttons (16 at 3840x2160, 16 at 1920x1080). A hit is a click inside the target.

Model Set Before (1008 px) After (1904 px on 4K) Paired change, 95% bootstrap CI
Qwen3.8-27B real 4K targets, hits 4/30 (median miss 161 px, zoomed 22 times) 16/30 (median miss 18 px, zoomed 9 times) +0.40 [+0.23, +0.57], 12 gained, 0 lost
Qwen3.8-27B labelled buttons 32/32 32/32 0
Qwen3.6-35B-A3B real 4K targets, hits 2/30 (median miss 293 px) 7/30 (median miss 94 px) +0.17 [0.00, +0.33], 6 gained, 1 lost
Qwen3.6-35B-A3B labelled buttons 26/32 30/32 +0.12 [+0.03, +0.25]

Size sweep on the same real targets (Qwen3.8: 30 Windows targets; Gemma 4: 15 Windows and 15 Linux):

Screenshot sent Qwen3.8 hits Gemma 4 26B-A4B within 150 px Gemma 4 on 4K labelled buttons
1008 px 4/30 2/30 16/16
1344 px 10/30 3/30 10/16
2016 px 16/30 14/30 10/16
2688 px 23/30 9/30 11/16
3840 px (full screen) not run 6/30 2/16

Gemma 4 is left at 1008 px: from about 1300 px up its clicks drift 40 to 60 px upward and it misses large buttons it hits at 1008 px, which costs more on everyday screens than it gains on tiny targets. UI-TARS is left at 1008 px because it was not measured. 2016 px is the ceiling because Qwen's per-screenshot image tokens grow with area (about 550 at 1008 px, about 2000 at 1904 px) over tasks of 100 to 200 actions.

Nemotron 3.5 Bolt 74B-A9B (the 24GB GGUF), at 1008 px:

Read as Labelled buttons Real 4K targets within 150 px
pixels (Auto today) 0/32, 15 answers outside the screenshot 0/30
0 to 1000 grid 32/32 10/30

Scope

  • Only grid answers get the larger picture. A pixels answer has to be in the pixels of the image as the model saw it, and a processor or provider that shrinks a large image again would move it.
  • Connected API providers keep 1008 px: they resize large images themselves and bill by size. The two provider paths pass provider = True to _select_request_tools.
  • Every tool image other than a computer use screenshot is still capped at 1024 px by the shared decoder, with the same call as before.

Changes

  • computer_use/screen.py: shot_edge() picks the long edge from the captured size; take() uses it when the session asks for detail. A screenshot past 1024 px carries maxEdge in its image envelope.
  • mcp_images.py: the shared decoder keeps an image up to its maxEdge, capped at MAX_SCREENSHOT_EDGE (2016).
  • computer_use/policy.py: sees_detail() (Qwen3-VL, Qwen3.5+), and Nemotron 3.5 Bolt in the grid families.
  • state/computer_use.py, computer_use/tool.py, routes/inference.py: the session asks for detail for a local model that sees_detail() and answers on the grid.

Cost on a 4K screen with a Qwen model: about 4x the image tokens per screenshot, and about 150 ms more per tool result on this host to encode the larger image (capture and resize are within 20 ms of before).

Tests

  • New in tests/test_computer_use.py: the edge per screen size, the session flag per mode, which families get detail, a local Qwen getting detail while the provider path and Gemma 4 do not, the envelope's maxEdge reaching the model whole while other images stay at 1024 px (a forged maxEdge stays capped at 2016), a local grid model seeing the virtual desktop (2560x1600) at 1260x784 with its grid click landing on the same desktop point, and Nemotron 3.5 Bolt answering on the grid. All fail on main.
  • test_computer_use.py, test_computer_use_live.py, the tool image suites (test_mcp_image*.py, test_view_image_tool.py, test_browser_agent.py, test_*_tool_images.py), the tool selection suites and the KV admission suites: 1263 passed, 8 skipped. The 3 failures in test_mcp_images.py (replay-only vision render) fail the same way on main.

@danielhanchen danielhanchen self-assigned this Nov 17, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 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-17T17:44:17.545035Z 4af60c4 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.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 4af60c4dd9

ℹ️ 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 added a commit that referenced this pull request Nov 17, 2026
…-r red since #18147) (#18197)

Two Studio tests fail on main since #18147 (`m-r` shard, seen on the
staging run of #18188, a computer-use change):

```
tests/test_multi_model_serving.py::test_a_resident_npu_model_keeps_to_the_primarys_seat
routes/inference.py:10720: in _loaded_satisfies
E   AttributeError: 'types.SimpleNamespace' object has no attribute 'answers_to'
tests/test_multi_model_serving.py::test_the_loaded_models_list_names_the_npu_model_once
E   AttributeError: 'types.SimpleNamespace' object has no attribute 'display_name'
```

## Cause

#18147 lets the API accept the NPU model name the app shows: `NpuModel`
gained `display_name` and `answers_to()`, and the routing /
loaded-models code now calls them. That is correct for the real class.
These tests stand in for the resident NPU model with a `SimpleNamespace`
carrying only the fields the code used before, so the new calls fail.

## Fix

A `_npu_model()` helper builds the real `npu_backend.NpuModel` (frozen
dataclass, `model_path` derived from `id`), and the four NPU stubs in
the file use it. The surrounding backend stubs (`is_loaded`, `resident`)
are unchanged. With the real class, a later method on `NpuModel` reaches
these tests automatically instead of breaking them.

## Verification

- main: 2 failed, 108 passed.
- this branch: `tests/test_multi_model_serving.py` 110 passed.
danielhanchen added a commit that referenced this pull request Nov 17, 2026
…_cuda (skip-guard lint red since #18192) (#18204)

`tests/python/test_accelerator_skip_guards.py::test_no_skip_guard_reads_a_spoofable_accelerator_probe`
fails on main since #18192 (CPU `studio` shard, seen on the staging run
of #18188):

```
E   AssertionError: these skip guards read a probe tests/_zoo_aggressive_cuda_spoof.py patches to True process-wide, ...
E   assert not ['test_bf16_stochastic_rounding.py:150: torch.cuda.is_available()']
```

## Cause

#18192 added `tests/test_bf16_stochastic_rounding.py`, whose
bitsandbytes case is gated on `@pytest.mark.skipif(not
torch.cuda.is_available(), ...)`. The CUDA spoof the version-compat
suites install patches `torch.cuda.is_available` to True for the whole
process, so on a CPU runner that shares a session with them the case
would un-skip and fail. The lint is right; the new guard used the
spoofable probe.

## Fix

Gate on `has_real_cuda()` from `tests/_shared/real_accelerator.py`,
which reads the device before any spoof, as the other GPU-only tests do.
The test itself is unchanged.

## Verification

- main: the lint fails with the line above.
- this branch: `tests/python/test_accelerator_skip_guards.py` and
`tests/test_bf16_stochastic_rounding.py`: 33 passed, 2 skipped (the CUDA
case on this CPU host).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant