Skip to content

Show the SH degree actually drawn in the iOS dev HUD - #44

Merged
Xget7 merged 5 commits into
mainfrom
fix-hud-sh-degree
Oct 20, 2026
Merged

Xget7 merged 5 commits into
mainfrom
fix-hud-sh-degree

Conversation

@Xget7

@Xget7 Xget7 commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Summary

The iOS dev HUD "Pipe" row built SHn from the requested settings only, so kitchen_500k.spz (SH degree 0) showed SH1.
The renderer holds the world's degree already (GpuWorldInfo.shDegree); the stats path now carries it up to Swift and Kotlin.

SplatEngine::sample()
  Sample.shDegree = renderer.world().shDegree            (new)
StatsPublisher::publish
  Stats.loadedShDegree                                   (new)
    iOS:     fromCppStats -> SKSplatStats -> SplatStats.loadedShDegree
    Android: statsToFloats[11] -> decodeSplatStats -> SplatStats.loadedShDegree
 var pipelineText: String {
-    let sh = min(view.shDegree, view.maxShDegree)
+    let sh = min(view.shDegree, view.maxShDegree, stats.loadedShDegree)

The Android dev HUD (SplatHudView) has no SH row, so it has no equivalent bug and stays as is.
Only its public SplatStats gains the field, to keep the platforms in step.

Evidence

  • Before: HUD "Pipe" row read SH1 for a degree-0 world on an iPhone 17 Pro.
    After: the row takes the world's degree into the minimum, so it reads SH0 for that world.
    No device ran this change.
  • Tests that pin the new field:
StatsPublisher.PublishRefreshesCountsWithoutClosingTheWindow   publish(shDegree 2) -> stats().loadedShDegree == 2
FrameOrder.LoadedWorldShDegreeReachesPublishedStatsAndIsZeroWithoutAWorld
                                                               no world -> 0, renderer holds 2 -> 2
SKTypeConversionsTest.StatsKeepEveryField                      loadedShDegree 2 survives fromCppStats
SplatStatsTest.decodesTimingsFlagsAndCompletedCounts           payload[11] = 2 -> loadedShDegree 2
  • Where it ran: macOS host only (iOS Mac CMake tests, NDK lint, Android Gradle build and JVM unit tests).
    No iPhone, Android device or emulator.
  • Checks: iOS Mac tests 386 of 386 passed (5 fixture tests skipped for missing files).
    scripts/lint-cpp.sh clean.
    :splatkit:assembleRelease :app:assembleRelease :splatkit:testDebugUnitTest passed.
    The ios-dev Swift files parse (swiftc -parse) but the app was not built or run.
    npm run check and npm run lint skipped: the React Native package does not mirror SplatStats and is unchanged.

Merge Danger

Door: Two-way.

SplatStats gains one field on each platform and the JNI stats array grows from 11 to 12 floats, with Kotlin and C++ changed together.

Blast Radius: Stats

SKSplatStats is a positional C struct and the new field is last, so existing readers are unaffected.
The iOS XCFramework mirror and Android AAR republish only on a version bump, which this change does not make.

@Xget7
Xget7 merged commit 6eb564d into main Oct 20, 2026
22 checks passed
@Xget7
Xget7 deleted the fix-hud-sh-degree branch October 20, 2026 13:58
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