Skip to content

perf(text): profile MTSDF baker phases - #8

Merged
thejustinwalsh merged 4 commits into
feat/runtime-raster-coveragefrom
feat/mtsdf-baker-profiling
Aug 4, 2026
Merged

perf(text): profile MTSDF baker phases#8
thejustinwalsh merged 4 commits into
feat/runtime-raster-coveragefrom
feat/mtsdf-baker-profiling

Conversation

@thejustinwalsh

@thejustinwalsh thejustinwalsh commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a package-owned MTSDF baker profiler with small, medium, complete, and all coverage arguments
  • instrument selection, outline extraction, texel generation, packing, KTX2 encoding, and GLB serialization in the shared optimized Rust pipeline
  • measure the shipped Wasm host copy path and a real serial Node Worker, including linear-memory and isolated RSS high-water marks
  • retain exact work counters, payloads, native and Wasm identities, and machine-labeled timing evidence
  • scope compiled admission-module byte identity to its recorded host while requiring foreign hosts to reproduce portable contracts under reviewed ceilings

Finding

Texel generation accounts for 98.8% to 99.7% of measured native pipeline time. Complete Inter generates 7,233,197 texels, visits 227,327,416 colored edges, and spends 25,871.57 of 25,957.06 native milliseconds in texel generation. The shipped Wasm pass is 52,420.37 ms; copying its 39,175,608-byte response takes 4.51 ms and final Worker delivery takes 0.47 ms. This admits the adjacent-texel scalar/SIMD comparison and rejects packing, container, or transfer work as the next optimization target.

Evidence

  • direct Wasm and real Worker artifacts are byte-identical for small, medium, and complete cases
  • same-host evidence is exact; foreign-host evidence must retain the portable contract, synthetic output, zero imports, complete SHA-256 identity, and raw/optimized/gzip/Brotli budgets
  • default and profiling Rust suites pass; profiling preserves exact bake results
  • production Bitmap, MTSDF, and Slug host hashes and sizes remain unchanged
  • this layer's fail-closed autoresearch provenance authenticates its canonical package-size record

Stack

Depends on #7. The adjacent-texel optimization experiment is layered above this measured boundary.

@thejustinwalsh
thejustinwalsh force-pushed the feat/mtsdf-baker-profiling branch 3 times, most recently from fea8669 to 5befc3c Compare August 1, 2026 09:07
@thejustinwalsh
thejustinwalsh force-pushed the feat/mtsdf-baker-profiling branch from 5befc3c to 359b81d Compare August 1, 2026 15:44
@thejustinwalsh
thejustinwalsh marked this pull request as ready for review August 1, 2026 19:33
@thejustinwalsh
thejustinwalsh force-pushed the feat/mtsdf-baker-profiling branch from cf6da9c to 07d1bed Compare August 4, 2026 01:44
@thejustinwalsh
thejustinwalsh merged commit 19353f9 into main Aug 4, 2026
1 check passed
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