Skip to content

LOD GPU roadmap Phase 0: establish profiling and quality baselines #921

Description

@MichaelFisher1997

Goal

Establish trustworthy LOD-specific measurements before changing CPU/GPU ownership. This phase is the dependency for every later optimization.

Current evidence

The current benchmark aggregates the whole renderer, while LOD work spans LODManager.update, worker generation/meshing, LODRenderer, Vulkan uploads, cache I/O, and deferred destruction. We cannot yet attribute frame time or memory specifically to distant terrain.

Parallel workstreams

  • Add CPU timings for scheduling/state scans, terrain sampling, mesh construction, visibility/coverage checks, cache load/store, upload preparation, and lock wait/hold time.
  • Add GPU timestamp scopes for LOD opaque terrain and LOD water, separate from normal chunks.
  • Track LOD regions by state/level, draws, vertices, visible/rejected counts, coverage checks, upload bytes, pending CPU bytes, GPU pool/direct-buffer bytes, deferred deletion bytes, and pool growth/compaction.
  • Count and identify runtime waitIdle calls and staging-pressure events.
  • Define reproducible stationary, traversal, rapid-turn, and teleport/eviction scenarios.
  • Capture visual baselines for seams, transitions, water, fog, and full-detail handoff.

Relevant code

  • modules/world-lod/src/lod_manager_core_ops.zig
  • modules/world-lod/src/lod_manager_generation_ops.zig
  • modules/world-lod/src/lod_renderer.zig
  • modules/world-lod/src/lod_manager_upload_ops.zig
  • modules/world-lod/src/lod_manager_eviction_ops.zig
  • modules/engine-graphics/src/vulkan/
  • src/lod_bench_main.zig

Acceptance criteria

  • A benchmark artifact reports LOD CPU and GPU timings independently.
  • p50/p95/p99 frame time and worst-frame attribution are available.
  • Metrics distinguish CPU generation/meshing, submission, GPU shading, transfer, synchronization, and memory pressure.
  • All scenarios are bounded, headless, documented, and repeatable.
  • Instrumentation can be disabled or has negligible release overhead.

Validation

Run nix develop --command zig build test, nix develop --command zig build lod-bench, and bounded zig build benchmark scenarios. Record hardware, preset, render distance, seed, duration, and build mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions