[PR #2238] [CLOSED] test: exercise uncached BPE paths in tokenizer parity checks #3940

Closed
opened 2026-11-07 15:31:51 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2238
Author: @mustafaerdinc
Created: 10/13/2026
Status: ❌ Closed

Base: main ← Head: fix/tokenizer-cache-parity


📝 Commits (1)

  • 52a943a test: exercise uncached BPE paths in tokenizer parity checks

📊 Changes

1 file changed (+69 additions, -4 deletions)

View changed files

📝 serve/test_detok.py (+69 -4)

📄 Description

Summary

Tokenizer parity checks can reuse cached piece IDs from a previous algorithm and pass without executing the requested scan, heap, or default path. Clear the cache between comparisons and add regressions that prove deliberately incorrect output is detected.

Related to the investigation in #1385. This test coverage change does not establish the cause or resolution of that intermittent crash.

What changed

  • Clear the piece cache before forced scan, forced heap, and default parity comparisons.
  • Add three negative regressions covering incorrect scan, heap, and default output after cache population.
  • Use an independent serial reference for shared-tokenizer workers. Exercise warmed-cache and uncached runs, verifying all eight uncached workers reach BPE.
  • Remove the speculative interpreter-fault attribution from the test docstring. Production tokenizer code and runtime defaults are unchanged.

Validation

  • The three negative regressions fail before the fix and pass afterward; independent review found no blocking issue in this test-only change.
  • After rebasing onto main at a0116b2, ran the following on macOS arm64 with CPython 3.14.8 and the model tokenizer files available: 24 tests passed, zero skips, in 18.825 seconds.
STRATA_TOKENIZER=/path/to/tokenizer PYTHON_JIT=0 python -B -m unittest -v \
  serve.test_detok tools.test_strata_tokenizer tools.test_tokenizer_plain_spans
  • No CUDA, HIP, or SYCL source is changed; no backend build is claimed.

Extra Notes

The threaded wrapper proves test coverage, not the cause or resolution of #1385. The original-workload and minimal-reproducer investigation remains separate; this PR should not close that issue.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2238 **Author:** [@mustafaerdinc](https://github.com/mustafaerdinc) **Created:** 10/13/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/tokenizer-cache-parity` --- ### 📝 Commits (1) - [`52a943a`](https://github.com/Niko1221/Strata/commit/52a943ad53a98a125b8364843d82fdf3af25f8e1) test: exercise uncached BPE paths in tokenizer parity checks ### 📊 Changes **1 file changed** (+69 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `serve/test_detok.py` (+69 -4) </details> ### 📄 Description ## Summary Tokenizer parity checks can reuse cached piece IDs from a previous algorithm and pass without executing the requested scan, heap, or default path. Clear the cache between comparisons and add regressions that prove deliberately incorrect output is detected. Related to the investigation in #1385. This test coverage change does not establish the cause or resolution of that intermittent crash. ## What changed - Clear the piece cache before forced scan, forced heap, and default parity comparisons. - Add three negative regressions covering incorrect scan, heap, and default output after cache population. - Use an independent serial reference for shared-tokenizer workers. Exercise warmed-cache and uncached runs, verifying all eight uncached workers reach BPE. - Remove the speculative interpreter-fault attribution from the test docstring. Production tokenizer code and runtime defaults are unchanged. ## Validation - The three negative regressions fail before the fix and pass afterward; independent review found no blocking issue in this test-only change. - After rebasing onto main at a0116b2, ran the following on macOS arm64 with CPython 3.14.8 and the model tokenizer files available: **24 tests passed, zero skips**, in 18.825 seconds. ```sh STRATA_TOKENIZER=/path/to/tokenizer PYTHON_JIT=0 python -B -m unittest -v \ serve.test_detok tools.test_strata_tokenizer tools.test_tokenizer_plain_spans ``` - No CUDA, HIP, or SYCL source is changed; no backend build is claimed. ## Extra Notes The threaded wrapper proves test coverage, not the cause or resolution of #1385. The original-workload and minimal-reproducer investigation remains separate; this PR should not close that issue. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:31:51 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3940
No description provided.