Migration Guide - February 2026
This document covers breaking changes and new features introduced in February 2026.Breaking Changes
1. WebGL Removed - WebGPU Only (Commit 47782ed)
Impact: HIGH - All WebGL fallback code has been removed. What Changed:RendererFactoryno longer detects or supports WebGLUniversalRenderertype replaced withWebGPURendererthroughout codebase--disable-webgpuandforceWebGLURL parameters are ignored- Deployment fails if WebGPU cannot initialize (no soft fallbacks)
- Ensure all users have WebGPU-capable browsers:
- Chrome 113+
- Edge 113+
- Safari 18+ (macOS 15+) - Safari 17 support removed
- Remove any custom WebGL fallback code from your codebase
- Update browser compatibility warnings to mention WebGPU requirement
- Test on target browsers: webgpureport.org
packages/shared/src/utils/rendering/RendererFactory.tspackages/shared/src/index.tspackages/shared/src/index.client.tspackages/server/scripts/stream-to-rtmp.tspackages/server/scripts/deploy-vast.shpackages/client/src/screens/GameClient.tsxpackages/client/src/game/panels/SettingsPanel/index.tspackages/client/src/lib/errorCodes.ts
2. ResourceVisualStrategy API Changes (Commit 9643d5d)
Impact: MEDIUM - Breaking change for custom resource visual strategies. What Changed:ResourceVisualStrategy.onDepleted()now returnsPromise<boolean>instead ofPromise<void>- Return
trueif strategy handled depletion (e.g., instanced stump) - Return
falseif ResourceEntity should load individual depleted model
- Return
- New optional method:
getHighlightMesh(ctx): THREE.Object3D | null- Returns positioned mesh for outline pass on instanced entities
- Used by
EntityHighlightServicefor hover/selection effects
-
Update custom
ResourceVisualStrategyimplementations: -
Implement
getHighlightMesh()if using instanced rendering:
packages/shared/src/entities/world/visuals/ResourceVisualStrategy.tspackages/shared/src/entities/world/visuals/InstancedModelVisualStrategy.tspackages/shared/src/entities/world/visuals/TreeGLBVisualStrategy.tspackages/shared/src/entities/world/ResourceEntity.tspackages/shared/src/systems/client/interaction/services/EntityHighlightService.ts
3. YouTube Streaming Disabled (Commit 47167b6)
Impact: LOW - YouTube streaming is now explicitly disabled. What Changed:YOUTUBE_STREAM_KEYis explicitly set to empty string in deployment- All YouTube-related RTMP configuration is ignored
- Only Twitch, Kick, and X/Twitter streaming are supported
- Remove YouTube stream keys from environment variables
- Update streaming documentation to reflect Twitch/Kick/X only
- Set
YOUTUBE_STREAM_KEY=""explicitly to prevent stale keys from being used
packages/server/ecosystem.config.cjsscripts/deploy-vast.sh
4. Model Cache Version Bump (Commit 6fd626a)
Impact: LOW - Automatic cache invalidation. What Changed:- Model cache version bumped from 3 to 4
- All cached models will be re-downloaded and re-processed
- Fixes index buffer type corruption (Uint16Array vs Uint32Array)
- No action required - cache invalidation is automatic
- First load after update will be slower as cache rebuilds
- Expect increased network traffic for model downloads
packages/shared/src/utils/rendering/ModelCache.ts
New Features
1. Instanced Rendering for Resources (Commit 53a9513, 9643d5d)
What’s New:- GPU instancing for all resource entities (rocks, ores, herbs, trees)
- Reduces draw calls from O(n) per resource to O(1) per unique model per LOD level
- Separate instance pools for normal and depleted states (tree → stump)
- Highlight mesh support for hover/selection on instanced entities
packages/shared/src/entities/world/visuals/InstancedModelVisualStrategy.tspackages/shared/src/systems/shared/world/GLBResourceInstancer.ts
packages/shared/src/systems/shared/world/GLBTreeInstancer.tspackages/shared/src/entities/world/ResourceEntity.tspackages/shared/src/runtime/createClientWorld.ts
2. WebGPU Initialization Timeouts (Commit ff45217, d5c6884)
What’s New:- 30s timeout on
navigator.gpu.requestAdapter()to prevent indefinite hangs - 60s timeout on
renderer.init()to detect GPU driver issues - Preflight test (
testWebGpuInit()) runs on blank page before loading game - GPU diagnostics (
captureGpuDiagnostics()) extract chrome://gpu info
packages/shared/src/utils/rendering/RendererFactory.tspackages/server/src/streaming/rtmp-bridge.ts
3. Production Client Build for Streaming (Commit 4be263a)
What’s New:- Serves pre-built client via
vite previewinstead of dev server - Fixes browser timeout issues (180s limit) caused by Vite’s JIT compilation
- Significantly faster page loads for streaming
packages/server/scripts/stream-to-rtmp.tspackages/server/ecosystem.config.cjs
4. Stream Capture Probe Timeouts (Commit 432ff84, cb0aaa9)
What’s New:- 5s timeout on probe evaluate calls to prevent hanging
- Proceeds with capture after 5 consecutive probe timeouts
- Handles browser unresponsiveness gracefully
packages/server/src/streaming/browser-capture.ts
5. GPU Sandbox Bypass for Containers (Commit 60c7157, b31f926)
What’s New:--disable-gpu-sandboxand--disable-setuid-sandboxflags added- Required for container GPU access (Docker, Vast.ai)
- Allows Chrome to access NVIDIA GPU in containerized environments
scripts/deploy-vast.shpackages/server/src/streaming/rtmp-bridge.ts
Stability Improvements
1. Combat System Stability (Commits 3357379, 0b2ff71)
Improvements:- Combat retry timer aligned with tick system (3000ms = 5 ticks)
- Phase timeout grace periods reduced (30s → 10s)
- Combat stall nudge tracks timestamp instead of cycle ID (allows re-nudging)
- Damage event cache cleanup every tick (was every 2 ticks)
- Cache cap lowered from 5000 to 1000, evicts 75% when exceeded
2. Memory Leak Fixes (Commit 3357379)
Improvements:- AgentManager properly cleans up COMBAT_DAMAGE_DEALT event listeners
- AutonomousBehaviorManager cleans up all event handlers in stop()
- Prevents memory accumulation during agent lifecycle
3. Resource Management (Commits 3357379, 0b2ff71)
Improvements:- Activity logger queue: max 1000 entries with 25% eviction
- Session timeout: 30 minutes (MAX_SESSION_TICKS)
- New “timeout” added to SessionCloseReason type
4. Streaming Stability (Commits 3357379, 0b2ff71, 432ff84)
Improvements:- Browser restart interval: 45 minutes (was 1 hour) to prevent WebGPU OOM
- Health check timeout: 5s (was 10s) for faster failure detection
- Data timeout: 15s (was 30s) to match health check ratio
- Buffer multiplier: 2x (was 4x) to reduce backpressure buildup
- CDP session handler cleanup on recovery (prevents double-handling)
- Proceeds with capture after 5 consecutive probe timeouts
5. Agent System Rate Limiting (Commit 0b2ff71)
Improvements:- Exponential backoff for LLM API calls
- 5s base backoff, max 60s
- Tracks consecutive failures, resets on success
6. Test Stability (Commit 583b6bc)
Improvements:- GoldClob fuzz tests: 120s timeout for randomized invariant tests
- Precision fixes: larger amounts (10000n) to avoid gas cost rounding errors
- Dynamic import timeout: 60s for EmbeddedHyperscapeService beforeEach hooks
Deprecations
1. Safari 17 Support Removed
Reason: Safari 18+ (macOS 15+) provides more stable WebGPU implementation. Action: Update browser compatibility documentation to require Safari 18+.2. WebGL Renderer Type Removed
Reason: WebGL is no longer supported - WebGPU only. Action: ReplaceUniversalRenderer with WebGPURenderer in custom code.
3. Headless Chrome for Streaming
Reason: Headless mode does not support WebGPU. Action: Use Xorg or Xvfb display server for GPU streaming.Recommended Actions
For Developers
- Update browser requirements in user-facing documentation
- Test WebGPU compatibility on target browsers
- Review custom ResourceVisualStrategy implementations for API changes
- Update streaming deployment scripts to use new environment variables
- Monitor memory usage with new resource management limits
For Operators
- Update Vast.ai deployment to use latest
deploy-vast.sh - Configure stream keys via environment variables (remove hardcoded secrets)
- Monitor browser restart logs for WebGPU OOM prevention
- Review GPU diagnostics in deployment logs
- Test WebGPU preflight checks on GPU servers
For Contributors
- Read AGENTS.md for updated WebGPU requirements
- Review CLAUDE.md for instanced rendering architecture
- Check .env.example for new streaming configuration options
- Test changes with real Playwright browser sessions (no mocks)
- Document breaking changes in commit messages
Support
For questions or issues related to this migration:- Review CLAUDE.md for architecture details
- Check AGENTS.md for WebGPU requirements
- See
scripts/deploy-vast.shfor streaming deployment logic - Open an issue: github.com/HyperscapeAI/hyperscape/issues