You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Evolve ZigCraft distant terrain into a measured hybrid CPU/GPU architecture capable of approaching Distant Horizons-like quality and scale without assuming that every workload belongs on GPU.
Architectural assessment
The current system is predominantly CPU-driven: procedural sampling, mesh generation, hierarchy scheduling, visibility/coverage checks, streaming, persistence, and default direct draw submission occur on CPU. The GPU mainly transforms and shades uploaded conventional vertices. Terrain MDI exists but is optional, while the LOD GPU-culling switch currently falls back to CPU behavior.
The architecture can improve substantially without a rewrite through visibility, threading, MDI, transfer, and synchronization work. Reaching genuinely large horizons with high quality likely requires the Phase 4 representation change: compact far-terrain tiles plus GPU-driven visibility/submission. Procedural generation, persistence, edits, and policy should remain CPU-owned unless measurements prove otherwise.
Current responsibility map
Work
Current owner
Target owner
Procedural terrain sampling
CPU workers
CPU workers, cheaper/reused for far levels
Persistence and edit provenance
CPU/update path
Async CPU I/O/workers
Region hierarchy and scheduling
CPU
CPU
Mesh construction
CPU workers
CPU near LOD; GPU-friendly compact representation for far LOD
Frustum/coverage culling
CPU, repeated by layer
CPU broad policy + GPU high-cardinality culling
Draw submission
CPU direct draws; optional terrain MDI
GPU-compacted indirect terrain and water
Uploads/lifetime
CPU staging with global idle paths
Async ring staging + fence/timeline retirement
Terrain/water shading
GPU
GPU, with cheaper far-water/material paths
Ranked concerns
Repeated CPU visibility and chunk-coverage work, including terrain/water duplication.
Direct per-region submission because MDI is disabled by default and water remains direct.
Dense CPU-generated far meshes, expensive representative sampling, and large vertex uploads.
Repeated global state scans/sorts and long-lived manager lock participation.
Synchronous cache activity on the update path.
vkDeviceWaitIdle during eviction/pool operations and avoidable upload copies.
Incomplete memory accounting and unmanaged pool slack/shadow allocations.
No production GPU culling/indirect-command compaction.
Far-water shader cost and fragment-discard handoff waste.
Within each phase, workstreams marked parallel may be developed concurrently. Shared RHI/Vulkan contract changes and resource-lifetime changes must merge sequentially behind explicit interfaces.
Global constraints
Optimize based on p95/p99 and attributed timings, not average FPS alone.
Compare CPU and GPU paths at realistic candidate counts; small jobs may remain faster on CPU.
Avoid GPU readback in generation/streaming loops.
Maintain feature-gated fallbacks for hardware lacking required indirect/timeline capabilities.
Never trade hidden VRAM growth or synchronization hitches for apparent CPU gains.
Mesh shaders are optional research, not a prerequisite; compute + conventional indirect rendering comes first.
Epic completion criteria
CPU/GPU responsibilities match the target map and are backed by measurements.
Large-horizon traversal stays within agreed p95/p99 CPU, GPU, RAM, and VRAM budgets.
Normal streaming has no global device-idle synchronization.
GPU culling and indirect submission have validated CPU fallbacks.
Far LOD upload and geometry memory scale with compact tiles rather than expanded vertices.
Automated benchmark and visual suites prevent performance, seam, transition, and handoff regressions.
Validation matrix
For every phase, test stationary views, forward traversal, rapid rotation, teleport/eviction pressure, edits, save/reload, and long-running low-memory scenarios. Use nix develop --command for all builds/tests and bounded headless graphics runs.
Objective
Evolve ZigCraft distant terrain into a measured hybrid CPU/GPU architecture capable of approaching Distant Horizons-like quality and scale without assuming that every workload belongs on GPU.
Architectural assessment
The current system is predominantly CPU-driven: procedural sampling, mesh generation, hierarchy scheduling, visibility/coverage checks, streaming, persistence, and default direct draw submission occur on CPU. The GPU mainly transforms and shades uploaded conventional vertices. Terrain MDI exists but is optional, while the LOD GPU-culling switch currently falls back to CPU behavior.
The architecture can improve substantially without a rewrite through visibility, threading, MDI, transfer, and synchronization work. Reaching genuinely large horizons with high quality likely requires the Phase 4 representation change: compact far-terrain tiles plus GPU-driven visibility/submission. Procedural generation, persistence, edits, and policy should remain CPU-owned unless measurements prove otherwise.
Current responsibility map
Ranked concerns
vkDeviceWaitIdleduring eviction/pool operations and avoidable upload copies.Phased delivery
Dependency graph
Within each phase, workstreams marked parallel may be developed concurrently. Shared RHI/Vulkan contract changes and resource-lifetime changes must merge sequentially behind explicit interfaces.
Global constraints
Epic completion criteria
Validation matrix
For every phase, test stationary views, forward traversal, rapid rotation, teleport/eviction pressure, edits, save/reload, and long-running low-memory scenarios. Use
nix develop --commandfor all builds/tests and bounded headless graphics runs.