Skip to content

Chore/b2 check untyped defs v0.5.2 - #20

Merged
CanGeng merged 2 commits into
masterfrom
chore/b2-check-untyped-defs-v0.5.2
Jun 27, 2026
Merged

Chore/b2 check untyped defs v0.5.2#20
CanGeng merged 2 commits into
masterfrom
chore/b2-check-untyped-defs-v0.5.2

Conversation

@CanGeng

@CanGeng CanGeng commented Jun 27, 2026

Copy link
Copy Markdown
Owner

No description provided.

CanGeng added 2 commits June 27, 2026 08:48
…→0), drop opt-out; bump 0.5.2

B2 finale: cleared the tests/ untyped-function-body type debt that v0.5.1
deferred behind the `tests.*` override, then removed the override entirely.
check_untyped_defs now covers the whole repo (lighttrain/ + tests/). 358 → 0
across 80 test files / 8 directories. Authority = the CPU-torch parity venv
(= CI types view); env-invariant (parity venv AND local nightly both green).

annotation-first: narrow-inferred locals/literals annotated (collator sample
lists as list[Mapping[str, Any]], empty dict/list literals, var-annotated
sites, test-fake attrs); 47 `assert ... is not None` for known-non-None
Optional access (trainer.model/value-head, Path|None before ZipFile/read_text,
dict|None / Tensor|None indexing, EvalReport|None). Targeted `# type: ignore`
only where annotation cannot express intent: method-assign monkeypatching
(49), intentional wrong-type coercion/validation tests, duck-typed test
doubles, dynamic RootConfig|DictConfig fields, captured -> None returns.

Production annotation fix (behavior-preserving): LengthGroupedSampler /
CurriculumSampler `__iter__` return `Iterable[int]` → `Iterator[int]` (bodies
already `return iter(...)`); only the tests' `iter(sampler)`/`list(sampler)`
exercised it — one fix cleared 26 test errors.

asserts only restate existing invariants — zero runtime behavior change.

CanGeng
…er now empty

New v0.5.2.md documents the tests/ check_untyped_defs clear (358→0,
annotation-first) and the opt-out removal. KNOWN_ISSUES.md: B2 moved to a
tombstone (→ v0.5.1 production + v0.5.2 tests); the Open ledger is now empty —
every issue from the historical changelog audit is resolved or dismissed.

CanGeng
@CanGeng
CanGeng merged commit 645d627 into master Jun 27, 2026
3 checks passed
@CanGeng
CanGeng deleted the chore/b2-check-untyped-defs-v0.5.2 branch June 27, 2026 00:49
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.

1 participant