Repository navigation
Conversation
nfkd_data.zig is 24,459 generated lines whose provenance header named .agents/tools/gen_nfkd_tables.py, a path that is not in this repository. The table could therefore not be regenerated or checked from a clean checkout, and nothing in CI noticed if it drifted from the Unicode database it claims. tools/zig/nfkd_tables.py reproduces the committed table exactly: the regenerated file differs only in its header and in reflowed comments, and the sole new declaration is `pub const version`, which unicode_data.zig also carries. It follows unicode_tables.py's conventions, including refusing to run on an interpreter whose unicodedata is not 16.0.0. The check runs in the no-GPU workflow, and tools/zig/test_nfkd_tables.py covers the reproduction, the header, the pinned version and the guard: removing the guard fails two of its five tests. Verified with zig build test (115 binaries, none failing), both generators' --check, and lean_check.py reporting nothing in the touched files.
ubuntu-latest's python3 is 3.12, whose unicodedata is 15.0.0, so the generator's version guard refused to run rather than emit tables from the wrong UCD release. The guard behaved correctly; the workflow assumed an interpreter it did not have. setup-python supplies 3.14, which carries 16.0.0, and the step reaches it by its python-path output so later steps keep their own python3. The generator's tests now run in the same job against the same interpreter.
|
Thanks @akol1 for giving - Synthema, Ash's AI Assistant. |
…de, pin setup-python The reproduction test skips when unicodedata is not 16.0.0, as the version test beside it does, instead of failing. actions/setup-python is pinned to a26af69 (v5.6.0), the commit pack-compare.yml uses, as every other action is pinned. The workflow comment on the generator's Unicode guard goes from 129 to 109 columns, within the 120-column rule.
|
Thanks @akol1, this is landed on main as 65b4f13 and 9a52175 with you as the author, plus our small commit bd26436 on top, as promised: the reproduction test now skips on an interpreter whose Unicode is not 16.0.0, - Synthema, Ash's AI Assistant. |
What this changes
zig/src/core/tokenizer/nfkd_data.zigis 24,459 generated lines, and nothing in the tree generates or checks it. Its provenance header named.agents/tools/gen_nfkd_tables.py, which is not in this repository, so the table could not be regenerated or verified from a clean checkout — and CI would not have noticed if it drifted from the Unicode database it claims to come from.This adds that generator as
tools/zig/nfkd_tables.py, wires its--checkinto the no-GPU workflow, and covers it with tests.The generator reproduces the committed table exactly. Regenerating changes no data: the diff is the header and three reflowed comments, plus one added declaration:
.agents/one;pub const version = "16.0.0";, whichunicode_data.zigalready carries from its own generator;So this is a provenance repair rather than a data change. Reviewers can confirm the tables are untouched by diffing the file: every
sequences,decompositions,cccs,lower_sequences,lowercasesandmarksline is byte-identical.It follows
unicode_tables.py's conventions deliberately — the sameROOT/OUT/VERSIONshape, the same single-line provenance header, the samepub const versiondeclaration, and the same refusal to run on an interpreter whoseunicodedatais not pinned to 16.0.0. That guard is what stops a newer Python from silently emitting tables from a different UCD release.What it does not change
No runtime behaviour, no model code, no build graph. The Zig source the engine compiles is unchanged apart from the added
versionconstant, which nothing reads.Receipt
Environment. macOS on Apple silicon, Zig 0.17.0, Python 3.14 with
unicodedata16.0.0.Commit.
f2ef56403onpr-nfkd-tables, two commits on top ofmainatd1018b318.Checkpoint and revision. None; this touches no model path.
Exactness.
nfkd_data.zigis unchanged as data.tools/zig/nfkd_tables.py --checkexits 0 against the committed file and exits 1 when a single stray declaration is appended, so the check is known to bite rather than merely to pass.Tests.
zig build test: all 115 test binaries exit 0 when run directly.tools/zig/test_nfkd_tables.py: 5 tests pass — reproduction, header, pinned version, refusal on the wrongunicodedata, and that the refusal happens before the table is written. Removing the guard from the generator fails two of the five, which is how I know the tests are not vacuous.tools/zig/unicode_tables.py --checkandtools/zig/nfkd_tables.py --checkboth exit 0 on this branch.lean_check.pyreports no finding in the touched files;git diff --checkis clean.CI. The
zigjob passes, including both steps this PR adds, "NFKD tables are current" and "NFKD generator tests".The first CI run failed, and the failure is worth knowing about:
ubuntu-latest'spython3is 3.12, whoseunicodedatais 15.0.0, so the generator's version guard refused to run rather than emit tables from the wrong UCD release. The guard did exactly its job; my workflow step had assumed an interpreter it did not have. Python 3.14 carries 16.0.0 (3.12 is 15.0.0, 3.13 is 15.1.0), so the second commit pins 3.14 viasetup-pythonand reaches it through that action'spython-pathoutput, leavingpython3for the other steps as it was.zig-windowsfails, and it is not this change. It fails insidezig build testonzig/src/fabric/tp/{bootstrap,fate,sock,fate_test}.zigandzig/src/core/digest_key.zigwith Windows calling-convention andws2_32member errors, which is std-library socket code compiled for a target it does not support. The namenfkdappears nowhere in that log, and no file this PR touches is in the error list. The samezig-windows: failurewithzig: successsignature appears onmain's ownornith-mainrun, so this is pre-existing separate work.Not run, and why. No GPU step is affected and this change touches no kernel, so no device run was warranted. I did not reproduce that failure locally either; the
ornith-mainrun is the evidence that it predates this branch.Checklist
Suggested by @ashhart in the #825 stack review as a change that could land on its own.