Skip to content

ci: split offline checks from pinned model parity tests - #118

Merged
hallerite merged 7 commits into
mainfrom
codex/freeze-golden-corpus
Oct 29, 2026
Merged

hallerite merged 7 commits into
mainfrom
codex/freeze-golden-corpus

Conversation

@hallerite

@hallerite hallerite commented Aug 6, 2026 •

Copy link
Copy Markdown
Member

Model tests depend on changing upstream assets, and CI repeats the expensive parity suite across every supported Python version. Pin the test assets and separate offline compatibility checks from model parity tests to make failures reproducible and avoid repeating the full suite four times.

Changes

  • Pin 53 public tokenizer and processor revisions through shared test helpers. Support an explicit tokenizer revision while preserving the reviewed remote-code revision policy.
  • Run offline tests on Python 3.11–3.14. Run text parity and multimodal parity separately on Python 3.13, using locked dependencies and independent asset caches.
  • Fetch pinned public multimodal assets instead of skipping tests when the cache is empty. Optional private Nemotron metadata remains cache-only and uses its cached snapshot revision.
  • Preserve existing test scenarios and add three revision-policy parameter cases.

Validation

All three local lanes passed with model downloads disabled:

Lane Passed Skipped
Offline 214 1
Text parity 14,189 100
Multimodal parity 133 17

The offline lane also passed with an empty asset cache and network sockets blocked. Collection checks confirm all 14,654 cases belong to exactly one lane. Ruff, pre-commit, type checks, and workflow/config parsing passed.

GitHub Actions: all four offline jobs, multimodal parity, style/type checks, and CodeQL have passed. Text parity is still running.

Note

Split CI into offline unit tests and pinned model parity test jobs

  • Renames the test job in test.yml to an offline unit-test job. It sets Hugging Face and Transformers offline env vars, runs a locked uv sync, and selects tests not marked model.
  • Adds a separate Python 3.13 matrix job for text and multimodal model tests, with a 45-minute timeout, HF cache paths, and per-suite cache keys.
  • Declares the model and multimodal pytest markers in pyproject.toml so pytest recognizes them.
  • Extends load_tokenizer in base.py with a keyword-only revision argument. It raises ValueError if the revision differs from a trusted revision already set in the load kwargs, otherwise passes it through.
  • Behavioral Change: pushes and pull requests touching uv.lock now trigger the workflow; workflow permissions are now contents: read.

Macroscope summarized e080f90.


Note

Medium Risk
Adds a public load_tokenizer revision knob tied to trusted-remote-code rules, and CI now downloads pinned Hub assets for large parity suites—behavior and infra change, not a core rendering logic rewrite.

Overview
This PR restructures CI and test harness so fast, network-free checks run separately from heavy Hugging Face parity work, and model tests load immutable commit SHAs instead of whatever is on the Hub today.

GitHub Actions now has an offline unit job on Python 3.11–3.14 (HF_HUB_OFFLINE / TRANSFORMERS_OFFLINE, pytest -m "not model", uv sync --locked) and a model parity job on 3.13 only, split into text (model and not multimodal) and multimodal (model and multimodal) with Hugging Face cache keyed on tests/model_assets.py. Workflow triggers also include uv.lock.

Pytest registers model and multimodal markers; parametrized parity suites and most real-tokenizer tests are tagged so collection cleanly partitions the ~14k-case matrix.

Pinned assets: new tests/model_assets.py maps ~53 public models to revision SHAs and exposes load_test_tokenizer / load_test_processor. Tests switch from load_tokenizer + “skip if not cached” to these helpers; public models are expected to download at pinned revisions in CI, while the optional private Nemotron VLM still skips unless metadata is cached locally.

Library change: load_tokenizer(..., revision=...) forwards a pin to from_pretrained but raises ValueError if callers try to override a Kimi trusted remote-code revision.

Reviewed by Cursor Bugbot for commit e080f90. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread .github/workflows/test.yml Fixed
Comment thread .github/workflows/test.yml Fixed
Comment thread .github/workflows/test.yml Fixed
@hallerite hallerite changed the title test: freeze renderer behavior before refactoring test: pin model assets and split CI tiers Oct 29, 2026
Comment thread .github/workflows/test.yml Fixed
Comment thread .github/workflows/test.yml Fixed
@hallerite
hallerite marked this pull request as ready for review October 29, 2026 02:16
@hallerite hallerite changed the title test: pin model assets and split CI tiers ci: split offline checks from pinned model parity tests Oct 29, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 29, 2026

Copy link
Copy Markdown

Approvability

Verdict: Approved at e080f90

Macroscope's review found this PR approvable — This separates offline compatibility checks from pinned model parity tests and adds optional tokenizer revision selection without weakening trusted-code pins. Effects are concentrated in CI and test assets, with existing tokenizer defaults preserved.

Notes:

  • Macroscope's correctness review did not run, so approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

@hallerite
hallerite merged commit d9a2853 into main Oct 29, 2026
13 checks passed
@hallerite
hallerite deleted the codex/freeze-golden-corpus branch October 29, 2026 02:41
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.

2 participants