Skip to content

Condense comments added since the last cleanup: core, CLI and tests - #18901

Merged
danielhanchen merged 3 commits into
mainfrom
trim-comments-r4-core
Nov 23, 2026
Merged

danielhanchen merged 3 commits into
mainfrom
trim-comments-r4-core

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Condenses the multi-line comments, docstrings and JSDoc / block comments that landed in the core package, CLI and tests (unsloth, unsloth_cli, tests) since the last cleanup (#18374, #18375, #18376, #18377). Same rules as before: every fact a reader needs stays (the reason for a workaround, version bounds, shapes and dtypes, env vars and flags, issue numbers, must / never rules, ordering and security reasons); narration, step-by-step restatement and history go. Informative one-line comments are not touched.

No code changes: every changed file has an identical code token stream (and, for Python, an identical AST once docstrings are removed).

21 files, +54 / -83 lines.

Scope

Only sections of 2+ lines whose lines were mostly written after the last cleanup, not counting lines from other comment-trim commits. A rewrite is applied only when it saves at least one line, so tight comments are left as they are.

Left untouched:

  • every file containing triton.jit, and any comment that mentions Triton-style details (tl.*, constexpr, num_warps, num_stages, autotune)
  • derivations, diagrams, tables and tuning-table rationale (any section with table columns, rule lines, box drawing, aligned columns or =-led derivation lines)
  • section delimiters, license / SPDX headers, tool directives (noqa, type: ignore, eslint-disable, @ts-expect-error, biome-ignore, shellcheck, #region, ...), PowerShell comment-based help, JSX {/* */} comments
  • Python docstrings that can be read at runtime (decorated routes / tools / commands, pydantic models, classes outside tests, anything in a file that reads __doc__; module docstrings only where a reader analysis over the whole repo found no reader)
  • scripts that read their own text back ($0 / BASH_SOURCE / $PSCommandPath / __file__)
  • any comment containing a string literal that a test or source-reading script searches for, in a file that reader names (including escaped multi-line literals)
  • any comment inside a span that a frontend test regex matches in the source it reads
  • helpers that exist in more than one file keep identical comments in every copy

Verification

  • comment_tools.py check --strict-ext --allow-docstring-edits passes on every changed file (code tokens identical, all languages).
  • Delimiter and tool-directive comment sequences are identical in every changed file; no changed file contains triton.jit and no changed line mentions tl., constexpr or triton.
  • scripts/lint_*.py (av_shapes, exec_literals, risky_loaders, workflow_triggers, no_parallel_clamp, no_duplicate_ts_imports, duplicate_definitions, backend_python_floor) and ruff check give the same result on main and on this branch.
  • CLI help: every --help surface (42 unsloth CLI commands, 44 scripts with a parser) is byte-identical to main.
  • Tests (no GPU), main vs the round-4 branches together, compared by failing test ID: every frontend node test (16,932 tests) gives identical results. The Studio backend and root tests that read source text are compared the same way; results follow in a comment.
  • Functions that were identical across files on main are still identical on the branches.
  • Each rewrite was reviewed for meaning lost or claims added, removals in files that other files read were checked for readers, and proposed corrections went through a second check; anything flagged without a confirmed correction keeps its original text.

@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-22T14:57:49.495818Z
We couldn’t complete this review. Comment @codex review to try again.
2394eef 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.

danielhanchen added a commit that referenced this pull request Nov 22, 2026
… trl 1.18.2 (#18904)

## Summary


`tests/test_trl_cap_sites.py::test_the_zoo_trl_deferral_expires_when_the_zoo_release_ships`
now fails, on purpose, wherever it can reach PyPI (seen in the
`version-window drift` staging leg for #18901, base `90bf9c7`):

```
AssertionError: unsloth_zoo 2026.11.9 is published and admits trl 1.18.2 (!=0.19.0,<=1.18.2,>=0.18.2, ...),
so the deferral is over. Set ZOO_FLOOR_ADMITTING_TESTED_TRL_CEILING to 2026.11.9 and raise the unsloth_zoo
floor in pyproject.toml to it in the same commit.
```

#18809 lifted unsloth's TRL window to `<=1.18.2`, but every zoo release
up to 2026.11.8 caps TRL at 1.15.0. pip intersects the two, so users
still resolve TRL 1.15. The test deferred the check until a zoo
admitting 1.18.2 was published. unsloth_zoo 2026.11.9 is on PyPI with
`trl!=0.19.0,<=1.18.2,>=0.18.2`, so the floor should move to it now;
otherwise AsyncGRPO and the other TRL 1.17+ paths stay unreachable for
anyone who installs from PyPI.

## Changes

- `pyproject.toml`: `unsloth_zoo>=2026.11.8` to `>=2026.11.9` at all
three sites.
- `install.sh` / `install.ps1`: the `--no-deps` zoo install spec to
`unsloth-zoo>=2026.11.9`, which
`tests/test_installer_zoo_floor_parity.py` keeps equal to pyproject.
- `tests/test_trl_cap_sites.py`: `ZOO_FLOOR_ADMITTING_TESTED_TRL_CEILING
= Version("2026.11.9")`. That retires the self-expiring deferral and
arms `test_the_declared_zoo_floor_admits_the_tested_trl_ceiling`, which
from now on fails if the floor ever drops below a zoo that admits the
tested TRL ceiling.

## Testing

- `tests/test_trl_cap_sites.py`,
`tests/test_installer_zoo_floor_parity.py`,
`tests/python/test_desktop_unsloth_spec_no_deps_pair.py`,
`tests/test_transformers_cap_sites.py`: 82 passed, 7 skipped (the
deferrals, now correctly reporting that the gate is live).
- `tests/sh/test_relax_unsloth_floors_to_index.sh`: 23 passed.
- Sabotage: with the armed constant but `main`'s pyproject floor
(2026.11.8), `test_the_declared_zoo_floor_admits_the_tested_trl_ceiling`
fails.
@danielhanchen
danielhanchen merged commit 37a5dcc into main Nov 23, 2026
@danielhanchen
danielhanchen deleted the trim-comments-r4-core branch November 23, 2026 08:02
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