Skip to content

fix(three): publish pending layout on read - #240

Open
krispya wants to merge 20 commits into
mainfrom
feat/commit-on-read
Open

krispya wants to merge 20 commits into
mainfrom
feat/commit-on-read

Conversation

@krispya

@krispya krispya commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

Superseded by merged #299. Main 9022bb40 preserves existing public signatures and supplies current desired placement/caret/selection reads and independent split() copies synchronously without source or whole-root publication. Exact-head review, all five CI jobs and glyph Labs passed (2 faster / 0 slower / 10 neutral). This PR's publish-on-read implementation remains held and must not land alongside #299. #247 remains open; rope draft #292 is held.


Mounted Text measurement, caret, selection and split reads publish pending layout through the ordinary engine-wide batch before answering. Publication-before-copy is preserved, and the next unchanged draw reuses the accepted result.

Updated onto current main, including readGlyphs(), split() and the Wasm fallback follow-up. Combined local verification passes: all package builds, source/public/Labs types, 111 focused tests, 277 package tests, 864 complete Node tests, both migration fixture suites, 17 benchmark workflow tests and docs validation.

Performance gate remains open. The previous full Labs run at 961c852 timed out after 90 minutes: artifact preparation took seconds; the 30-case read-publication matrix took 28m 24s on baseline and more than 41m 59s on candidate before cancellation, without a candidate report. A prior comparison reproduced large regressions when editing and reading each label in turn in a 1,000-label root. #247 must resolve that repeated root publication cost. No current-head no-regression claim is made.

The selected benchmark:read-publication suite covers the changed reads, batched and interleaved schedules, and cold load/split copies. This focused exact-head CI comparison is requested to complete the workload report within the existing job budget; cold/full confirmation remains required before release. Hold merge until regression evidence is resolved.

@krispya krispya changed the title feat/commit on read fix(three): publish pending layout on read Sep 27, 2026
@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

size-limit report 📦

Surface gzip Surface gzip
Core JS 88.2 kB (0%) Inter font · Bitmap 558.2 kB (0%)
Shaper Wasm 536.1 kB (0%) Inter font · MTSDF 8.17 MB (0%)
Three.js adapter JS 136.4 kB (+0.16%) Inter font · Slug 618.3 kB (0%)
React adapter JS 136.1 kB (+0.18%) Font Awesome icons · Bitmap 449.9 kB (0%)
Vue adapter JS 135.7 kB (+0.18%) Font Awesome icons · MTSDF 8.76 MB (0%)
R3F hello-world app JS 742.5 kB (+0.03%) Font Awesome icons · Slug 657.9 kB (0%)
Tres playground app JS 566.5 kB (+0.04%) Bitmap baker JS 4.9 kB (0%)
Font validator JS 144.6 kB (0%) Bitmap baker Wasm 231.1 kB (0%)
Runtime bake host JS 6.1 kB (0%) MTSDF baker JS 5.6 kB (0%)
Runtime bake Worker JS 13.5 kB (0%) MTSDF baker Wasm 215.5 kB (0%)
Font baker JS 2.6 kB (0%) Slug baker JS 4.5 kB (0%)
Font baker Wasm 389.0 kB (0%) Slug baker Wasm 183.7 kB (0%)

thejustinwalsh and others added 2 commits September 29, 2026 13:39
Brings in the installed-package Labs suites (#215). The package runner keeps
main's --suite selection, which replaces this branch's --filter option; the
read-publication workloads move into the suite layout in the next commit.
Move the read-publication workloads from glyph-package.bench.ts, unchanged,
into benches/labs/package/read-publication.bench.ts with their helpers in
read-publication.ts. Cases that repeat work on mounted labels form the new
read-publication suite; cases whose every call mounts new text join the
cold suite, so each suite times alike. The fixture exports its font and an
empty label scene for workloads that mount their own text.

Co-authored-by: Kris Baumgartner <kjbaumgartner@gmail.com>
@thejustinwalsh thejustinwalsh added the benchmark:read-publication Run the focused read-publication Labs suite label Sep 29, 2026
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Docs report 📚

Every changed package is attested at this head. A reviewer verifies each claim after merge.

Package Concept Attestation Status
@pmndrs/glyph-benchmarks packages/benchmarks.md · edited Combine both old-canary adapters after their prototype binding; migrate read-publication split calls and indexed type k… ✅
@pmndrs/glyph packages/glyph.md · edited Reviewed the combined commit-on-read source after merging origin/main #258. Preserved publication-before-split, readGly… ✅

✅ attested · ⚠️ stale · ❌ missing

@thejustinwalsh thejustinwalsh added the benchmark:full Run the full package Labs matrix label Oct 5, 2026 — with Claude
@thejustinwalsh thejustinwalsh added this to the 0.2.0 milestone Oct 5, 2026 — with Claude
@thejustinwalsh thejustinwalsh removed the benchmark:full Run the full package Labs matrix label Oct 5, 2026 — with Claude
# Conflicts:
#	benches/scripts/run-package-labs.mts
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Package performance: read-publication suite

0 faster · 4 slower · 12 neutral · 2 skipped

Baseline 0.1.0-canary-2ab37fda-20261008 → candidate 0.1.0 (ef316833)

                                                faster ◀       ┊       ▶ slower    Δ p50      p  baseline   candidate
- scene 1000 each: 100 rolling tickers                         ┊              ▶  +2553.8%  <.001  █▁▁▁▁▁▁▁▁▁ ▁▁▁▁▁▁▁▁▅█
- scene 1000 each: edit 50 lines and carets                    ┊              ▶  +1194.6%  <.001  █▁▁▁▁▁▁▁▁▁ ▁▁▁▁▁▁▁▁█▄
- scene 100 each: 100 rolling tickers                          ┊              ▶  +456.8%  <.001  █▂▁▁▁▁▁▁▁▁ ▁▁▁▁▁▁▁▇█▂
- scene 100 each: edit 50 lines and carets                     ┊              ▶  +349.6%  <.001  █▁▁▁▁▁▁▁▁▁ ▁▁▁▁▁▁▁█▂▁
  scene 1: click to place the caret                           ├┼●─┤                +4.3%   .130  ▁▃▆█▆▄▄▃▂▂ ▁▂▅█▅▂▅▆▂▂
  scene 100 batched: 100 rolling tickers                       ├●┤                 +3.7%   .021  ▅█▆▅▄▃▃▄▃▂ ▃█▄▃▆▄▄▂▃▁
  scene 1000 batched: edit 50 lines and carets                 ├●                  +2.3%   .130  ▂▅▅▇█▇▅▃▄▃ ▁▂▄▇█▇▇▄▄▂
  edit a label and draw without reading layout                ├┼●┤                 +2.2%   .382  ▃█▇█▃▃▂▄▅▃ ▄▅█▇▆▃▅▅▄▁
  scene 1: type in a text field                               ├●┤                  +0.6%   .959  ▂▇█▆▇▆▇▅▄▁ ▂▇▅▅██▅▅▅▃
  scene 100 batched: edit 50 lines and carets                ├─●┤                  -0.2%  1.000  ▂▇█▆██▄▄▁▁ ▂▅█▅▆▅▅▄▂▂
  scene 1000: 100 tickers without layout reads                ├●                   -0.5%   .505  ▂▇██▆▆▅▂▂▂ ▃█▇▇▆▄▃▁▁▁
  edit a label and read its glyphs                           ├─●┤                  -0.9%   .959  ▃██▅▃▄▃▃▃▂ ▃█▆▃▃▄▄▃▁▁
  scene 1000: click to place the caret                       ├─●─┤                 -1.0%  1.000  ▁▅▆█▆▄▃▂▁▁ ▂▅▇█▅▄▂▂▁▁
  scene 100: click to place the caret                        ├●┼┤                  -2.1%   .574  ▂█▅▄▂▂▃▃▂▂ ▃██▅▂▂▃▃▅▁
  scene 100: 100 tickers without layout reads                ├●┼─┤                 -2.1%   .645  ▄█▆▃▄▃▄▄▃▁ ▄█▄▄▃▃▂▄▂▁
  scene 100: type in a text field                            ├●┤                   -4.0%   .130  ▃▇▇█▇▃▅▂▃▂ ▃█▇▅▅▃▃▂▂▁
                                                └──────────────┴──────────────┘
                                                -50%           0           +50%
status bench baseline candidate Δ p50 p 95% CI
🔴 slower scene 1000 each: 100 rolling tickers 31.23ms 828.85ms +2553.8% <.001 +2437.3..+2594.8%
🔴 slower scene 1000 each: edit 50 lines and carets 24.78ms 320.79ms +1194.6% <.001 +1165.8..+1211.7%
🔴 slower scene 100 each: 100 rolling tickers 18.50ms 102.99ms +456.8% <.001 +446.0..+472.3%
🔴 slower scene 100 each: edit 50 lines and carets 16.15ms 72.59ms +349.6% <.001 +336.5..+363.1%
12 neutral, 2 skipped
status bench baseline candidate Δ p50 p 95% CI
neutral edit a label and read its glyphs 2.03ms 2.02ms -0.9% .959 -5.8..+3.9%
neutral edit a label and draw without reading layout 1.60ms 1.63ms +2.2% .382 -2.4..+7.4%
neutral scene 1: type in a text field 2.27ms 2.28ms +0.6% .959 -2.6..+4.5%
neutral scene 1: click to place the caret 293.31µs 305.94µs +4.3% .130 -1.9..+9.5%
neutral scene 100: type in a text field 3.09ms 2.97ms -4.0% .130 -7.0..+0.9%
neutral scene 100: click to place the caret 412.13µs 403.59µs -2.1% .574 -6.8..+4.5%
neutral scene 100 batched: edit 50 lines and carets 16.13ms 16.09ms -0.2% 1.000 -5.9..+3.0%
neutral scene 100 batched: 100 rolling tickers 18.44ms 19.13ms +3.7% .021 +0.3..+6.8%
neutral scene 100: 100 tickers without layout reads 6.22ms 6.09ms -2.1% .645 -6.9..+5.7%
neutral scene 1000: click to place the caret 1.44ms 1.43ms -1.0% 1.000 -6.0..+6.7%
neutral scene 1000 batched: edit 50 lines and carets 25.08ms 25.67ms +2.3% .130 -0.4..+4.4%
neutral scene 1000: 100 tickers without layout reads 15.65ms 15.57ms -0.5% .505 -4.6..+0.9%
skipped: clock-confounded: neutral→slower · 2.42→2.62 scene 1000: type in a text field
skipped: clock-confounded: neutral→slower · 2.43→2.59 scene 1000 batched: 100 rolling tickers

# Conflicts:
#	packages/glyph/src/three/text.ts
@thejustinwalsh thejustinwalsh added benchmark:full Run the full package Labs matrix and removed benchmark:read-publication Run the focused read-publication Labs suite labels Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

benchmark:read-publication Run the focused read-publication Labs suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants