Skip to content

Opt plain-text character array into incremental summarization - #27588

Merged
brrichards merged 9 commits into
microsoft:mainfrom
brrichards:inc-summarization
Jun 30, 2026
Merged

Opt plain-text character array into incremental summarization#27588
brrichards merged 9 commits into
microsoft:mainfrom
brrichards:inc-summarization

Conversation

@brrichards

@brrichards brrichards commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Description

Enables Incremental Summariation for plain text. Plain text is contained in large uniform chunks, and will benefit from incremental summarization. Formatted is currently not stored in a way where incremental summarization will provide a benefit compared to the overhead cost of incremental summarization.

Testing

Single test in textDomain.spec.ts that confirms the plain text character array is opted into incremental summarization.

Reviewer Guidance

The review process is outlined on this wiki page.

Copilot AI review requested due to automatic review settings June 23, 2026 17:49
@brrichards
brrichards requested a review from a team as a code owner June 23, 2026 17:49
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Hi! Thank you for opening this PR. Want me to review it?

Based on the diff (44 lines, 1 files), I've queued these reviewers:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

How this works

  • Adjust the reviewer set by ticking/unticking boxes above. Reviewer toggles alone don't trigger anything.

  • Tick Start review below to dispatch the review fleet.

  • After review finishes, tick Start review again to request another run — it auto-resets after each dispatch.

  • This comment updates as new commits land; your reviewer selections are preserved.

  • Start review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

Comment thread packages/dds/tree/src/text/textDomain.ts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a suggestion for documentation we should add. It would also probably be worth adding a changeset document to this PR, since we're surfacing improved functionality that requires user opt-in. We can likely re-use much of the same documentation for both purposes.

@brrichards
brrichards requested a review from a team as a code owner June 23, 2026 21:53
Comment thread .changeset/slick-carpets-kiss.md Outdated
Comment thread packages/dds/tree/src/text/textDomain.ts Outdated
"StringArray",
// Opt the character content into incremental summary optimization.
sf.types([SchemaFactory.string], {
custom: { [incrementalSummaryHint]: true },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking we would just set this in the text editor schema above the TextNodes (both plain and formatted) so we would avoid reencoding the whole plain text when changing the formatted text for example.

Incremental summary chunks are pretty expensive, so even with our larger chunk sizes now, I'm not sure its a win (each one gets included in a top level list of all chunks in the document, complicates container level GC, and has to be referenced by a handle which has a non negligible size not to mention each incremental chunk itself has a lot of boilerplate wrapping it, including another copy of the needed shapes (not too bad for strings I guess). I also think we might not do a great job of encoding sequences at the root of chunks efficiently (I think they might all get the any shape encoder, adding per character overhead in this case).

Thus I think putting the opt in here is a good way to stress test incremental summary, but probably not a performance win in most cases.

@github-actions

Copy link
Copy Markdown
Contributor

Bundle size comparison

Base commit: 0c5bc7525b40e77b21ec1c967439731a0e72f28d
Head commit: a260b4ab1b2cff763d6e30a626ce2a47f0f6da2a

Notable changes

No bundles changed by ≥ 500 bytes parsed.

Per-bundle deltas

@fluid-example/bundle-size-tests

  • azureClient.js: parsed 619057 → 619113 (+56), gzip 164811 → 164857 (+46)
  • odspClient.js: parsed 591891 → 591947 (+56), gzip 158905 → 158946 (+41)
  • aqueduct.js: parsed 525587 → 525622 (+35), gzip 140709 → 140738 (+29)
  • fluidFramework.js: parsed 392450 → 392471 (+21), gzip 111413 → 111428 (+15)
  • sharedTree.js: parsed 381837 → 381851 (+14), gzip 108807 → 108816 (+9)
  • containerRuntime.js: parsed 303937 → 303951 (+14), gzip 83213 → 83221 (+8)
  • sharedString.js: parsed 175984 → 175991 (+7), gzip 49445 → 49453 (+8)
  • experimentalSharedTree.js: parsed 160798 → 160798 (0), gzip 45804 → 45804 (0)
  • matrix.js: parsed 159845 → 159852 (+7), gzip 45411 → 45418 (+7)
  • loader.js: parsed 145221 → 145235 (+14), gzip 39052 → 39066 (+14)
  • odspDriver.js: parsed 104431 → 104452 (+21), gzip 32647 → 32657 (+10)
  • directory.js: parsed 66616 → 66623 (+7), gzip 18532 → 18540 (+8)
  • 748.js: parsed 58793 → 58793 (0), gzip 17826 → 17826 (0)
  • map.js: parsed 46709 → 46716 (+7), gzip 14310 → 14317 (+7)
  • odspPrefetchSnapshot.js: parsed 45650 → 45664 (+14), gzip 15275 → 15284 (+9)
  • 594.js: parsed 44493 → 44493 (0), gzip 13744 → 13744 (0)
  • summarizerDelayLoadedModule.js: parsed 30753 → 30753 (0), gzip 7767 → 7767 (0)
  • socketModule.js: parsed 26486 → 26493 (+7), gzip 7883 → 7891 (+8)
  • createNewModule.js: parsed 12480 → 12480 (0), gzip 4786 → 4786 (0)
  • summaryModule.js: parsed 3797 → 3797 (0), gzip 1860 → 1860 (0)
  • connectionState.js: parsed 724 → 724 (0), gzip 429 → 429 (0)
  • sharedTreeAttributes.js: parsed 666 → 673 (+7), gzip 432 → 441 (+9)
  • debugAssert.js: parsed 429 → 429 (0), gzip 299 → 299 (0)
  • FluidFramework-HashFallback.js: parsed 422 → 422 (0), gzip 316 → 316 (0)

@brrichards
brrichards merged commit 74a62fd into microsoft:main Jun 30, 2026
31 checks passed
@brrichards
brrichards deleted the inc-summarization branch July 29, 2026 15:59
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.

4 participants