Skip to content

Tests: pin the preset GPU selection the way #19154 keeps it - #19237

Merged
danielhanchen merged 1 commit into
mainfrom
ci/preset-keeps-gpu-selection
Nov 24, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci/preset-keeps-gpu-selection

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Problem

tests/studio/test_chat_preset_load_config.py::test_apply_skips_missing_load_config fails on main in Repo tests (CPU, studio). Open PRs inherit it, for example #19141, which only touches the CLI:

assert 'selectedGpuIds: store.selectedGpuIds' in '// SPDX-License-Identifier: ...

Cause

#19154 (keep the custom chat template when applying a chat preset) is correct. applyPresetLoadConfig used to start from DEFAULT_PER_MODEL_CONFIG and list the store fields a preset keeps (selectedGpuIds: store.selectedGpuIds, the MLX and engram knobs). It now starts from currentRuntimePerModelConfig(), so a preset changes only its own fields. That config returns selectedGpuIds: s.selectedGpuIds, so the GPU selection is still kept.

The test pinned the old spelling rather than the behavior.

The frontend test #19154 added, preset-keeps-chat-template.test.ts, has a gap of its own. It checks that every non-preset field is unchanged, but it sets selectedGpuIds: null, which is the default. A preset that cleared the GPU selection still passed it.

Fix

  • test_apply_skips_missing_load_config now checks the mechanism:
    • applyPresetLoadConfig spreads currentRuntimePerModelConfig();
    • that config carries the store's selectedGpuIds;
    • the preset body never names selectedGpuIds itself.
  • preset-keeps-chat-template.test.ts sets a real selection ([1, 0], physical indexes), so its unchanged-fields loop actually covers the GPU selection.

Verification

  • test_chat_preset_load_config.py: fails on main, 16 passed here.
  • preset-keeps-chat-template.test.ts: 6 pass.
  • Sabotage, both tests fail in each case:
    • starting the preset from DEFAULT_PER_MODEL_CONFIG again;
    • adding selectedGpuIds: null to the preset.
  • With that second sabotage, the original frontend test still passes (6 pass, 0 fail). That shows the gap this closes.

#19154 made applyPresetLoadConfig start from currentRuntimePerModelConfig()
instead of listing the store fields a preset keeps, so
test_apply_skips_missing_load_config, which looked for the literal
"selectedGpuIds: store.selectedGpuIds", fails on main. Check the mechanism
instead: the preset spreads the current config, that config carries the
store's selectedGpuIds, and the preset never names selectedGpuIds.

The behavioral test #19154 added set selectedGpuIds to null, the default,
so a preset that cleared the selection still passed it. Give it a real
selection.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 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-24T10:22:16.141849Z 4f879f4 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: Didn't find any major issues. Another round soon, please!

Reviewed commit: 4f879f45fb

ℹ️ 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 72ff3eb into main Nov 24, 2026
2 of 43 checks passed
@danielhanchen
danielhanchen deleted the ci/preset-keeps-gpu-selection branch November 24, 2026 10:24
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