Migration Guide - March 2026 Updates
This guide covers breaking changes and migration steps for updates pushed to main in March 2026.Three.js 0.183.2 Upgrade
Breaking Changes
TSL API Change:atan2 has been renamed to atan in Three.js TSL exports.
Migration Steps
- Update Three.js imports in custom shader code:
- Update package.json if you have Three.js version pinned:
- Rebuild your project:
Files Affected
packages/procgen/src/geometry/LeafMaterialTSL.ts- Updatedatan2→atan- All packages with Three.js dependency upgraded to 0.183.2
New Features
- TSL Typed Node Aliases: New type exports for better TypeScript support:
Environment Variable Changes
Removed Variables
The following environment variables have been removed and are no longer supported:Streaming Configuration (Removed)
STREAM_CAPTURE_DISABLE_WEBGPU- WebGPU is now required, no fallbackDUEL_FORCE_WEBGL_FALLBACK- WebGL fallback removed (WebGPU-only)DUEL_CAPTURE_USE_XVFB- Xvfb is now auto-detected on LinuxDUEL_DISABLE_BRIDGE_CAPTURE- Bridge capture is now always enabled
Development Mode (Removed)
SERVER_DEV_LEAN_MODE- Lean mode system removed entirelySERVER_DEV_LEAN_ALLOW_DUEL_BETTING- No longer neededSERVER_DEV_LEAN_ALLOW_STREAMING_DUEL- No longer neededSERVER_DEV_LEAN_ALLOW_STREAMING_CAPTURE- No longer neededSERVER_DEV_LEAN_ALLOW_DUEL_SCHEDULER- No longer neededSERVER_DEV_LEAN_ALLOW_MODEL_AGENTS- No longer neededSERVER_DEV_LEAN_ALLOW_AUTO_AGENTS- No longer neededSERVER_DEV_LEAN_ALLOW_TERRAIN_MESH_COLLISION- No longer neededSERVER_DEV_LEAN_ALLOW_DUEL_ARENA_VISUALS- No longer needed
Betting/Market Maker (Removed)
BOT_KEYPAIR- Moved to hyperbet repositoryORACLE_AUTHORITY_KEYPAIR- Moved to hyperbet repositoryMARKET_MAKER_KEYPAIR- Moved to hyperbet repositoryDUEL_MARKET_MAKER_ENABLED- Moved to hyperbet repositoryARENA_SERVICE_ENABLED- Moved to hyperbet repositoryDUEL_SKIP_CHAIN_SETUP- Moved to hyperbet repository
Runtime Health (Removed)
GAME_STATE_POLL_TIMEOUT_MS- No longer usedGAME_STATE_POLL_INTERVAL_MS- No longer usedDUEL_RUNTIME_HEALTH_INTERVAL_MS- No longer usedDUEL_RUNTIME_HEALTH_MAX_FAILURES- No longer used
Changed Variables
CDN Configuration (Unified)
DUEL_PUBLIC_CDN_URL with PUBLIC_CDN_URL in your .env files.
Streaming Configuration (Updated Defaults)
HLS Configuration (Updated Defaults)
Streaming Pipeline Changes
ANGLE Backend Selection
Change: Default ANGLE backend changed from explicitvulkan to default for automatic best-backend selection.
Migration:
FFmpeg Resolution Order
Change: System FFmpeg is now preferred over ffmpeg-static to avoid segfaults. Resolution Order:/usr/bin/ffmpeg(system package manager)/usr/local/bin/ffmpeg(Homebrew, manual install)ffmpegon PATHffmpeg-staticnpm package (fallback)
Chrome Channel
Change: Switched from Chrome Unstable to Chrome Beta for better stability. Migration:Frame Pacing (March 11, 2026)
Change: Enforced 30fps frame pacing to eliminate stream buffering. New Behavior:- CDP
everyNthFramechanged from 1→2 (halves compositor delivery from ~60fps to ~30fps) - Frame pacing skips frames arriving faster than 85% of 33.3ms target interval
- Output resolution default changed from 1920x1080→1280x720
Service Worker Changes
Cache Strategy
Change: Switched fromCacheFirst to NetworkFirst for JS/CSS.
Impact: Eliminates stale module errors after rebuilds.
Migration: Clear browser cache after updating:
Cache Clearing (Development)
Change: Aggressive cache clearing added for local development. Behavior: Service worker and cache buckets are automatically cleared on localhost/127.0.0.1 to prevent stale module errors. Migration: No action needed. Development experience is now smoother.Test Infrastructure Changes
WebGPU Test Exclusions
Change:@hyperscape/impostor excluded from headless CI test runs.
Rationale: WebGPU is unavailable on GitHub Actions runners. Package requires GPU-enabled browsers.
Migration: Run impostor tests locally:
Test Timeouts
Change: Increasedsim-engine guarded MEV fee sweep test timeout from 60s to 120s.
Rationale: Prevents flaky CI failures on slower runners.
Migration: No action needed. Tests are now more reliable.
Deployment Changes
SSH Session Timeout Fix
Change: Background processes now usedisown to prevent SSH session timeout.
Impact: Vast.ai deployments complete in ~1 minute instead of hanging for 30 minutes.
Migration: Update scripts/deploy-vast.sh if you have custom deployment scripts:
Database Changes
Connection Pool
Change: PostgreSQL connection pool increased from 10 to 20 connections. Rationale: Prevents timeout errors under load. Migration: No action needed. Pool size is auto-configured. Override (if needed):Physics Optimization
Streaming/Spectator Viewports
Change: Client-side PhysX initialization skipped for streaming/spectator viewports. Rationale: Streaming clients don’t need physics simulation - they only render world state. Impact: Faster startup, reduced memory footprint for spectator views. Migration: No action needed. Optimization is automatic based on URL parameters (?page=stream, ?mode=spectator).
Dependency Updates
Major Version Bumps
- Capacitor: 7.6.0 → 8.2.0 (Android, iOS, Core)
- lucide-react: → 0.577.0
- three-mesh-bvh: 0.8.3 → 0.9.9
- eslint: → 10.0.3
- jsdom: → 28.1.0
bun install to update dependencies. No code changes required.
Verification Checklist
After migrating, verify the following:Local Development
-
bun installcompletes without errors -
bun run buildsucceeds -
bun run devstarts all services - Game loads at http://localhost:3333
- No console errors related to Three.js or TSL
- Service worker clears cache on localhost
Streaming (if applicable)
-
bun run dev:duelstarts streaming pipeline - Chrome Beta is installed and detected
- FFmpeg is system-installed (not ffmpeg-static)
- ANGLE backend is set to
default(ormetalon macOS) - Stream resolution is 1280x720 (or custom override)
- No buffering or frame drops on stream output
- Playwright doesn’t inject
--enable-unsafe-swiftshader
Production Deployment
-
PUBLIC_CDN_URLis set (notDUEL_PUBLIC_CDN_URL) - Database connection pool is 20 (or custom override)
- Removed environment variables are not set
- Service worker uses
NetworkFirststrategy - Xvfb starts before PM2 on Linux
- Background processes use
disownin deploy scripts
Rollback Instructions
If you encounter issues after migrating:Three.js Rollback
Environment Variable Rollback
Streaming Rollback
Support
If you encounter migration issues:- Check AGENTS.md for recent changes documentation
- Review CLAUDE.md for detailed architecture notes
- Search closed issues: https://github.com/HyperscapeAI/hyperscape/issues
- Open a new issue with migration context and error logs
Timeline
- March 10, 2026: Three.js 0.183.2 upgrade, streaming pipeline overhaul
- March 11, 2026: Frame pacing fix, deployment timeout fix, test infrastructure updates