Skip to content

fix(macos): separate launcher bundle identity from desktop - #18076

Merged
danielhanchen merged 2 commits into
unslothai:mainfrom
bezabyte:codex/issue-18054-launcher-bundle-id
Nov 17, 2026
Merged

danielhanchen merged 2 commits into
unslothai:mainfrom
bezabyte:codex/issue-18054-launcher-bundle-id

Conversation

@bezabyte

Copy link
Copy Markdown
Contributor

Summary

Verification

  • python -m pytest -q tests/studio/test_macos_app_native_arch.py (4 passed, 2 skipped: Rosetta-only tests)
  • sh -n install.sh scripts/uninstall.sh
  • git diff --check

The broader tests/sh/test_uninstall_webview_data.sh suite was also exercised; it reported 83 passed and 3 environment-sensitive failures in pre-existing custom-root/TMPDIR cases unrelated to bundle identifiers.

@danielhanchen danielhanchen self-assigned this Nov 17, 2026
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@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-17T06:39:10.036678Z cf018bb 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. Keep it up!

Reviewed commit: cf018bb4ba

ℹ️ 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
…oth.kernels loaded on CPU since #18111) (#18117)

Two CPU-backend tests fail on main in the CPU `rest` shard since #18111
(seen on the staging runs of #18075 and #18076):

```
tests/test_cpu_backend_init.py::test_no_accelerator_loads_the_cpu_backend
tests/test_cpu_backend_tiled_mlp.py::test_cpu_backend_loader_tiles_like_the_gpu_loaders
E   AssertionError: assert ['unsloth.kernels', ...] == []
```

## Cause

#18111 added, at the end of `unsloth/__init__.py`:

```python
from .kernels.triton_launch import sync_compile_cache_tag_to_workers as _sync_tag
```

It runs for every backend. On a machine with no accelerator, `import
unsloth` now loads `unsloth.kernels` (and everything its package
`__init__` pulls in, 87 modules) even though the CPU backend
deliberately never loads GPU kernels; the tests above guard exactly
that.

The sync itself is right, but it only matters where kernels add tags to
`torch.compiler.config.cache_key_tag`, i.e. the GPU backend, which has
already imported `unsloth.kernels` by then. On the CPU backend there is
no tag to hand to compile workers.

## Fix

Run the sync only when the GPU backend was selected (`_IS_CPU_BACKEND`
is False). The MLX branch never defines `_IS_CPU_BACKEND`, so it is
skipped there too.

## Verification

- `tests/test_cpu_backend_init.py`,
`tests/test_cpu_backend_tiled_mlp.py`: 2 failed on main, pass here.
- `tests/test_compile_cache_tag_workers.py` (#18111's own tests): 6
passed.
danielhanchen added a commit that referenced this pull request Nov 17, 2026
…ys fp32 (red since #18099) (#18118)

`tests/test_attention_dispatch_compiled_block.py::test_rerouted_xformers_keeps_the_fp32_downcast`
fails on main in the CPU `rest` shard since #18099 (seen on the staging
runs of #18075 and #18076):

```
E   assert torch.float32 == torch.bfloat16
```

## Cause

#18099 made fp32 Q/K/V with autocast off stay fp32 (rerouted to SDPA)
instead of being downcast to bf16 for xformers / flash, because that is
a genuine fp32 model. The DoRA downcast still applies under autocast,
which is how DoRA reaches this code in training. #18099 moved its own
DoRA tests under autocast, but this compiled-path test in another file
still called the reroute with plain fp32 inputs and no autocast, so it
now sees the intended fp32 result.

The behaviour change is correct; the test predates it.

## Fix

- `test_rerouted_xformers_keeps_the_fp32_downcast` now takes the
autocast decision (`_keeps_fp32_attention` returns False), so it still
checks the DoRA downcast through the compiled reroute. CPU CI cannot
enter CUDA autocast, and faking `torch.is_autocast_enabled` trips
dynamo's global autocast guard ("Global autocast state changed while
dynamo tracing"), so the decision is patched directly.
- New `test_rerouted_xformers_keeps_an_fp32_model_in_fp32` covers the
other half under `fullgraph` compile: without autocast the reroute
returns fp32 and matches the fp32 SDPA reference.

## Verification

- main: `test_rerouted_xformers_keeps_the_fp32_downcast` fails.
- this branch: `tests/test_attention_dispatch_compiled_block.py` and
`tests/utils/test_attention_dispatch_dora_dtype.py` 19 passed, 2
skipped.
- Sabotage: with `_keeps_fp32_attention` forced to False (the pre-#18099
behaviour), the new fp32 test fails.
@danielhanchen
danielhanchen merged commit 811a942 into unslothai:main Nov 17, 2026
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.

fix(macos): shell launcher duplicates Desktop's bundle identifier

3 participants