Skip to content

docs: Add note about externals mutation during resolution - #3256

Merged
aleksanderkatan merged 1 commit into
releasefrom
docs/externals-mutation
Oct 23, 2026
Merged

aleksanderkatan merged 1 commit into
releasefrom
docs/externals-mutation

Conversation

@aleksanderkatan

Copy link
Copy Markdown
Member

No description provided.

@aleksanderkatan
aleksanderkatan changed the base branch from main to release October 22, 2026 09:01
@github-actions

Copy link
Copy Markdown

pkg.pr.new

No packages changed since release

@github-actions

Copy link
Copy Markdown

Resolution Time Benchmark

---
config:
  themeVariables:
    xyChart:
      plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
  title "Random Branching (🔴 PR | 🔵 main | 🟢 release)"
  x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
  y-axis "time (ms)"
  line [1.03, 2.07, 4.14, 6.94, 8.61, 11.65, 26.78, 26.56]
  line [0.96, 2.13, 4.40, 6.43, 7.89, 13.17, 25.24, 23.69]
  line [1.18, 2.29, 4.60, 7.59, 8.58, 13.47, 26.20, 24.92]
Loading
---
config:
  themeVariables:
    xyChart:
      plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
  title "Linear Recursion (🔴 PR | 🔵 main | 🟢 release)"
  x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
  y-axis "time (ms)"
  line [0.30, 0.58, 0.76, 0.91, 1.25, 1.25, 1.47, 1.69]
  line [0.32, 0.56, 0.74, 0.83, 1.14, 1.19, 1.40, 1.54]
  line [0.39, 0.58, 0.82, 0.98, 1.47, 1.31, 1.58, 1.83]
Loading
---
config:
  themeVariables:
    xyChart:
      plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
  title "Full Tree (🔴 PR | 🔵 main | 🟢 release)"
  x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
  y-axis "time (ms)"
  line [1.08, 2.43, 3.98, 7.47, 14.02, 27.36, 59.44, 119.16]
  line [0.94, 2.16, 4.10, 7.88, 13.13, 26.61, 56.80, 115.43]
  line [1.01, 2.23, 5.01, 7.78, 13.67, 28.98, 60.88, 122.30]
Loading

@github-actions

Copy link
Copy Markdown

Bundle size comparison (import * as ... in PR vs import * as ... in target):

🟢 Decreased ➖ Unchanged 🔴 Increased ❔ Unknown
0 349 0 0

No notable changes.

If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.

@aleksanderkatan
aleksanderkatan marked this pull request as ready for review October 22, 2026 09:45

@pullfrog pullfrog Bot 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.

✅ No new issues found.

Reviewed changes — reviewed the single-file docs change adding a caution about external values in the functions guide.

  • New caution block — documents that all external values are assumed constant during resolution, and that this includes values mutated by tgpu.comptime.
  • Twoslash example — demonstrates that a captured external is snapshotted on first resolution and a comptime mutation does not regenerate an already-resolved function.
  • Comment retitle — reframes the preceding external-values example from "This is NOT allowed" to "This does NOT affect the pipeline, since it was already compiled".

The behavior shown in the example is accurate: I ran the same code through tgpu.resolve([main]) and the emitted WGSL matches the commented output exactly (modulo the blank line between the two generated functions).

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@aleksanderkatan
aleksanderkatan merged commit 1d38154 into release Oct 23, 2026
8 of 16 checks 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.

2 participants