chore(deps): upgrade TypeScript to 6#376
Merged
Merged
Conversation
Bump typescript ^5.7.0 -> ^6.0.3 across the workspace (root, babylon-lite, babylon-lite-gl, babylon-lite-compat, lab, playground). Vite is left at its existing ^6.x pins; the Vite 8 (rolldown-vite) upgrade is handled in a separate PR so the bundler switch can be evaluated on its own merits. Code changes required by TS6: - node-geometry-renderable.ts: copy the readonly `_vertexBuffers` array (`[...a._vertexBuffers]`) when passing it as `GPUVertexState.buffers`. TS6 tightened the WebGPU typings so a readonly array is no longer assignable to the mutable `buffers` field. Semantics-preserving (shallow copy only). - tests/lite/build/public-api-types.test.ts and tests/gl/build/public-api.test.ts: add `--ignoreConfig` to the standalone `tsc` invocations. TS6 now errors (TS5112) when a file is passed on the command line while a tsconfig.json exists in cwd; `--ignoreConfig` is the recommended flag. - tests/lite/build/public-api-types.test.ts: drop `--types @webgpu/types`. TS6's built-in `dom` lib now bundles the WebGPU declarations, so also loading the `@webgpu/types` package duplicates them and, without skipLibCheck (deliberately omitted by this test), trips TS6200/TS2717 conflicts. The native lib fully covers the GPU* types the public d.ts uses. Regenerated 46 per-scene bundle manifests reflecting TS6 codegen byte differences (all within existing size ceilings). No tsconfig strictness was loosened and no `any`/`@ts-ignore` was added. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
ad18753 to
8527a42
Compare
This was referenced Jul 7, 2026
ryantrem
pushed a commit
that referenced
this pull request
Jul 7, 2026
##⚠️ PENDING USER APPROVAL — ceiling change, do NOT merge without sign-off This proposes raising **scene144** (bloom post-process) `maxMad` from **0.07 → 0.072** in `scene-config.json`. Per GUIDANCE, a scene MAD ceiling may not be raised without explicit user approval — this draft is a **proposal + justification only**. ## Root cause scene144's parity gate has **no committed golden** (`reference/**/babylon-ref-*.png` is gitignored), so every run captures a **live Babylon.js reference** and compares it against the **live Babylon Lite** render on the same renderer — a genuine two-engine comparison. The two independent WebGPU float pipelines computing a full-screen, **multi-pass Gaussian bloom** differ only at the **8-bit quantization floor**: | Metric | Value | |---|---| | Pixels exact match | **92.1%** | | Within 1 LSB | 97.2% | | Within 2 LSB | 99.6% | | Share of MAD from ≤2-LSB gradient rounding | **71%** | MAD here is measured in 0–255 space, so 0.07 means an average per-channel difference of **0.07/255 ≈ 0.03%** — essentially pixel-perfect. The residual is dominated by unavoidable ±1–2 LSB rounding across the smooth bloom gradient, which quantizes differently between renderers. ## Why it's an inherent floor, not a closable bug - Bloom params (**threshold 0.1, weight 2, kernel 64, scale 0.5**) and the extract/blur/merge math already match the BJS reference (`bjs/scene144.ts`) exactly. - The BJS engine uses `antialias: true`. I tried mirroring that by rendering the Lite source into a 4× MSAA target and resolving before bloom — parity got **4× worse (MAD 0.309)**, proving BJS's bloom input is effectively single-sample and the current single-sample Lite config is already the closest match. There is **no closable algorithmic drift**. ## Measurements (deterministic, zero run-to-run variance) The scene is fully deterministic (frozen animation frame 180, fixed camera). The only variable is the renderer's float rounding: | Environment | MAD | vs ceiling 0.07 | |---|---|---| | Hardware GPU (local, ×3 fresh-golden runs) | **0.0700043** | +4.3e-6 | | CI SwiftShader (cloud) | **0.0700051** | +5.1e-6 | The old 0.07 ceiling was calibrated right at this floor, so deterministic cross-renderer rounding on a handful of pixels tips it over. CI's SwiftShader is deterministic, hence the identical failure across independent cloud runs. ## Proposed fix Widen `maxMad` to **0.072** (with an inline `note` capturing this justification). That clears the observed floor by ~2.8% while staying **orders of magnitude below any genuine bloom regression** (a wrong weight/threshold/kernel moves MAD by ≥ 0.1, not millionths). ## Scope Standalone, **pre-existing** issue on master — independent of the dependency PRs (#374 / #376). Config-only change; no engine code (`packages/babylon-lite/src/**`) touched. `pnpm run lint` passes. --- **Recommendation: approve the 0.072 widen.** Alternative if a ceiling bump is undesirable: commit a golden PNG for scene144 (like other scenes) so the gate becomes Lite-vs-fixed-golden instead of live-two-engine — but that trades one calibration problem for another and still carries cross-renderer quantization. The ceiling widen is the cleaner, honest fix. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ript-6-vite-8 # Conflicts: # lab/public/bundle/manifest/scene113.json # lab/public/bundle/manifest/scene114.json # lab/public/bundle/manifest/scene146.json # lab/public/bundle/manifest/scene179.json
Lab - Static SiteBuild 20260708.11 - merge @ 0f80a5b |
…ript-6-vite-8 # Conflicts: # lab/public/bundle/manifest/scene129.json # package.json # pnpm-lock.yaml
Lab - Static SiteBuild 20260708.21 - merge @ f45211f |
ryantrem
approved these changes
Jul 9, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Upgrades the workspace TypeScript toolchain to TypeScript 6.0.3 and applies the minimal code/test-harness adjustments needed to keep the build and public-API type validation working under TS6, while keeping Vite unchanged.
Changes:
- Bump
typescriptfrom^5.7.0to^6.0.3across the workspace (plus lockfile refresh). - Update isolated
.d.tstypecheck tests to pass--ignoreConfig, and stop explicitly loading@webgpu/typesin the Lite public API typecheck to avoid TS6 WebGPU lib duplication. - Adjust a WebGPU pipeline descriptor to satisfy TS6’s stricter WebGPU typings by copying a readonly vertex buffer layout array.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
package.json |
Bumps root TypeScript devDependency to ^6.0.3. |
pnpm-lock.yaml |
Lockfile refresh reflecting TypeScript 6 resolution and updated peer snapshots. |
packages/babylon-lite/package.json |
Bumps package TypeScript devDependency to ^6.0.3. |
packages/babylon-lite-gl/package.json |
Bumps package TypeScript devDependency to ^6.0.3. |
packages/babylon-lite-compat/package.json |
Bumps package TypeScript devDependency to ^6.0.3. |
lab/package.json |
Bumps lab TypeScript dependency to ^6.0.3. |
playground/package.json |
Bumps playground TypeScript dependency to ^6.0.3. |
packages/babylon-lite/src/material/node/node-geometry-renderable.ts |
Copies _vertexBuffers when used in GPUVertexState.buffers to satisfy TS6 WebGPU typing. |
tests/lite/build/public-api-types.test.ts |
Adds --ignoreConfig to TS6 CLI invocation; removes --types @webgpu/types to avoid TS6 lib conflicts. |
tests/gl/build/public-api.test.ts |
Adds --ignoreConfig to TS6 CLI invocation for .d.ts typechecking. |
lab/public/bundle/manifest/scene104.json |
Updates committed per-scene bundle manifest after toolchain/codegen change. |
lab/public/bundle/manifest/scene149.json |
Updates committed per-scene bundle manifest after toolchain/codegen change. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Lab - Static SiteBuild 20260709.7 - merge @ 7f64fe4 |
RaananW
added a commit
that referenced
this pull request
Jul 9, 2026
Resolve lab/package.json: keep our @BabylonJS 9.16.0 / manifold-3d 3.5.1 / gltf2interface 9.16.0 bumps; take master's typescript ^6.0.3 (sibling TS6 PR #376). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
Bumps TypeScript
^5.7.0→^6.0.3across the workspace only. Vite is unchanged (stays at its existing^6.xpins).This PR was originally TS6 + Vite 8 together, but a split diagnostic showed the two majors carry independent risk, so the Vite 8 (rolldown-vite) work has been moved to its own separate draft PR (#377, parked as exploration). This PR is now a clean, zero-ceiling/zero-golden TypeScript-6-only change and is the deliverable.
Version bumps
typescript ^5.7.0 → ^6.0.3in: root,packages/babylon-lite,packages/babylon-lite-gl,packages/babylon-lite-compat,lab,playground.pnpm-lock.yamlregenerated (TS-only delta; resolves TS5.9.3 → 6.0.3).Code changes required by TS 6
packages/babylon-lite/src/material/node/node-geometry-renderable.ts— copy the readonly_vertexBuffersarray (buffers: [...a._vertexBuffers]) when passing it asGPUVertexState.buffers. TS6 tightened the WebGPU typings so a readonly array is no longer assignable to the mutablebuffersfield. Semantics-preserving (shallow copy only; no runtime/render change).tests/lite/build/public-api-types.test.ts,tests/gl/build/public-api.test.ts— add--ignoreConfigto the standalonetscinvocations. TS6 now errors (TS5112) when a file is passed on the command line while atsconfig.jsonexists in cwd;--ignoreConfigis the flag the error itself recommends.tests/lite/build/public-api-types.test.ts— drop--types @webgpu/types. TS6's built-indomlib now bundles the WebGPU declarations, so also loading the@webgpu/typespackage duplicates them and (withoutskipLibCheck, which this test deliberately omits to catch leaking internal types) trips TS6200/TS2717 conflicts. The native lib fully covers everyGPU*type the publicbuild/index.d.tsreferences — verified type-checks clean.No tsconfig strictness was loosened; no blanket
any/@ts-ignorewas added.Bundle manifests
All per-scene bundle manifests were regenerated under TS6. Codegen is byte-identical to the TS5/Rollup baseline for every scene except two —
scene104.jsonandscene149.json— which shift by a fraction of a KB (gzip rounding, e.g.44.5 → 44.6KB). Those two are therefore the only manifest files this PR changes vsmaster, and both remain within existing size ceilings (0 overages). (An earlier revision of this description said "46 manifests"; that reflected a mid-work snapshot before the TS6-only split — the accurate figure vsmasteris 2.)Test / build results (TS6 + Vite 6)
pnpm run lint(eslint +tsc --noEmitacross all tsconfigs): ✅ greenpnpm test:unit✅ ·pnpm test:build✅ ·pnpm test:unit:gl✅ ·pnpm test:build:gl✅pnpm build:lib,pnpm build,pnpm build:gl,pnpm build:playground: ✅ exit 0LAB_TEST_PORT=5279: 0 bundle-size overages ✅. Onlyscene116parity fails (see below);scene144now passes after merging master's widened0.072ceiling (docs(parity): scene144 bloom parity ceiling investigation (ON HOLD) #380).scene116 is pre-existing local-GPU noise — NOT introduced here
scene116fails byte-identically on unmodifiedmaster(TS 5.9.3 + Vite 6, this branch's changes reverted): MAD0.2883984375…vs threshold0.01. It is machine/GPU-specific strict-threshold noise that is green on CI, and fails with and without this PR's changes, so it is not a regression from the TS6 upgrade — a reviewer should not be alarmed.scene144(0.07000434…) previously sat a hair over the old0.07threshold but now passes under master's widened0.072ceiling (#380). No golden references or thresholds were touched.Notes
pnpm-lock.yaml→ shares a conflict surface with sibling dependency PRs (chore(deps): safe tooling batch + pnpm 9.15.9 #374 and the parked Vite 8 PR chore(deps): upgrade Vite to 8 (rolldown-vite) #377); whichever merges second regenerates the lock (trivial re-resolve).master(incl. chore(deps): safe tooling batch + pnpm 9.15.9 #374 tooling batch + pnpm 9.15.9, test(parity): add REUSE_BROWSER to reuse one browser window across scene specs #378 REUSE_BROWSER, fix(mesh): ref-count GPU buffers shared by cloneTransformNode to prevent double-free #353, [compat-sync] Gizmo isEnabled API + skip hover pick when disabled (#328) #381); all suites re-validated green.