Skip to content

Add the tokenizers crate and its notices for the v1.2 tokenizer trainer (v1.1 dependency front-load) - #354

Merged
Vedaant-J merged 3 commits into
releases/v1.1from
vedaant/v1.1-tokenizers-deps
Nov 16, 2026
Merged

Vedaant-J merged 3 commits into
releases/v1.1from
vedaant/v1.1-tokenizers-deps

Conversation

@Vedaant-J

@Vedaant-J Vedaant-J commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Design discussion or issue: front-loads the third-party dependencies that #307 added on main, so they can be reviewed for v1.1 before v1.2 needs them.

Summary

v1.2 adds the Rust tokenizers crate to the DiskGraph extension (#307). This PR adds that same dependency, at the same versions, to releases/v1.1, together with its license records. That way the new third-party crates can be reviewed now, and v1.2 won't need a dependency or notice change later. v1.1 behaviour doesn't change. Nothing in the shipped extension calls tokenizers. Its only caller is a new integration test.

What changes:

  • diskgraph-pybind gets main's exact requirement as a normal dependency: tokenizers = { version = "=0.23.2", default-features = false, features = ["onig"] }. The crate version stays 0.1.0.
  • Cargo.lock adds the 25 crates listed below at main's exact versions. No existing crate version changes. The lockfile's set of third-party crates and versions is identical to main's. The only difference is diskgraph-pybind's own version and its first-party dependency lists.
  • The notice generator gets main's expression_overrides policy mechanism (from Train Text tokenizers for stored columns inside DiskGraph (stack 4/5) #307). It is needed for onig_sys (see below).
  • The generated notices are rebuilt with the repository's scripts. 3rdparty/notices/inventory.json and THIRD-PARTY.txt are byte-identical to main. packages/diskgraph/third_party/artifact-manifest.json differs from main only in diskgraph-pybind's version and the lockfile hash.

New crates in Cargo.lock (25)

Crate Version License
base64 0.13.1 MIT OR Apache-2.0
daachorse 3.0.3 MIT OR Apache-2.0
darling 0.20.11 MIT
darling_core 0.20.11 MIT
darling_macro 0.20.11 MIT
dary_heap 0.3.9 MIT OR Apache-2.0
derive_builder 0.20.2 MIT OR Apache-2.0
derive_builder_core 0.20.2 MIT OR Apache-2.0
derive_builder_macro 0.20.2 MIT OR Apache-2.0
esaxx-rs 0.1.10 Apache-2.0
macro_rules_attribute 0.2.3 Apache-2.0 OR MIT OR Zlib
macro_rules_attribute-proc_macro 0.2.3 Apache-2.0 OR MIT OR Zlib
monostate 0.1.18 MIT OR Apache-2.0
monostate-impl 0.1.18 MIT OR Apache-2.0
onig 6.5.3 MIT
onig_sys 69.9.3 MIT AND BSD-2-Clause (override, see below)
pastey 0.2.3 MIT OR Apache-2.0
rand 0.9.5 MIT OR Apache-2.0
rand_chacha 0.9.0 MIT OR Apache-2.0
rand_core 0.9.5 MIT OR Apache-2.0
rayon-cond 0.4.0 Apache-2.0 OR MIT
spm_precompiled 0.1.4 Apache-2.0
tokenizers 0.23.2 Apache-2.0
unicode-normalization-alignments 0.1.12 MIT OR Apache-2.0
unicode_categories 0.1.1 MIT OR Apache-2.0

Cargo.lock already had four more crates at these versions, and tokenizers now pulls them into the shipped extension. So they also get new notice records. Their versions don't change.

Crate Version License
castaway 0.2.4 MIT
compact_str 0.9.1 MIT
paste 1.0.15 MIT OR Apache-2.0
static_assertions 1.1.0 MIT OR Apache-2.0

All 29 records are in the diskgraph-extension and diskgraph-extension-windows artifacts. They are identical to the records on main.

onig_sys: "MIT AND BSD-2-Clause"

onig_sys 69.9.3 declares MIT in its Cargo metadata, but it bundles Oniguruma's C source, which is BSD-2-Clause. A 3rdparty/notices/policy.json entry under expression_overrides sets its expression to MIT AND BSD-2-Clause, with the reason "The onig_sys crate bundles Oniguruma's C source under BSD-2-Clause." Its inventory record carries both LICENSE.md and oniguruma/COPYING, so THIRD-PARTY.txt includes Oniguruma's license text.

The override mechanism is main's code. An override names an exact ecosystem, name and version, and must give an expression and a non-empty reason. A record with an override is checked against the override instead of its Cargo metadata. An override that no inventory record uses fails the check as stale. So the override ends when onig_sys changes version.

What uses it

packages/diskgraph/diskgraph-pybind/tests/train_tokenizer.rs trains a small byte-level BPE tokenizer (BpeTrainer with ByteLevel, add_prefix_space = false), the same way main's train_tokenizer does. It checks the serialized JSON and an encoding. CI's cargo test --workspace and cargo clippy --workspace --all-targets both build it.

Not included

Change map

#354 (comment)

Testing Done

On Linux x86_64, from the branch head:

  • Every step of .github/workflows/license-notice.yml passes:
    • cargo fetch --locked
    • check_cargo_license_metadata.py
    • cargo deny check licenses (cargo-deny 0.20.2): licenses ok
    • generate_artifact_manifest.py --check: current
    • All five gen_third_party.py --check lines: current
    • test_gen_third_party, test_refresh_diskgraph_notice_inventory and test_cargo_license_metadata: 19 tests OK
  • check_python_license_metadata.py passes for 14 manifests.
  • The npm notice test test_generate_npm_third_party.py didn't run here because this machine has no Node. This PR doesn't touch npm notices.
  • refresh_diskgraph_notice_inventory.py reports the inventory as current.
  • cargo build --locked --workspace, cargo test --locked --workspace (includes the new tokenizer test) and cargo clippy --locked --workspace --all-targets -- -D warnings all pass.
  • ./scripts/diskgraph install builds the DiskGraph wheel, which compiles onig_sys's bundled C source, and the module imports.
  • Lockfile name+version diff: against releases/v1.1, exactly the 25 crates above are added and none are removed. Against main, the only difference is diskgraph-pybind 0.1.0 vs 0.2.0.

Not run locally: kumo-engine-wheel.yml also builds macOS arm64 (macos-15) and Linux aarch64 (ubuntu-24.04-arm) wheels. onig_sys compiles its bundled C source on each, so those platforms are covered by the release wheel workflow, not by this local run. main already builds this same dependency on them.

Checklist

  • I listed all the breaking changes introduced by the PR (none)
  • I made sure to update examples and documentation with my changes (if necessary)
  • I have added and modified unit tests required to cover changes made by this PR.

🤖 Generated with Claude Code

Vedaant-J and others added 3 commits November 16, 2026 18:33
Pin tokenizers 0.23.2 (onig regex backend, no default features), the
same requirement main carries. Cargo.lock adds its 25 transitive crates
at main's versions and leaves every existing crate unchanged.

An integration test trains a byte-level BPE tokenizer the way main's
train_tokenizer does and checks the serialized JSON.

Co-Authored-By: Claude <[email protected]>
A policy expression_overrides entry names an exact package version, the
license expression its inventory record must carry, and a reason. The
record is then checked against the override instead of its Cargo
metadata, and an override no record uses is reported as stale.

Co-Authored-By: Claude <[email protected]>
The DiskGraph extension now ships tokenizers and its runtime crates.
onig_sys declares MIT but bundles Oniguruma's C source under
BSD-2-Clause, so the policy overrides its expression to
"MIT AND BSD-2-Clause" and the inventory carries Oniguruma's COPYING.

Co-Authored-By: Claude <[email protected]>
@Vedaant-J

Copy link
Copy Markdown
Contributor Author

Change map

Release requirement: v1.2's new third-party Rust crates (tokenizers and its runtime crates, #307) must be on releases/v1.1 so they can be reviewed now. Existing behavior: v1.1 has none of them. Smallest sufficient change: main's exact dependency line, main's exact lockfile versions, main's override mechanism, and regenerated notices. No feature code. Focused verification: the license-notice workflow steps, cargo build/test/clippy, and one wheel build. Stopping condition: inventory and THIRD-PARTY.txt byte-identical to main, and the lockfile's third-party set identical to main.

File Function / scope What changed Why
packages/diskgraph/diskgraph-pybind/Cargo.toml [dependencies] Adds tokenizers = "=0.23.2" with onig, no default features Main's exact requirement
packages/diskgraph/Cargo.lock lockfile Adds 25 crates at main's versions; no existing version changes Resolve the new dependency exactly as main does
packages/diskgraph/diskgraph-pybind/tests/train_tokenizer.rs trains_a_byte_level_bpe_tokenizer Trains a byte-level BPE tokenizer and checks its JSON and an encoding The dependency is used, built and tested in CI
scripts/gen_third_party.py validate Reads expression_overrides from the policy, checks overridden records against them, reports stale overrides Main's mechanism, needed for onig_sys
test/scripts/test_gen_third_party.py test_expression_override_needs_its_exact_package_and_a_reason New test of the override's matching, reason and staleness rules Covers the mechanism
3rdparty/notices/policy.json expression_overrides onig_sys 69.9.3 → MIT AND BSD-2-Clause, with reason Crate bundles Oniguruma's BSD-2-Clause C source
3rdparty/notices/inventory.json Rust components, texts 29 new records and Oniguruma's COPYING text Regenerated; identical to main
THIRD-PARTY.txt generated notice Adds the 29 components' notices Regenerated; identical to main
packages/diskgraph/third_party/artifact-manifest.json artifact graphs New crates in the extension graphs and the new lockfile hash Regenerated; differs from main only in diskgraph-pybind's version and the lockfile hash

@copy-pr-bot

copy-pr-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@Vedaant-J
Vedaant-J temporarily deployed to gha-kumo-workflow-tests November 16, 2026 18:41 — with GitHub Actions Inactive
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Pre-merge checks: Passed 2 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Change Map Design Review Warning The change map (PR comment marked <!-- kumo-pr-change-map -->, fetched with gh api) is accurate on file facts. I checked these against the checked-out tree: - Cargo.toml line 50 has the `tokeniz… 1. Add to the change map a row or note that onig_sys compiles bundled C on all wheel targets. State which targets are unverified (macOS arm64 and Linux aarch64, per the description). Change "Focused verification" to name them. 2. Replace …
Passed Passed checks: 2 passed

Check name Status Explanation
Pr Size Passed The PR size check fails only when the changed-file count exceeds 40. The PR head has three commits on top of the v1.1 line (base 5705c52, the parent of the first PR commit da2719f). Comparing that b…
Public Resource Access Passed The PR adds external references in these places: (1) 22 unique origin repository URLs in 3rdparty/notices/inventory.json, THIRD-PARTY.txt, and `packages/diskgraph/third_party/artifact-manifest.j…
Full details: Pr Size

Explanation

The PR size check fails only when the changed-file count exceeds 40. The PR head has three commits on top of the v1.1 line (base 5705c52, the parent of the first PR commit da2719f). Comparing that base with HEAD shows 9 changed files (1 added, 8 modified): 3rdparty/notices/inventory.json, 3rdparty/notices/policy.json, THIRD-PARTY.txt, packages/diskgraph/Cargo.lock, packages/diskgraph/diskgraph-pybind/Cargo.toml, packages/diskgraph/diskgraph-pybind/tests/train_tokenizer.rs, packages/diskgraph/third_party/artifact-manifest.json, scripts/gen_third_party.py, and test/scripts/test_gen_third_party.py. 9 does not exceed 40, so the check passes. Line counts were ignored, as the check requires. The base is inferred from local history because releases/v1.1 is not present as a ref. Even with a different base, the PR description lists only these kinds of files, so the result is unlikely to change.

Full details: Public Resource Access

Explanation

The PR adds external references in these places: (1) 22 unique origin repository URLs in 3rdparty/notices/inventory.json, THIRD-PARTY.txt, and packages/diskgraph/third_party/artifact-manifest.json (for example https://github.com/huggingface/tokenizers and https://github.com/rust-onig/rust-onig); (2) 25 source = "registry+https://github.com/rust-lang/crates.io-index" lines in packages/diskgraph/Cargo.lock and matching source fields in the manifests; (3) two http://www.apache.org/licenses/ URLs inside copied Apache-2.0 license text. The test file, Cargo.toml line, policy.json, and scripts add no URLs. I checked anonymous access with unauthenticated HTTP requests. Every origin repository returned HTTP 200 (GitHub returns 404 for private repositories anonymously, so 200 confirms public access). https://index.crates.io/config.json, https://github.com/rust-lang/crates.io-index, and http://www.apache.org/licenses/LICENSE-2.0 also returned 200. The PR description's links (github.com/NVIDIA/kumo-engine and its PR page) are also publicly reachable. No added or modified external reference is confirmed inaccessible, so the check passes.

Full details: Change Map Design Review

Explanation

The change map (PR comment marked &lt;!-- kumo-pr-change-map --&gt;, fetched with gh api) is accurate on file facts. I checked these against the checked-out tree: - Cargo.toml line 50 has the tokenizers requirement. - policy.json has the onig_sys expression_overrides entry. - gen_third_party.py validate() reads overrides (lines 996-1004), checks them (lines 1077-1082) and reports stale ones (lines 1249-1251). - test_gen_third_party.py has test_expression_override_needs_its_exact_package_and_a_reason (line 222). - train_tokenizer.rs exists and matches the row's description. The design has these substantive problems: 1. Omitted material behavior (proven). The map lists onig_sys only as the reason for the override. It omits that onig_sys compiles Oniguruma's bundled C source on every wheel platform. The PR description says macOS arm64 and Linux aarch64 wheels were not built locally. The map's verification row says only "one wheel build." A reader of the map cannot see this gap. 2. Unsourced release requirement. The map states "Release requirement: v1.2's new third-party Rust crates must be on releases/v1.1." The description gives only a preference: review early. No requester, issue or release-policy text is cited. docs/development/releasing-kumo-engine.md does not state this requirement. The whole PR depends on this requirement, so it needs a source or a restated scope. 3. Circular justification for the test (uncertain design question). The test row says "The dependency is used, built and tested in CI." The test checks tokenizers library behavior, not Kumo behavior. The description says nothing in the shipped code calls tokenizers. The test therefore adds CI cost and asserts third-party output details (for example Ġshoes) to a release branch. The map does not show that the stated goal needs it. Its stopping condition does not depend on it. 4. Unexamined smaller alternative (uncertain design question). The onig feature alone causes the onig_sys C build and the override mechanism. The map does not discuss whether features = ["onig"] is needed for the added test or for v1.1. It justifies main's exact line only by matching main. That is a consistency argument, not proof of minimality. Items 1 and 2 are the main reasons for FAIL. Items 3 and 4 are design questions that the map should answer.

Resolution

  1. Add to the change map a row or note that onig_sys compiles bundled C on all wheel targets. State which targets are unverified (macOS arm64 and Linux aarch64, per the description). Change "Focused verification" to name them. 2. Replace the unsourced "Release requirement" sentence with its source (a request, issue or release-plan link). If no source exists, state it as the author's scheduling preference and explain why a release branch must carry it. 3. Either drop train_tokenizer.rs from this PR, or justify it with a v1.1 behavior or requirement. Do not justify it by "the dependency is used." If it stays, say what it protects in Kumo code. 4. State whether onig is needed for the v1.1 build or for the added test. If it is not needed, say why the map still uses main's exact feature set. Or drop the feature and accept a lockfile diff from main.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@Vedaant-J
Vedaant-J merged commit c98dd37 into releases/v1.1 Nov 16, 2026
108 checks passed
@Vedaant-J
Vedaant-J deleted the vedaant/v1.1-tokenizers-deps branch November 16, 2026 19:19

This branch was previously deployed

1 inactive deployment
gha-kumo-workflow-tests — df7c4af3 Deployed Nov 16, 2026 by Vedaant-J via import #2420
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