Skip to content

docs(guide): clarify reference counts on unshared fields - #1812

Merged
Lorenzobattistela merged 2 commits into
bendlang:mainfrom
vicmcorrea:docs/datatype-sharing-cost
Oct 21, 2026
Merged

Lorenzobattistela merged 2 commits into
bendlang:mainfrom
vicmcorrea:docs/datatype-sharing-cost

Conversation

@vicmcorrea

@vicmcorrea vicmcorrea commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem and fix

The runtime paragraph's +-only wording can make an affine value appear free of reference-counting costs. Clarify the concrete trigger: copying a value of a datatype makes all its nodes count their fields, including nodes used without sharing.

Related to #1559; its runtime optimization and performance questions stay open.

Blast radius

Only the runtime paragraph in guide/GUIDE.md. No executable code, API, compiler output, gate, cap, or paper changes.

Regression evidence

Reduced parsed hot/cold programs on current main confirm that copying a reusable List makes the same affine List<U32> builder emit field-sealing calls. This agrees with the compiler's datatype-wide analysis and BendRT's stored-field explanation. This is a documentation correction; no runtime regression is changed.

Checks

  • CI repo-gate passes; the guide is 7,996/8,000 tokens with CI-pinned ttok 0.3.
  • git diff --check passes; both reduced native examples pass their expected outputs.

Validation limits

Local checks ran on macOS arm64. No current slowdown or allocation count was measured; the original #1559 literal-input examples no longer distinguish field-sealing stores on current main. No Linux, Metal/CUDA, or cluster tests were run for this prose-only change.

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.

2 participants