Skip to content

chore: bench_chinese runs both implementations with digests#66

Merged
AmitMY merged 1 commit into
mainfrom
chore/bench-chinese-both
Jul 24, 2026
Merged

chore: bench_chinese runs both implementations with digests#66
AmitMY merged 1 commit into
mainfrom
chore/bench-chinese-both

Conversation

@AmitMY

@AmitMY AmitMY commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

bench_chinese.py imported the reference directly, so it never measured fast. It now runs both implementations side by side (each registers the Han handler in its own registry) and prints a merge-list digest per row, per the benchmark convention.

Answer to the question that prompted this: Chinese training takes the script-handler fallback in fast (cluster graphs built by the Python chinese_character_to_graph handler — the batch-ingestion fast path is gated off when handlers are registered), but the training loop still runs in Rust, which dominates:

--- 99 docs, 10 merges ---
  reference (Python)       3.132s  (0.3132s/merge, digest=dd447dcdaa)
  fast (Rust)              0.141s  (0.0141s/merge, digest=dd447dcdaa)   22x

--- 99 docs, 50 merges ---
  reference (Python)       5.839s  (0.1168s/merge, digest=61d761aee9)
  fast (Rust)              0.269s  (0.0054s/merge, digest=61d761aee9)   22x

Digests equal between implementations at every point — parity holds through the handler path too.

🤖 Generated with Claude Code

It imported the reference directly, so it never measured fast. Each
implementation now registers the Han handler in its own registry and
reports time plus a merge-list digest (parity check, per the benchmark
convention). Chinese training goes through the script-handler fallback
(Python-built cluster graphs) but still trains in Rust:

  99 docs, 50 merges: reference 5.84s vs fast 0.27s (22x), digests equal.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@AmitMY
AmitMY merged commit d1944e0 into main Jul 24, 2026
3 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