chore: slim PR to user-facing essentials

Carry only the code, tests, and user-facing docs that matter to end
users; drop the modernization scaffolding accumulated while building it.

- Remove the bench harness, results, and environment captures (bench/).
- Remove internal docs and research spikes (docs/).
- Remove the Makefile; tests run via uv / pytest directly.
- Strip the bench harness and quantization-matrix steps from the Tier 2
  workflow. The golden-image test drives conversion through the Core ML
  Converter node at runtime, so no separate convert step is needed.
- Replace phase/handoff annotations across code, tests, and config with
  neutral docstrings and comments.
This commit is contained in:
aszc-dev
2026-05-25 18:37:04 +02:00
parent 6a0ccbeb60
commit 31774e3324
50 changed files with 85 additions and 2630 deletions
@@ -1,4 +1,4 @@
"""Phase 2 characterization tests for coreml_suite.controlnet.
"""Characterization tests for coreml_suite.controlnet.
Locks shapes + dtypes + zero-fill behavior of expand_inputs / no_control /
extract_residual_kwargs / chunk_control. These pure helpers feed the Core ML
+2 -2
View File
@@ -1,10 +1,10 @@
"""Phase 2 characterization tests for coreml_suite.models.CoreMLInputs.
"""Characterization tests for coreml_suite.models.CoreMLInputs.
Locks the shape transforms applied by chunks() and coreml_kwargs() for the
four model variants the suite supports: SD1.5, LCM (SD1.5 + timestep_cond),
SDXL base (time_ids len 6), and SDXL refiner (time_ids len 5).
These contracts feed the Core ML UNet at runtime; if Phase 3 silently
These contracts feed the Core ML UNet at runtime; if a refactor silently
re-shapes them, generation breaks.
"""
import numpy as np
+3 -3
View File
@@ -1,7 +1,7 @@
"""Phase 2 characterization tests for coreml_suite.latents.
"""Characterization tests for coreml_suite.latents.
Locks the *current* behavior of chunk_batch / merge_chunks — including the
zero-pad regions and the truncation in merge — so the Phase 3 refactor
zero-pad regions and the truncation in merge — so a refactor
cannot silently shift either contract.
"""
import pytest
@@ -110,7 +110,7 @@ def test_merge_chunks_truncates_padding():
def test_merge_chunks_singleton_returns_equal_copy_when_shape_matches():
"""A singleton chunk list still goes through torch.cat, so we get a new
tensor equal to the input — locked here because Phase 3 might be tempted
tensor equal to the input — locked here because a refactor might be tempted
to short-circuit and accidentally return the same object."""
x = _const_tensor(2)
out = merge_chunks([x], x.shape)
+6 -6
View File
@@ -1,9 +1,9 @@
"""Phase 2 characterization tests, Phase 3 re-pointed.
"""Characterization tests for the .mlpackage filename composition.
After Phase 3 the .mlpackage filename composition is the pure
The filename composition is the pure
coreml_suite.core.naming.compose_out_name function. CoreMLConverter.convert
calls it; the previous Phase 2 test had to monkey-patch heavy converter
internals just to capture the string, which made the test framework-coupled.
calls it; testing the pure function avoids monkey-patching heavy converter
internals just to capture the string.
"""
import pytest
@@ -145,11 +145,11 @@ def test_lora_names_from_params_empty_list():
assert lora_names_from_params([]) == []
# ---------- Phase 6: quantize_nbits suffix ---------------------------------
# ---------- quantize_nbits suffix ------------------------------------------
def test_quantize_nbits_none_appends_nothing():
"""'none' is the default and must keep the pre-Phase-6 filename so
"""'none' is the default and must keep the unquantized filename so
existing cached .mlpackages still resolve."""
out = compose_out_name(
ckpt_name="dreamshaper_8.safetensors",
@@ -1,6 +1,6 @@
"""Phase 2 characterization tests, Phase 3 re-pointed.
"""Characterization tests for the SDXL options math.
After Phase 3 the SDXL time_ids / text_embeds math lives in
The SDXL time_ids / text_embeds math lives in
coreml_suite.core.sdxl as pure builders. The framework adapter
add_sdxl_model_options (in models.py) is exercised separately by the m2
golden image test; here we just lock the pure math.
@@ -95,7 +95,7 @@ def test_wrapper_captures_time_ids_text_embeds_refiner_via_closure():
def test_wrapper_returns_zero_when_context_missing():
"""When c_crossattn is None the wrapper short-circuits to zeros_like(x).
Locked here because Phase 3 mustn't change this default."""
Locked here because the refactor mustn't change this default."""
wrapper = sdxl_model_function_wrapper(torch.zeros(2, 6), torch.zeros(2, 1280))
x = torch.randn(2, 4, 16, 16)
out = wrapper(
+3 -4
View File
@@ -1,8 +1,7 @@
"""Original smoke tests, re-pointed at coreml_suite.core.* in Phase 3.
"""Smoke tests for the pure batch-chunking helpers in coreml_suite.core.
Drops the `from comfy.model_management import get_torch_device` import
(replaced with torch.device('cpu') so Tier 0 runs without ComfyUI) and the
dead `model_config` fixture (defined in Phase 1 but never consumed).
Uses torch.device('cpu') instead of comfy.model_management.get_torch_device
so Tier 0 runs without ComfyUI.
"""
import pytest
import torch
+1 -1
View File
@@ -1,4 +1,4 @@
"""Phase 3 gate: prove the Tier-0 lane is framework-free.
"""Gate: prove the Tier-0 lane is framework-free.
In a pure `pytest -m unit` run, none of the banned runtime modules
(comfy, coremltools, python_coreml_stable_diffusion, folder_paths,