Conversation
|
pkg.pr.new packages benchmark commit |
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 [0.99, 1.96, 4.42, 6.30, 7.30, 12.59, 23.76, 25.87]
line [1.00, 2.09, 4.45, 6.81, 8.28, 11.83, 24.50, 25.07]
line [1.00, 1.99, 4.44, 6.89, 8.66, 12.83, 24.48, 27.46]
---
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.53, 0.72, 0.90, 1.16, 1.23, 1.44, 1.61]
line [0.30, 0.57, 0.72, 0.87, 1.12, 1.22, 1.48, 1.65]
line [0.30, 0.51, 0.67, 0.82, 1.09, 1.18, 1.39, 1.59]
---
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 [0.82, 2.23, 4.44, 7.19, 13.01, 28.39, 56.85, 114.61]
line [0.92, 2.19, 3.90, 8.09, 12.72, 27.16, 56.78, 115.09]
line [0.93, 2.20, 4.04, 7.12, 12.60, 26.72, 58.59, 115.22]
|
Bundle size comparison (
|
| 🟢 Decreased | ➖ Unchanged | 🔴 Increased (max 1.47%) | ❔ Unknown |
|---|---|---|---|
| 0 | 39 | 286 | 0 |
import * as ... in PR vs import * as ... in target (did bundle size increase?):
| Test | tsdown |
|---|---|
| STATIC_tgpu.ts | 279.10 kB ( |
| STATIC_allImports.ts | 305.16 kB ( |
| tgpu_initFromDevice.ts | 268.47 kB ( |
| tgpu_init.ts | 269.02 kB ( |
| d_ref.ts | 5.03 kB ( |
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.
4f4b2f6 to
4cc1acd
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The advertised uniform fallback is not covered by the current tests.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Updates the point-light shadow example to use WGSL immediates when available while retaining a uniform-backed fallback.
Changes:
- Adds per-face view-projection immediate handling.
- Provides an accessor-based uniform fallback.
- Exposes camera view-projection matrices.
- Updates shader snapshot expectations.
File summaries
| File | Summary |
|---|---|
apps/typegpu-docs/tests/individual-example-tests/point-light-shadow.test.ts |
Updates shader snapshots; moderate issue (2 votes): add coverage for the feature-disabled fallback path. |
apps/typegpu-docs/src/examples/rendering/point-light-shadow/point-light.ts |
Creates and supplies the optional immediate matrix; moderate issue (1 vote): ensure the uniform-backed fallback is exercised. |
apps/typegpu-docs/src/examples/rendering/point-light-shadow/index.ts |
Routes the depth shader through the immediate or uniform-backed accessor. |
apps/typegpu-docs/src/examples/rendering/point-light-shadow/camera.ts |
Exposes and maintains the view-projection matrix. |
Review details
Suppressed comments (1)
apps/typegpu-docs/src/examples/rendering/point-light-shadow/point-light.ts:49
- The example test runs with the test utility's default
wgslLanguageFeatures, which includesimmediate_address_space, and its snapshot only asserts the immediate shader. Theundefinedbranch that supplies the uniform-backed accessor atindex.ts:288is therefore never exercised, so a regression in the advertised fallback would pass; add a fallback run with the feature removed before importing the example and assert the depth shader usescamera.viewProjectionMatrix.
this.faceImmediate = root.enabledWgslLanguageFeatures.has('immediate_address_space')
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @@ -37,7 +32,7 @@ describe('point light shadow example', () => { | |||
| @vertex fn vertexDepth(@location(0) position: vec3f, @location(3) column1: vec4f, @location(4) column2: vec4f, @location(5) column3: vec4f, @location(6) column4: vec4f) -> vertexDepth_Output { | |||
| let modelMatrix = mat4x4f(column1, column2, column3, column4); | |||
| let worldPos = (modelMatrix * vec4f(position, 1f)).xyz; | |||
| let pos = (camera.viewProjectionMatrix * vec4f(worldPos, 1f)); | |||
| let pos = (item * vec4f(worldPos, 1f)); | |||
There was a problem hiding this comment.
ℹ️ No critical issues — one coverage observation below.
Reviewed changes
- Depth pass delivers the face view-projection through an immediate —
faceViewProj = tgpu.accessor(d.mat4x4f)is bound topointLight.faceImmediatewhenimmediate_address_spaceis available, otherwise to() => renderLayout.$.camera.viewProjectionMatrix. PointLightcreates a conditional immediate var and sets it per face —renderShadowMapscallspipeline.with(faceImmediate, camera.viewProjectionMatrix)for each of the six faces; the fallback path reuses the per-camera uniform bind group.Camerastores and exposesviewProjectionMatrix— the old#computeDatasplits into#computeViewProjection()and#cameraData(), giving the CPU side access to the matrix the immediate needs.- Snapshot regenerated for the immediate branch —
var<immediate> item: mat4x4fanditem * vec4f(...)replace the camera uniform in the depth module.
ℹ️ Fallback branch is no longer pinned by any test
The example test harness unconditionally advertises immediate_address_space (packages/typegpu-testing-utility/src/extendedIt.ts:224), so the regenerated snapshot only pins the immediate branch. The fallback branch — which is what runs on browsers without the extension today, i.e. most of them — is no longer asserted anywhere, so a regression in the accessor fallback would pass CI. I confirmed it currently resolves correctly, so this is a coverage note rather than a bug.
Technical details
# Fallback-path coverage gap
## Affected sites
- `apps/typegpu-docs/tests/individual-example-tests/point-light-shadow.test.ts` — the inline snapshot now pins only the `var<immediate> item` shader; the `camera.viewProjectionMatrix` variant is unasserted.
- `packages/typegpu-testing-utility/src/extendedIt.ts:224` — the mocked `navigator` unconditionally advertises `immediate_address_space`.
## Required outcome
- Restore coverage of the fallback branch that non-immediate hardware takes.
## Suggested approach (optional)
- Add a sibling test (separate file, since the example module is imported once per file) that clears `navigator.gpu.wgslLanguageFeatures` before `runExampleTest`, mirroring `point-light-shadow.test.ts`. Verified locally: the depth shader then emits `camera.viewProjectionMatrix` with no `var<immediate>`.DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
4cc1acd to
5d90be5
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Named the face immediate —
pointLight.faceImmediatenow calls.$name('viewProjectionMatrix'), so the depth module emitsvar<immediate> viewProjectionMatrix: mat4x4f;andviewProjectionMatrix * vec4f(...); the inline snapshot was regenerated to match. This implements the human reviewer nit onpoint-light.ts:50.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Stacked on #3032.
The shadow-face view-projection matrix is delivered through an immediate when
immediate_address_spaceis available, with the existing uniform as fallback via an accessor.