Skip to content

Latest commit

 

History

History
113 lines (89 loc) · 6.7 KB

VALIDATION.md

File metadata and controls

113 lines (89 loc) · 6.7 KB

Release validation

Version: 2.2.0. Date: 2026-11-19. Source base: CrypToolProject/LanguageStatisticsLibPy, main commit 4561acb2be9bf06b1f79d58b7dcbe59becd9366e. This release was developed in a local checkout; it does not represent a pushed GitHub commit or a published PyPI release.

Automated suite

python -m unittest discover -s tests -v

136 tests passed on CPython 3.12.14, NumPy 2.3.5, Linux x86-64. This includes the original 80 release tests and 55 new tokenizer, integration and CLI tests for configurable markers and punctuation, plus a compatibility regression using an actual model produced by version 2.1.

Area Checks
Model calculations Independently calculated keys/scores, dense/sparse equality, invalid-position semantics, raw counts, float32 storage, float64 aggregation
High orders n=7 and n=40/70 examples; keys above 64 bits; flat dense n=100/128 with one token; huge sparse order without full-key-space allocation
Generator Hand-counted word pairs and sentence markers, growing/fixed vocabularies, normalization, combining marks, reserved tokens, exact sequence boundaries, unknown policies, pruning and explicit memory budgets
Format Dense/sparse roundtrips, optional counts, UTF-8, checksum failure, every truncation point of a small frame, corrupt descriptors/keys/counts, finite values, budgets and atomic-write failure behavior
Compatibility Three original CT2 CTLS fixtures, exact float32 roundtrips, independent old-reader implementation reading CTLS1 and compatible CTLS2 prefixes, .NET variable-length string prefixes, and unchanged stored labels/IDs/counts/scores when loading an actual 2.1 word model
Existing APIs Original factory/scoring with real fixtures; exact method identity and numeric result of all six old classes through the new adapter
Dictionaries Complete-entry matching, no prefix false positives, Unicode decoding, header/entry count agreement, truncated input rejection
CLI Train/inspect/convert, CTLS1 conversion, n>6 syllables, manifest, separate document boundaries and nonzero error exits
Punctuation and markers Hand-counted final punctuation before EOS, closing quotes, fixed-vocabulary extension, custom labels/IDs, normalized collision rejection, Unicode/custom endings, ellipsis, both syllable modes, selected word joiners, explicit tokens, disabled policies and order-8 start padding

The suite includes an exhaustive short-window check across all 1,024 sequences of length five over two valid and two invalid ID values. It compares against an independent reference rather than repeating the vector implementation.

Existing CrypTool data

The three small original statistics files included in tests/fixtures are independent compatibility inputs, not fixtures generated by the new writer. Their provenance and SHA-256 values are in tests/fixtures/README.md.

The small v2_1-default-word-2gram.ctwm fixture was copied byte for byte from the previously delivered 2.1.0 archive. It retains that release's original marker labels and German corpus tokens. The regression checks its exact vocabulary and IDs, every hand-counted bigram, metadata and scores through loading and a save/load roundtrip. New English defaults do not rewrite saved models.

The original German and Russian CT2DIC files were additionally downloaded from the CT2 repository and loaded in the local verification environment:

Dictionary Validated complete entries SHA-256
German 100,000 780f5c24cd47988455727c6d3f22b1332f2086a21160d647fe3d8a8dc64cecb3
Russian 10,394 a795d2988b8f9cb25c8731bacf24ea26baa73290bc8da2cb2067650ea9c53676

Those larger dictionary files are not bundled. Their Unicode alphabets and entry totals loaded successfully with the corrected parser.

Reproducible sample models

python examples/train_examples.py successfully produces eleven examples:

  • Word CTWM1 orders 1, 2 and 3, including sentence markers.
  • Syllable CTLS2 orders 1, 2, 3 and 7.
  • Dense character CTLS2 orders 2 and 3 with old-reader-compatible prefixes.
  • Sparse word and dense syllable bigram models with custom markers and selected punctuation. Their retained period deliberately does not terminate a sentence.

The word example has exactly two occurrences of ("I", "am") and ("<START>", "I"). All sample binaries are included together with their source corpora and reproduction script. These are functional demonstrations, not representative trained models for a natural language.

The new examples/train_punctuation_examples.py checks every observed bigram against independent handwritten counts after saving and reloading: 16 windows and 14 distinct bigrams in the word model, 11 windows and 10 distinct bigrams in the syllable model. Each contains two independent sequences.

Performance

The benchmark validates keys and numeric scores before recording timings. It compares identical float32 score tables and candidate token IDs, separates prepared access from full scoring, and uses cyclically interleaved timing order. Nine samples, warmups, environment, loop counts and individual timings are retained in benchmarks/results.json; the readable report is benchmarks/RESULTS.md.

Measurements cover n=2..5 and lengths 16/64/256/4096, plus large word vocabularies and high-order syllable keys. The exact legacy adapter is measured separately. Performance claims are limited to the recorded synthetic workloads.

The 2.1 punctuation extension and 2.2 English defaults change preprocessing, configuration and examples only. All eight source fingerprints recorded by the benchmark still match the benchmark and scoring implementations byte for byte. The previous timing results are retained; no fresh timing run is claimed. Enlarging an alphabet can affect working-set size and cache behavior even when the lookup code is unchanged.

Packaging and scope

The project builds a py3-none-any wheel using its declared Poetry backend; NumPy is now declared as a runtime dependency and the lslp entry point is included. All 21 package Python files in the built wheel were compared byte for byte against the checkout. The wheel was installed, the 136-test suite run, and the installed lslp train / lslp inspect commands exercised with custom markers and separate punctuation/ending JSON files. Exact loaded counts and marker IDs were checked. The report is docs/PACKAGE_CHECK.txt.

No Windows interpreter, full C# CrypTool application, real cryptanalysis solver or large language-training corpus was executed here. Compatibility evidence consists of the original binary fixtures, an independent legacy Python reader and the unchanged original Python scoring implementations. The generator does not claim language-specific syllabification or advanced sentence segmentation.