Skip to content

perf(mosaic): skip proven regional depth reads - #101

Merged
Qubitium merged 1 commit into
mainfrom
perf/mosaic-vulkan-abi-next-4x
Aug 31, 2026
Merged

perf(mosaic): skip proven regional depth reads#101
Qubitium merged 1 commit into
mainfrom
perf/mosaic-vulkan-abi-next-4x

Conversation

@Qubitium

Copy link
Copy Markdown
Contributor

Summary

  • add a per-owned-region normal-Z depth minimum for eligible Mosaic opaque prepared draws
  • skip redundant per-sample depth rereads on proven passing spans
  • reduce failed atomic queue claims after a Mosaic queue is exhausted
  • preserve strict fallback and keep the change private to the Mosaic Vulkan ABI path
  • document realistic Vulkan ABI workload evidence

This targets complex terminal, desktop, game, and editor-shaped streams rather than vkcube. vkcube is intentionally not optimized or used as evidence.

Why this is safe

The regional minimum is only used for aligned, little-endian, uncounted depth buffers and admitted fast Mosaic draws. Unsupported or strict/fallback work invalidates the summary. The second triangle in an admitted quad observes the first triangle's conservative update before using the fast path.

Evidence

Controlled four-physical-core runs using ZPU_MAX_THREADS=4 tools/limited-cpus.sh:

  • vkQuake-shaped: approximately 6.03 ms -> 4.02 ms median across three smoke invocations
  • vkQuake2-shaped: approximately 7.10 ms -> 4.24 ms median
  • Serious Sam-shaped: effectively within host noise
  • targeted candidate p50: vkQuake 4.54x vs per-draw, 2.79x vs legacy; vkQuake2 3.82x vs per-draw, 2.34x vs legacy; Serious Sam 4.29x vs per-draw, 2.10x vs legacy
  • all 13 realistic workload checksums remain identical

These are host-specific measurements, not a universal 4x guarantee.

Validation

  • zig fmt --check
  • git diff --check
  • ZPU_MAX_THREADS=4 tools/limited-cpus.sh zig build
  • ZPU_MAX_THREADS=4 tools/limited-cpus.sh zig build test
  • zig test src/vulkan/cpu_cube.zig -lc (25/25)
  • zig test src/benchmark_vulkan_abi.zig -lc (27/27)
  • zig test src/vulkan/driver.zig -lc (296/296)

@Qubitium
Qubitium merged commit 1c29512 into main Aug 31, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant