Skip to content

INL1a 3/5 (B2): the inline core (CSS2 §10.8 over inline boxes and <br>s) and the 3000-case engine-inline differential corpus - #89

Open
thejackshelton wants to merge 4 commits into
review/inl1a-inputfrom
inl1a-core
Open

thejackshelton wants to merge 4 commits into
review/inl1a-inputfrom
inl1a-core

Conversation

@thejackshelton

Copy link
Copy Markdown
Contributor

INL1a part B2: the inline core and its differential corpus. Stacked on B1 (#88).

Stacked, lands as train 3. This is the second of four stacked PRs (B1 → B2 → C1 → C2). Its base is review/inl1a-input, pushed at B1's head 70fa043, so this diff is B2's alone. They land as train 3, after train 2 (REPL-a); master is merged in during the train's catch-up.

What changed

  • Inline core: inline.ts lays out the inline formatting context over items (CSS2 §10.8):
    • the strut and inline boxes set each line's height and baseline;
    • a <br> forces a break;
    • inline boxes get line fragments <box>:line<j> and a bounding rect;
    • leaves, inline boxes and <br>s are children of the container in tree order.
  • B1's temporary refusal is gone: box.ts inlineTextLeaves and the inline-box code are removed.
  • New typed refusals:
    • inline-box-decoration: inline-axis margins, padding or borders (INL1b).
    • vertical-align other than baseline (INL2).
    • inline-box-position, inline-empty-line and mixed-text-wrap-mode.
  • Edge cases:
  • Planted engine faults: lineHeightIgnoresInlineBoxes, halfLeadingUnflooredPerBox, brIgnored, breakAtBoxBoundary and fragmentFromLineTop. Each one moves an INL-P case off Chrome.
  • Native runtime and break programs: the DragonTree text placement and the Swift and Kotlin break programs build the context with the translated buildIfc and placeIfcLines. They walk inline boxes to find a leaf's container, skip replaced leaves, and throw on a rect that is no node of the input.
  • Replaced leaves (REPL-a): the inline engine work predates them, so this PR handles them in four places: the no-strut checks in block.ts and intrinsic.ts, inline.ts inlineChildren, and line-breaks.ts in TS, Swift and Kotlin.
  • Differential corpus: the 3000-case engine-inline suite is appended after every earlier corpus-dpr suite. Its cases are nested inline boxes of mixed sizes and line-heights, with <br>s, Ahem punctuation and U+200B, at every DPR, some with a plant.
    • Its inline style carries aspectRatio: auto, master's T050 field, which the generator's validateLayoutInput guard requires.
    • targets.ts declares the suite (from corpus-dpr.json engineInline), so the Swift and Kotlin host lanes judge it. Both pass.
  • Regenerated outputs (own commit, pnpm regen, fixed point after 3 passes): the translated engines, corpus.json and corpus-dpr.json, and the lanes.json host lanes. No vector, capture, break, pixel or WPT output changed, so the inline core reproduces every existing text layout byte for byte.

Tests and pins changed, with reasons

  • inline-box.test.ts (new): compares INL-P families 1 to 3 (docs/research/inline-spike/probe, Chrome 145.0.7632.6) with Chrome at DPR 1, 2, 3 and 2.625, in ltr and rtl. It also lists the refused cases with their codes. Its validator block is dropped because B1's inline-input.test.ts already has the same checks.
  • inline-input.test.ts: drops B1's refusal tests, because that refusal no longer exists. It keeps the environment test.
  • lanes.test: engine-inline joins the suites the host lane judges and the dropped-suite failures. The T125 pin of master's committed native output keeps its 13 suites, because that file predates engine-inline (separate commit 41eaee8).
  • translate suite-list pins (corpus-dpr, native-dpr-swift, native-dpr-kotlin): engine-inline is appended, and corpus-dpr pins its 3000 cases.

What passed (host-side)

  • tsc -b passes.
  • layout:subset reports 0 violations.
  • Layout tests pass 1078/1078, including inline-box.test.ts.
  • The Swift and Kotlin host lanes pass with the engine-inline suite.
  • pnpm test fails only the device-evidence tests (lanes, lanes-records, lanes-concurrent, device-failures, p6a-promotion). They wait for the train's device run and second regen. No device run has been done for this head.

Size

About 124 KB of reviewed diff after .macroscope/ignore.md (18 files).

🤖 Generated with Claude Code

… over items (CSS2 §10.8: the strut and inline boxes set each line's height and baseline, <br> forces a break, inline boxes get line fragments <box>:line<j>), replacing B1's inline-box refusal (box.ts inlineTextLeaves removed); refusals inline-box-decoration, vertical-align, inline-box-position, inline-empty-line and mixed-text-wrap-mode; a context with no line boxes lets margins collapse through its container (CSS2 §9.4.2); plants lineHeightIgnoresInlineBoxes, halfLeadingUnflooredPerBox, brIgnored, breakAtBoxBoundary and fragmentFromLineTop; the native runtime and the Swift and Kotlin break programs build the context with buildIfc and placeIfcLines and skip replaced leaves; inline-box.test.ts compares INL-P families 1 to 3 with Chrome at every DPR and direction; the engine-inline differential suite (3000 generated inline contexts) is appended to corpus-dpr.ts
…er's T050 field, absent when the suite was written; the generator's validateLayoutInput guard refused it); targets.ts declares the extended/engine-inline suite from corpus-dpr.json engineInline, so the host lane judges it, and lanes.test pins it among the suite lines and the dropped-suite failures
…(fixed point after 3 passes; the translated Swift and Kotlin engines with the inline core, corpus.json and corpus-dpr.json digests with the 3000-case engine-inline suite, lanes.json host lanes, which pass on Swift and Kotlin; no vector, capture, break, pixel or wpt output changes)
…s 13 suites (that file predates engine-inline; only the judged suite list gains it)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant