Skip to content

Distance-prioritized Gaussian chunk budget solve (#1423) - #1439

Merged
untoldengine merged 3 commits into
developfrom
issue/1423
Dec 4, 2026
Merged

untoldengine merged 3 commits into
developfrom
issue/1423

Conversation

@untoldengine

Copy link
Copy Markdown
Owner

Summary

Fixes #1423 — large .untoldgs scenes (e.g. a 3.3M-splat garden capture against visionOS's 1,000,000-splat working-set budget) rendered uniformly sparse, because the chunk-level budget solve computed one global density cap per frame and applied it to every visible chunk regardless of distance.

  • CPU paging path: GaussianPagingPolicy.fillDensityCapByBand/GaussianChunkCullMath.densityCap(near:far:grant:) — near/far priority bands for the pager's streaming decisions.
  • GPU resident-quota solve (the part that actually determines rendered density): GaussianWorkingSetBudget.metal now solves two bands' density caps instead of one, with the near band's camera distance computed in the entity's own local space (fixing a world/local-space mismatch that silently broke the split for any rotated or translated entity).
  • Smooth priority bands: a chunk's near/far weight is a smoothstep over priorityTransitionWidth, not a hard cutoff at nearPriorityDistance — avoids a visible pop at the boundary.
  • Share-based floor, not winner-take-all: the near band is solved against nearPriorityShare × room (default 0.85), not the whole room — so the far band is guaranteed a floor instead of being starved to exactly zero, which a hard-cutoff/unconditional-protection version was confirmed to do.
  • Flicker fix: per-chunk quotas blend the two bands' quotas, not their density caps — blending caps directly is NaN-prone whenever one is infinite (+inf × 0), and any finite fallback for that case creates a hard step that showed up as chunks flickering on/off as the camera moved.

All new knobs (distancePrioritizedBudget, nearPriorityDistance, nearPriorityShare, priorityTransitionWidth) default to values that exactly reproduce the original single-cap behavior when the feature is off.

Test plan

  • swift test --filter UntoldEngineTests — CPU unit tests
  • swift test --filter UntoldEngineRenderTests (Gaussian test classes) — GPU render tests, run repeatedly through development
  • Manual repro on Mac: forced workingSetSplatsOverride to visionOS's real 1,000,000-splat cap against a 3.3M-splat scene, confirmed the fix resolves the uniform-sparse rendering and the flicker at the band boundary
  • On-device Vision Pro validation (pending)

Docs: docs/API/UsingGaussianSystem.md updated with the new knobs and the gaussianBudgetSnapshot() diagnostic API.

)

Protects near-camera chunks from being thinned by far-chunk demand in
the pager's density-cap solve: splits chunks into a near/far priority
band and solves the far band's room only after the near band's own
demand is granted in full, instead of one uniform cap applied to
every visible chunk regardless of distance.

This covers the CPU-side paging decision path
(GaussianPagingPolicy.fillDensityCapByBand). The GPU-side resident-
chunk quota solve (GaussianWorkingSetBudget.metal) is a separate,
larger change tracked as a follow-up.
…h priority bands (#1423)

Extends the budget-overshoot fix to the real resident-chunk quota solve
(previously only the CPU paging-priority path was fixed). The chunk cull
now computes each chunk's camera distance in the entity's local space
(fixing a world/local-space mismatch that silently broke the split for
any rotated or translated entity) and assigns a continuous near/far
priority weight via smoothstep over `priorityTransitionWidth`, instead
of a hard cutoff at `nearPriorityDistance`.

The budget solve grants the near band up to `nearPriorityShare` of the
room (default 0.85) rather than the whole room first-come-first-served,
so the far band is always guaranteed a floor instead of being starved
to zero — the hard-cutoff version was confirmed (via a Sandbox repro
forcing visionOS's real 1M-splat working-set cap against gardenscene's
3.3M-splat lod0) to zero out the far band whenever near demand alone
saturated the budget, causing chunks to disappear outright rather than
thin gracefully.

Per-chunk quotas blend the two bands' grants (`gaussianMixedQuota`)
rather than blending the density caps themselves: blending caps is
NaN-prone whenever one is infinite, and any finite fallback for that
case creates a hard step in the resulting quota exactly where the
fallback switches sides — which reproduced as chunks visibly flickering
on and off as the camera moved. Blending two already-finite quotas has
no such discontinuity.

All three knobs (`nearPriorityDistance`, `nearPriorityShare`,
`priorityTransitionWidth`) default to values that reproduce the
original single-cap behavior when `distancePrioritizedBudget` is off,
and `GaussianChunkCullConstants`/`GaussianBudgetScaleConstants`/
`GaussianVisibleChunk` grew to carry the new per-entity and per-chunk
fields.
…level diagnostics (#1423)

Adds a docs/API/UsingGaussianSystem.md section covering
GaussianPagingPolicy.distancePrioritizedBudget, nearPriorityDistance,
priorityTransitionWidth and nearPriorityShare, and why per-chunk quotas
blend the two bands' grants rather than their density caps.

gaussianBudgetSnapshot() gains coarseChunks/coarseSplats so a caller can
tell whether a scene's per-chunk coarse levels are actually engaging,
independent of visual inspection.
@untoldengine
untoldengine merged commit f908b58 into develop Dec 4, 2026
3 of 4 checks passed
@untoldengine
untoldengine deleted the issue/1423 branch December 4, 2026 04:55
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.

Gaussian chunk budget solve: make density cap distance-prioritized instead of uniform

1 participant