Skip to content

fix: make dense geometry deterministic - #335

Draft
SamGu-NRX wants to merge 3 commits into
gpt-burst/1022z-bs-296-geometryfrom
gpt-burst/1023z-bs-324-deterministic
Draft

SamGu-NRX wants to merge 3 commits into
gpt-burst/1022z-bs-296-geometryfrom
gpt-burst/1023z-bs-324-deterministic

Conversation

@SamGu-NRX

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

Copy link
Copy Markdown
Owner

Zephyrus task: fix BaseScanning #324 geometry nondeterminism. This draft PR stacks on gpt-burst/1022z-bs-296-geometry.

What changed

Dense point rows are now sorted by canonical coordinates before artifacts are written. The scene extractor canonicalizes point order before ground-plane and sequential wall RANSAC sampling, so a permutation of the same cloud produces the same fitted wall geometry. The regression tests live in backend/server/tests/test_determinism.py; implementation changes are in backend/server/dense/run.py and backend/server/eval/extract.py.

Why

The dense stage produced the same 109,252-point multiset in different orders across runs. The wall fit seeded sampling from array indices, so that order changed the fitted wall and caused the real geometry assertion to fail intermittently.

Verification

  • Failing first on the parent: env -u NODE_ENV OMP_NUM_THREADS=1 uv run pytest -q server/tests/test_determinism.py — 1 failed.
  • Passing after the fix: the same command — 2 passed.
  • Geometry regression: OMP_NUM_THREADS=1 uv run pytest -q tests/test_real_cpu_geometry.py::test_scene_stage_wall_ground_and_residual, run serially 20 times — 20 passed, 0 failed.
  • Focused compatibility checks: env -u NODE_ENV OMP_NUM_THREADS=1 uv run pytest -q server/tests/test_determinism.py server/tests/test_windows.py::test_sparse_union_keeps_sfm_tracks server/eval/tests/test_harness_defects.py::test_dense_bend_stays_one_meter_wall — 4 passed.
  • Lint: uv run ruff check server/dense/run.py server/eval/extract.py server/tests/test_determinism.py and uv run ruff format --check server/dense/run.py server/eval/extract.py server/tests/test_determinism.py — passed.
  • Full backend suite on fix: make dense geometry deterministic #335: 1,523 passed, 16 skipped, 6 failed, 14 errors. The parent baseline was 1,523 passed, 16 skipped, 4 failed, 14 errors. The two extra fix: make dense geometry deterministic #335 failures were server/tests/test_skeleton.py::test_import_contracts and server/tests/test_windows.py::test_sparse_union_keeps_sfm_tracks. Each passed when rerun alone on fix: make dense geometry deterministic #335 and on 6152e82f, so they are suite-order or shared-state failures, not deterministic failures from this change. The 4 baseline failures are expired gate pins, and the 14 errors are the existing cold-restart import errors. Pytest-xdist was not installed, so the full suite ran serially.

UI changes

N/A. This changes server geometry ordering only.

Risk

The canonical order preserves dense and sparse track alignment. The full suite remains red because of the baseline failures and two order-sensitive failures that reproduce only in the full run.

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

🤖 Generated with Claude Code

The dense output row order and dense.ply / cloud.npz file digests change by design. The canonical order makes repeated runs stable. The public dense-stage regression runs run_dense on shuffled points, reads cloud.npz and tracks.npz, and compares each observation to its physical point. It fails on 3ef5d7c7 with swapped track IDs and passes at bf171d40. Downstream consumers must not rely on the previous incidental row order.

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

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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:S 10-29 effective changed lines. label Oct 23, 2026
SamGu-NRX and others added 2 commits October 23, 2026 09:25
Co-Authored-By: Claude Code <noreply@anthropic.com>
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:S 10-29 effective changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant