test: freeze renderer behavior before refactoring - #118
Draft
hallerite wants to merge 4 commits into
Draft
Conversation
Comment on lines
21
to
+45
| @@ -38,4 +40,64 @@ jobs: | |||
| run: uv sync | |||
|
|
|||
| - name: Run tests | |||
| run: uv run pytest tests/ -v | |||
| run: uv run pytest tests/ -m "not network" -v | |||
|
|
|||
| model-parity: | |||
| name: Pinned model parity | |||
| runs-on: ubuntu-latest | |||
| timeout-minutes: 45 | |||
| env: | |||
| HF_HUB_DISABLE_PROGRESS_BARS: "1" | |||
| RENDERERS_TEST_NETWORK: "1" | |||
| steps: | |||
| - uses: actions/checkout@v4 | |||
|
|
|||
| - name: Set up Python 3.13 | |||
| uses: actions/setup-python@v6 | |||
| with: | |||
| python-version: "3.13" | |||
|
|
|||
Comment on lines
+46
to
+75
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v7 | ||
|
|
||
| - name: Cache pinned Hugging Face assets | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/huggingface | ||
| key: hf-renderers-${{ hashFiles('tests/model_assets.py') }} | ||
|
|
||
| - name: Install dependencies | ||
| run: uv sync | ||
|
|
||
| - name: Run text model parity tests | ||
| run: uv run pytest tests/ -m "network and not multimodal" -v | ||
|
|
||
| multimodal-parity: | ||
| name: Pinned multimodal parity | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 45 | ||
| env: | ||
| HF_HUB_DISABLE_PROGRESS_BARS: "1" | ||
| RENDERERS_TEST_NETWORK: "1" | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python 3.13 | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.13" | ||
|
|
Comment on lines
76
to
103
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
The renderer internals are about to undergo a substantial emission/attribution refactor. The existing suite is broad, but upstream model assets were mutable and there was no compact checked-in contract showing the complete observable output of each renderer.
This PR makes the current behavior reproducible and reviewable before implementation moves. It is intended to change test architecture and documentation, not renderer output.
Developer impact
Offline tests continue to run on Python 3.10–3.13. Network-backed text and multimodal parity tests now run in dedicated Python 3.13 jobs using immutable model revisions. Golden output changes must be regenerated explicitly and reviewed in the diff.
Validation
uv run ruff check .uv run ruff format --check .ty check renderersexits successfully with the existing advisory diagnosticsNote
Freeze renderer behavior with golden snapshot tests before refactoring
MODEL_REVISIONS(pinned full SHAs) andload_test_tokenizer, replacing directload_tokenizercalls across all test files to ensure deterministic tokenizer loads.load_tokenizerin renderers/base.py to support arevisionkwarg and enforce a stricter trust policy:trust_remote_codeis only enabled for models inTRUSTED_REVISIONS, and callers cannot override the revision for trusted models.Renderersjob into three jobs: offline unit tests (Python 3.10–3.13), text model parity tests (network), and multimodal parity tests (network), with HF asset caching keyed bymodel_assets.py.network,model_parity,multimodal) to categorize tests and exclude network tests from offline runs.Macroscope summarized a48daf6.