Repository navigation
Conversation
…orpora (#119) 43 shipped alphabets name training files that were never added to Data/training although the engine ships a compatible corpus for the same language and script (e.g. Espanol asks for training_spanish_ES.txt while training_wa_es_Latn.txt ships). Only the Apple frontend papered over this at packaging time; every other frontend started those alphabets untrained. Resolution is data-only (zero engine changes): the new committed Scripts/resolve-training-corpora.py materializes an alias corpus file under each legacy name from the canonical training_wa_<lang>_<script> corpus for the alphabet's EXACT (lang, script) index key, so the engine's existing exact-filename lookup finds it. Deliberately conservative so it cannot pick a wrong corpus: - the target is derived from the exact (lang, script) pair alone - no fuzzy matching, no runtime language inference; every mapping is a visible file in this diff - conversion != none alphabets (Mandarin/pinyin) are excluded - corrupt/missing lang metadata fails closed: the 'Pure Katakana' alphabets (tagged lang=ak, Akan) stay untrained rather than risk a wrong-language corpus; note the three Japanese corpora (ja_Hira, ja_Jpan, ja_Kana) ship byte-identical, so the Kana-tagged 'Japanese Canna' alphabet cannot receive a wrong-script distribution - existing files are never overwritten - real corpora added later and user training accumulated under legacy names keep their scope - combining-accents alphabets receive NFD-normalized copies (their symbols are decomposed; the wa_ corpora are NFC) 31 alias files cover 43 alphabets (4 NFD variants); 46 alphabets stay untrained by design (no canonical corpus ships for their pair). The index gains exactly the 43 training_available flips (summaries now 194/46), and Makefile.am registers the new files - which also fixes a pre-existing packaging gap: gamemode_en_Latn.txt and gamemode_english_GB.txt had never been listed in dist_pkgdata_DATA, so autotools installs silently omitted the game-mode texts. Accepted limitations: 'English, lower case' and 'Jane Austen English Lower Case' stay untrained (lang=en but script=null in the index - generator script-detection gap, out of scope here); training_latex_GB and training_emma_GB alias the generic wa_en_Latn prose (right language, no genre flavour); Data/training grows ~13MB, which size-sensitive packaging inherits. tests/test_training_corpora.cpp pins the invariants: index/files consistency incl. summary counters, completeness (a newly resolvable alphabet fails the build until the resolver is rerun), unresolvable sentinels stay reported-missing, NFC aliases are byte-exact and NFD aliases genuinely decomposed, Spanish and its NFD variant start trained with no missing-corpus message, and the same alphabet minus the alias file still reports the missing corpus exactly as before. Fixes #119 Signed-off-by: will wade <willwade@gmail.com>
\u00f1 escapes in narrow string literals compile to a single CP1252 byte under MSVC (the project does not pass /utf-8), so the Windows CI received 0xF1 where the engine's UTF-8 API contract requires 0xC3 0xB1 - the alphabet lookup missed and a downstream narrow/wide conversion threw 'No mapping for the Unicode character exists in the target multi-byte code page'. Raw UTF-8 source literals round-trip through MSVC unchanged; same pattern the Windows-green test_multilingual.cpp already uses. Signed-off-by: will wade <willwade@gmail.com>
This was referenced Nov 18, 2026
willwade
added a commit
that referenced
this pull request
Nov 18, 2026
* ci: run macOS matrix legs on tag releases only The hosted macos-15 pool kept reclaiming jobs mid-run (random cancellations at 5-28 minutes across three rerun rounds on PR #121 - each leg passed on at least one round, so pool weather, not code; the macos-latest pool did the same on Nov 9, see #117). PR and branch-push CI now gates on Linux + Windows (+ Sanitize, clang-tidy, clang-format); the full macOS matrix runs on v* tags so every release is still fully tested on macOS, and release.yml keeps building the macOS binaries from the same tag. The branch ruleset's required checks drop the four macOS contexts to match (done via the rulesets API alongside this change). Signed-off-by: will wade <willwade@gmail.com> * fix(ci): macOS matrix as its own tag-only job The previous attempt put a matrix-context if: on the shared build-test job; that is not valid in jobs.<id>.if, and GitHub dropped the whole workflow (run concluded 'workflow file issue' with no jobs). Split the four macOS combos into a build-test-macos job gated on v* tags using only the github context, keep build-test to Linux + Windows, and give the mac job a 45-minute timeout for the slower hosted pool. Signed-off-by: will wade <willwade@gmail.com> --------- Signed-off-by: will wade <willwade@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
43 shipped alphabets name training files that never shipped, although a compatible corpus exists for the same language and script (Español asks for
training_spanish_ES.txt;training_wa_es_Latn.txtships). Data-only fix, zero engine changes:Scripts/resolve-training-corpora.py(committed, idempotent,--dry-run) materializes an alias corpus under each legacy name from the canonicaltraining_wa_<lang>_<script>.txt, so the engine's existing exact-filename lookup finds it. 31 alias files (4 NFD variants), index gains exactly the 43training_availableflips (summaries 194/46), Makefile.am registers everything.Can this pick the WRONG corpus? (the design constraint)
Every rule exists to make that impossible, and each was verified against the data:
(lang, script)key only — the target filename is derived from the pair, never fuzzy matching or runtime inference. Spanish has exactly one Spanish corpus (wa_es_Latn.txt, verified real Spanish); there is no second candidate to confuse it with.lang=ak(Akan — corrupt) → nowa_akcorpus → they stay untrained rather than risk a wrong-language corpus.wa_ja_Hira/wa_ja_Jpan/wa_ja_Kanaare byte-identical (same md5), so the Kana-tagged "Japanese Canna" alphabet (mixed kana nodes) cannot receive a wrong-script distribution.conversion != "none"— their training files have conversion-specific formats).wa_corpora are NFC).Every mapping is a visible file in the diff — audit line by line.
Scope notes (deliberate, for reviewers)
gamemode_en_Latn.txt/gamemode_english_GB.txthad never been listed indist_pkgdata_DATA— autotools installs silently omitted the game-mode texts. Now registered.lang=en, script=null— generator script-detection gap, out of scope);training_latex_GB/training_emma_GBalias genericwa_en_Latnprose (right language, no genre flavour);Data/traininggrows ~13MB.Coverage (
tests/test_training_corpora.cpp, 7 tests)Validation
-Werror; Makefile.am verified parseable (make -fbehaves identically to HEAD)generate-alphabet-index.pyreproduces the staged index byte-identically exceptgenerated_utcFixes #119