dns: IDNA, joining and bidi data and natives, teach the compiler (commit 1 of 2 for UTS #46) #364
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Context
Commit 1 of 2 for the IDNA data of
std/dns(the use is #365). DNS.md section 3 lists whatstd/dnscannot do without tables: the full mapping (IdnaMappingTable.txt), the disallowed code points, the "starts with a combining mark" rule (general category), CONTEXTJ (joining type, virama), CONTEXTO (scripts Greek, Hebrew, Hiragana/Katakana/Han) and the Bidi rule (RFC 5893, bidi class). This issue brings that data, the runtime functions and the natives rows, and declares nothing instd/; the use is #365 and waits for a published seed (theBufferprecedent #299 / #54).Depends on
#36 (generator, pinned data, fetch script). Independent of the normalization issues.
Decisions (refinement)
std/dns, not publicCharAPI:private nativefunctions instd/dns(precedent:networkNameServersinstd/network). A publicChar.category/Char.bidiClassis a 1.0 commitment nobody has asked for yet;std/dnsis the only consumer. If the natives manifest cannot name a native of a non-core package, the implementer puts them on a private type instd/textand reports it in the PR.Intin, smallIntcode out (no allocation):idnaStatus(point)(disallowed, ignored, mapped, deviation, valid, plus thedisallowed_STD3_*variants),idnaMapping(point)(the mapped code points, as a short list appended to a caller'sArrayList<Int>),generalCategory(point),joiningType(point),bidiClass(point),canonicalCombiningClass(point)(virama is ccc 9),script(point)(only the scripts CONTEXTO names: Greek, Hebrew, Hiragana, Katakana, Han;Otherfor the rest).IdnaMappingTable.txt(Public/17.0.0/idna/),extracted/DerivedJoiningType.txt,extracted/DerivedBidiClass.txt,Scripts.txt,IdnaTestV2.txt.Acceptance criteria
tools/fetch-unicode.shextended with the inputs above and their SHA-256s; output reproducible as in #36.compiler/src/backend/c/natives.trb; header andmachine_natives.cregenerated; VM and native agree.ß ς ZWJ ZWNJ, the CONTEXTO code points, an Arabic, a Hebrew, a Latin and a number code point per bidi class).compiler/tests/natives.test.trb: each row exists and is ready.std/,seed/,tests/conformance/. Tier A and B green. After the merge the seed is published (forge Actions ->seed); not part of this PR.Seed impact
Yes: new natives (commit 1 of 2).
Size
One PR, two Conventional Commits:
feat(text): IDNA, joining and bidi data in the generated Unicode tablesandfeat(runtime): the lookups of the IDNA data and their natives rows.[loop:torbscript] refine: body written by the refinement of #36 (goal, criteria, decisions, seed impact, size are in it). next: waiting (depends on #36 being merged)
[loop:torbscript] decided by the loop: the only dependency, #36, has landed (commit
c3eee74a31); body already states goal, criteria, seed impact (new natives, commit 1 of 2) and size. Definition of ready met, labelledready.[loop:torbscript] claim implement by session:loop-torbscript-20261016 until 2026-10-16T04:03Z
[loop:torbscript] implement: #376 opened (two commits,
17bd8da6data andab769db4natives; tier A, tier B, bootstrap, every-host-same-C, gates and pdisc green on the head), reviewed and merged by Argus, next: waiting (commit 2 of 2 for UTS #46, which builds on these natives).Measured in forge CI (tier B,
tools/size-cost.sh, headab769db4):idna_data.o60,064 bytes,idna.o1,477 bytes.runtime/tests/idna-excerpt.txt, 284 code points, always checked; the full 0x110000 check runs where CI has fetched the pinned files.Notes:
disallowed_STD3_*statuses, so the generator accepts the five that exist (disallowed, ignored, mapped, deviation, valid). The issue text mentions the STD3 ones.runtime/README.md"The IDNA tables" has no measured size table yet (the numbers above came back after the merge). Fold it into the next commit.Worker tokens: not measurable from inside the session; two context windows, roughly 150 tool calls.