Skip to content

ios: clear stale scan dots after relocalization reset - #195

Open
SamGu-NRX wants to merge 1 commit into
t3/live-fogfrom
codex/greptile-158-dot-reset
Open

SamGu-NRX wants to merge 1 commit into
t3/live-fogfrom
codex/greptile-158-dot-reset

Conversation

@SamGu-NRX

@SamGu-NRX SamGu-NRX commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

What changed

A relocalization reset now clears the live scan dots, matching Start over. Previously, a new AR world frame could reuse dots measured in the old frame.

Why

The dot positions belong to the world frame that produced them. This adds the same reset calls already used by resetAll to resetSpatialState.

Stacked on #158, targeting t3/live-fog. Addresses Greptile's reset finding.

UI changes

Old dots should disappear when relocalization discards the old world frame. Before/after device captures are not available yet; this PR does not claim visual acceptance.

Verification

  • Debug iOS Simulator app build at 010f3227: BUILD SUCCEEDED, exit 0, using xcodebuild with -jobs 1.
  • git diff --check passed.
  • Source comparison confirms both reset paths now clear the accumulator and published dot state.

Risk

The relocalization reset has not been exercised on a physical device. That check is still needed before field acceptance.

Checklist

  • The scope is focused; related changes belong together
  • I explained what changed and why
  • I included before/after images for visible changes
  • I included a video for motion or interaction changes

Summary by CodeRabbit

  • Bug Fixes
    • Live LiDAR dots are now cleared when spatial state is reset, preventing dots from a discarded scan frame from remaining visible.

A relocalization timeout restarts ARKit's world frame, but resetSpatialState kept the
SurfaceDots field, so depth from the new frame fused into dots from the old one. Start over
already clears both; the spatial reset now does the same. Greptile 4115037126 on #158.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@codemetrics-ai

codemetrics-ai Bot commented Oct 1, 2026

Copy link
Copy Markdown

Note

Review skipped

Codemetrics is installed on this repository, but it hasn't been added to your team yet.

To enable AI code reviews for this repo, go to your dashboard and add BaseScanning to your team's repositories.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T20:23:04.273244Z 010f322 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 3dc9a667-f89d-4307-94a7-1b4d7a1f0b03

📥 Commits

Reviewing files that changed from the base of the PR and between f57310c and 010f322.

📒 Files selected for processing (1)
  • ios/HouseScan/Runtime/ScanEngine.swift

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Spatial resets now clear the live LiDAR dot field and publish an empty field after discarding coverage and restarting the live source.

Changes

Spatial reset

Layer / File(s) Summary
Clear live dots on reset
ios/HouseScan/Runtime/ScanEngine.swift
resetSpatialState(reason:) clears liveDots and publishes an empty dot field.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Suggested reviewers: aidenjohnston

Merge Risk: ⚪ Minimal · up to 010f3

Spatial resets clear the published dots, and delayed updates from the discarded frame cannot restore them. No merge-blocking issue was identified.

Security Architecture Review

Security architecture risk: ⚪ Minimal · up to 010f3

The reset clears stale visual guidance using the existing cleanup mechanism. Existing generation checks prevent older asynchronous work from restoring discarded dots. No new access, authority, or external interface is introduced.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The introduced behavior is confined to cleanup of the current scan's derived dot field. The compared change adds no caller, credential access, external interface, or broader authority.

Trust Boundaries and Controls

  • observed — The existing generation check preserves world-frame identity across asynchronous publication: the feed publishes the generation captured by queued work, and ScanEngine rejects callbacks from an earlier generation.

Resilience and Maintainability Implications

  • inferred — Asynchronous reset does not require awaiting feed completion to contain old-frame work. The serial queue orders field cleanup before subsequent integration, generation checks reject stale publication, and keyframe checks across suspension prevent pre-reset tasks from feeding the new frame. Repeated resets retain these protections.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: clearing stale scan dots after a relocalization reset.
Description check ✅ Passed The description includes all required sections and explains the change, rationale, verification, risks, and testing limits. The media checkboxes remain unchecked instead of being replaced with explici…
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the size:XS 0-9 effective changed lines. label Oct 1, 2026
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Clears stale scan visualization after relocalization.

The PR appears safe to merge; the remaining concern is non-blocking regression coverage for the new reset path.

Fix All in CodexFindings

  1. P2 Reset lacks regression coverage ▶
Fix with agent prompt
### Issue 1
ios/HouseScan/Runtime/ScanEngine.swift:1127-1128
Please add a regression test for relocalization that checks both the published dots and the accumulated dot field are cleared. Checking only that the dots disappear initially would miss a future change that lets new depth frames fuse with dots from the old world frame.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary

The PR clears accumulated and published live scan dots when a relocalization timeout resets the spatial state, matching the existing Start over behavior.

  • The reset paths now treat dots as belonging to the discarded world frame.
  • A regression test would protect both parts of the reset.

Reviews (1) · Last reviewed commit: "ios: clear the live dots on a spatial re..."

Comment thread ios/HouseScan/Runtime/ScanEngine.swift
@SamGu-NRX

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

SamGu-NRX added a commit that referenced this pull request Oct 2, 2026
A relocalization timeout (ScanEngine.swift:1500) and camera access after a failure (:477) call
resetSpatialState, which restarts ARKit's world frame but kept the SurfaceDots field, so depth
from the new frame fused into dots from the old one. resetAll already clears both
(:2211-2212); the spatial reset now does the same. These are #195's three lines (010f322),
handed over by the legacy caretaker as c6184ff2 and accepted by root; nothing from #158 comes
with them.

Co-Authored-By: Claude Code <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 effective changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant