unsloth/tests/studio
Daniel Han e49a89f4f6 install.ps1: port the torch release preservation from install.sh
The Windows installer recreates the venv on every re-run (the existing
environment is moved aside for rollback and a fresh venv is created), so
irm install.ps1 | iex over an existing install resolved the newest torch
in range instead of keeping the installed release. This ports the
install.sh preservation merged in PR 7250:

- The installed torch version is probed (bounded process, drained
  streams, 30s timeout, last non-empty stdout line) BEFORE the rollback
  move, while the old interpreter still exists.
- Get-PreviousTorchPin mirrors _previous_torch_pin: numeric-strict base
  (nightly/dev/rc builds never pin), UNSLOTH_TORCH_UPGRADE=1 opt-out,
  and a release-in-window check against the route's final constraint,
  so a raised ROCm floor correctly rejects keeping an older release.
  The decision runs after every index and floor decision.
- The kept release installs as an exact pin with minor-paired
  companions (torchvision 0.minor+15, torchaudio 2.minor) at the main
  install, the AMD ROCm install and both flavor repairs; when the pinned
  release is not installable from the selected index the installer warns,
  clears the pin and falls back to the supported range. The CPU fallback
  cannot be reached with a live pin (the ROCm site resolves or clears it
  first) and keeps the plain range install.
- The with-deps unsloth installs now carry a uv overrides file with the
  exact installed trio (twin of _build_unsloth_torch_overrides), so
  dependency resolution cannot move torch after it was deliberately
  selected.
- The kept release is exported as UNSLOTH_KEPT_TORCH for setup.ps1,
  whose ROCm/CPU/CUDA torch installs substitute the kept trio when the
  env var is present (ROCm floors dominate; behavior without the env
  var is unchanged, so direct studio update runs are unaffected). After
  setup returns the installer re-probes and warns loudly if the kept
  release series changed, then clears the env var.

Preservation is version-agnostic (numeric parse + window comparison),
so a future ceiling bump to torch 2.12 keeps 2.11 installs in place.

New suite tests/studio/test_previous_torch_pin.ps1 (AST-extracted
helpers, 50+ checks incl. future-ceiling cases and structural wiring)
passes, along with the flavor/pin-hardening/pin-stale/node ps1 suites,
the parity and install-stack pytest suites, and the sh preservation and
constraint suites.
2026-07-20 10:41:41 +00:00
..
install install: let UNSLOTH_TORCH_INDEX_FAMILY / _URL override CUDA wheel detection (#6692) 2026-07-20 00:58:52 -07:00
load_freeze Reduce and tighten comments and docstrings across the test suite (#6429) 2026-06-18 01:07:09 -07:00
_playwright_robust.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
playwright_chat_ime_i18n.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
playwright_chat_ui.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
playwright_extra_ui.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
run_real_mlx_smoke.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
studio_api_smoke.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
test_auth_form_input_count.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
test_cancel_atomicity.py Reduce and tighten comments and docstrings across the test suite (#6429) 2026-06-18 01:07:09 -07:00
test_cancel_id_wiring.py Reduce and tighten comments and docstrings across the test suite (#6429) 2026-06-18 01:07:09 -07:00
test_chat_preset_builtin_invariants.py Formatting: ruff line-length 100, kwarg-spacing passes, drop blank after short local imports (#6079) 2026-06-08 04:24:13 -07:00
test_chat_prompt_variables.py Studio: prompt variables into prompt editor (#6434) 2026-06-25 18:09:16 +01:00
test_chat_response_details_ui_contract.py Studio: fix duplicate response model labels and hover (#7049) 2026-07-15 10:45:17 -07:00
test_chat_thinking_compact_layout.py Compact thinking control in narrow composers (#7150) 2026-07-15 09:58:18 -07:00
test_chat_title_generation.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
test_cli_repo_variant.py Reduce and tighten comments and docstrings across the test suite (#6429) 2026-06-18 01:07:09 -07:00
test_cli_run_alias.py Reduce and tighten comments and docstrings across the test suite (#6429) 2026-06-18 01:07:09 -07:00
test_cli_studio_defaults.py Reduce and tighten comments and docstrings across the test suite (#6429) 2026-06-18 01:07:09 -07:00
test_cli_studio_stop_windows.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
test_compact_dropdown_submenus.py Keep nested dropdown menus on screen (#7168) 2026-07-16 03:13:23 -07:00
test_composer_rtl_bidi_attribute.py Reduce and tighten comments and docstrings across the test suite (#6429) 2026-06-18 01:07:09 -07:00
test_export_output_path_contract.py Formatting: ruff line-length 100, kwarg-spacing passes, drop blank after short local imports (#6079) 2026-06-08 04:24:13 -07:00
test_frontend_dep_removal.py Unsloth: appearance palettes, customization options, and control restyle (#7077) 2026-07-14 05:12:08 -07:00
test_hardware_dispatch_matrix.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
test_is_mlx_dispatch_gate.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
test_llama_cpp_wall_clock_cap.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
test_locale_root_direction_contract.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
test_mlx_training_worker_behaviors.py MLX training support for Studio on Apple Silicon (#5340) 2026-05-14 05:24:20 -07:00
test_node_decision.ps1 Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
test_node_probe_guard.ps1 Studio: use an isolated Node.js for the frontend build instead of replacing the system Node/npm (#6533) 2026-06-21 21:17:29 -07:00
test_previous_torch_pin.ps1 install.ps1: port the torch release preservation from install.sh 2026-07-20 10:41:41 +00:00
test_resolve_cuda_toolkit.ps1 Windows installer: fix DiskPart UAC mid-install, drive-root cache, and spurious unsloth.exe rename warning (#6296) 2026-06-22 03:09:08 -07:00
test_settings_compact_overflow_contract.py Fix Settings layout overflow (#7167) 2026-07-16 03:12:09 -07:00
test_setup_pin_stale.ps1 install: let UNSLOTH_TORCH_INDEX_FAMILY / _URL override CUDA wheel detection (#6692) 2026-07-20 00:58:52 -07:00
test_stream_cancel_registration_timing.py Studio: queue local GGUF OpenAI-compatible requests before llama-server (#7047) 2026-07-10 17:05:48 -03:00
test_studio_gguf_export_script_pin.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
test_studio_text_descender_clipping.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
test_sync_allow_scripts_pins.py Studio: auto-sync allowScripts pins after dependency bumps (#6136) 2026-06-10 02:35:37 -07:00
test_torch_flavor.ps1 install: let UNSLOTH_TORCH_INDEX_FAMILY / _URL override CUDA wheel detection (#6692) 2026-07-20 00:58:52 -07:00
test_torch_index_pin_hardening.ps1 install: let UNSLOTH_TORCH_INDEX_FAMILY / _URL override CUDA wheel detection (#6692) 2026-07-20 00:58:52 -07:00
test_uninstall_dual_install_icon.ps1 Windows installer: fix DiskPart UAC mid-install, drive-root cache, and spurious unsloth.exe rename warning (#6296) 2026-06-22 03:09:08 -07:00
test_usage_examples_agent_detection_contract.py feat: detect installed coding agent CLIs in Studio settings (#6909) 2026-07-08 05:26:50 -07:00