feat(runtime): NFC, NFD, NFKC and NFKD on texts, and their natives rows #369
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/362-normalization-natives"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #362
Task
Commit 1 of 2 for NFC and NFKC (torbscript/language#362): normalization data in the generated Unicode tables, the four runtime functions and their ready natives rows. std declares the rows later (#363), so nothing in
std/changes.What
tools/unicode/generate.trbalso readsDerivedNormalizationProps.txtandUnicodeData.txtand writesruntime/normalization_data.c(86,946 bytes, budget 100 KiB). Inputs are pinned inSHA256SUMS.runtime/normalization.c:torb_text_to_nfc/nfd/nfkc/nfkd(UAX #15). Already-normal text (quick check, ASCII fast path) returns the same storage; invalid UTF-8 is returned unchanged. Hangul is arithmetic.natives.trb: rowsString.toNfc/toNfd/toNfkc/toNfkd, anormalizationpart (likeunicode), so a program that does not call one carries neithernormalization.cnor its tables.torb_natives.handmachine_natives.cregenerated; the VM calls the same functions.tools/size-cost.sh+ tier-B step: hello-world release build before/after (see below).Test
runtime/tests/normalization_test.c: wholeNormalizationTest.txtof the pinned version when present (CI fetches it), committed excerpt otherwise; idempotence; code points not listed in Part 1 unchanged; ASCII same storage. Run locally with a reduced harness against the full file and the excerpt: 14 tests, 0 failed.compiler/tests/natives.test.trb: four rows exist, are ready, name their symbol;nativeSymbols()lists them.docs skill --check,pdisc check,tools/check-commits.sh: clean. Tier A/B: CI.Size
Measured in tier B of this PR (
tools/size-cost.sh), hello-world native--release:c3eee74a31)normalization.ocodenormalization_data.otablesThe full
NormalizationTest.txt(20,034 lines) ran in CI: 302 runtime tests, 0 failed.Review of
8976ce1(CI green for this head). The code, tests and wiring check out; one acceptance gap blocks the merge.Findings
runtime/README.mdand the PR body. ... a program that does not use them must not grow by more than 4 KiB." The PR body still reads## Size/SIZE_PENDING, andruntime/README.md("The normalization tables") defers to "stated in the pull request".tools/size-cost.shis a measurement that always exits 0, so the green tier B proves nothing about the bound. Please take the output of thesh tools/size-cost.shstep from the tier B job of this head (object sizes, hello-world before/after, delta) and put it in the PR body in place ofSIZE_PENDING. If the delta is above 4096 bytes, that is a defect in the part split and needs a fix. This is a PR-body edit, no new commit is needed unless the delta is over the bound; if you add a commit, I re-review only that and this finding.Checked, ok
runtime/tests/normalization_test.c(whole NormalizationTest.txt when fetched, committed excerpt otherwise, idempotence, ASCII same storage);compiler/tests/natives.test.trbfor the four rows,nativeSymbols()and the driver predicate. Tier A, tier B, pdisc, commit messages green.std/,seed/,tests/conformance/); no crons or automations.machine_natives.crenumbering is consistent (count 294), part thunks guarded byTORB_WITHOUT_NORMALIZATION, same shape as the Unicode part.gates.ymlchange addsfetch-depth: 0and a measurement step only. The file has nopermissions:key by design (header: a reusable workflow that asks for no token), and its jobs demonstrably ran on this head, so I do not treat it as a false green.Non-blocking
8976ce1d41c4e52a6f9cReview of
c4e52a6(CI green for this head, tier A, tier B, pdisc, commit messages).Earlier finding
runtime/README.mdnow state the measured numbers: hello-world native--release376,264 -> 376,456 (+192, bound 4,096),normalization.o3,405,normalization_data.o87,010 (data 86,946, under the 100 KiB budget). The figures are internally consistent (86,946 data bytes plus object overhead = 87,010) and the delta is far below the bound, so the part split works. I could not open the tier B job log with my token and took the numbers from the PR body.Checked, ok
Non-blocking