Skip to content

Fix tokenizer and sampling edge cases and make asset downloads atomic - #8

Merged
yash27-lab merged 24 commits into
mainfrom
codex/numerics-tokenizer-assets-2026-10-06
Oct 6, 2026
Merged

yash27-lab merged 24 commits into
mainfrom
codex/numerics-tokenizer-assets-2026-10-06

Conversation

@yash27-lab

@yash27-lab yash27-lab commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

This batch fixes tokenizer boundaries and malformed merge handling, checks numerical preconditions before allocation, and makes invalid sampling inputs report clear errors. It also makes GPT-2 downloads atomic so interrupted transfers cannot leave a partial file at the final path.

23 focused updates, preserved across 24 commits including formatting, cover matrix/norm/RoPE/attention dimension checks; GPT-2 whitespace and hash-prefixed BPE merges; malformed/duplicate/missing merge entries; checked decoding and sampling APIs; f64 sampling weights; deterministic top-k ties; zero-probability boundaries; generation stop-token validation; public MLP layer validation; atomic downloads with output-directory, timeout, force-refresh and transfer-length options; and downloader CI/documentation. Final review also added signed-zero tie handling and fast returns for empty matrix outputs.

Tokenizer boundaries and header handling were checked against the Hugging Face GPT-2 implementation. Seeded stochastic output may differ from earlier versions because candidate ordering and probability arithmetic changed. Existing decoding methods retain their permissive API; the new try_decode methods reject unknown IDs.

Validation: regression tests include overflow, whitespace, hash merges, invalid logits/temperature, sampling boundaries, mutated model layers, and mocked download success/failure/truncation. Required Linux/macOS CI passed. Ubuntu ran 68 library tests, 5 CLI tests, 6 network-free downloader tests, formatting, Clippy, and CLI smoke checks. macOS passed its release build, Metal-inclusive Clippy, and Rust tests. The downloader tests use no network; pretrained GPT-2 assets and on-device Metal parity are not exercised by this batch.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@yash27-lab
yash27-lab merged commit fda1854 into main Oct 6, 2026
6 checks passed
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