Skip to content

Keep SceneContraction derivatives finite at the origin - #3796

Draft
Afloat16 wants to merge 1 commit into
nerfstudio-project:mainfrom
Afloat16:fix-scene-contraction-origin-derivatives-20261008
Draft

Afloat16 wants to merge 1 commit into
nerfstudio-project:mainfrom
Afloat16:fix-scene-contraction-origin-derivatives-20261008

Conversation

@Afloat16

@Afloat16 Afloat16 commented Oct 8, 2026

Copy link
Copy Markdown

Scene contraction is the identity inside the unit ball, but its inactive radial branch divides by the zero radius at the origin. Forward values remain finite while first and second derivatives become NaN. Gaussian contraction also evaluates an unguarded radial Jacobian for interior means before masking their covariance updates.

Use nonzero constant positions in the unused radial branch and use the same guarded contraction when computing Gaussian Jacobians. The exterior contraction and interior means/covariances stay unchanged.

Validation:

  • Full native supported serial/in-process pytest variant: unchanged source: 11 failed / 83 passed; final: 94 passed. Original test files and jaxtyping checks are unchanged. The official data-loader configuration uses 0 workers and prefetch_factor=None in the test process; pytest also runs serially.
  • Regressions cover float32/float64, Euclidean and infinity norms, mixed interior/exterior batches, gradcheck/gradgradcheck, Gaussian covariance transport and mean/covariance gradients.
  • Repository-pinned Ruff lint/format, license headers and notebook metadata checks pass. Pyright reports 0 errors / 18 optional-import warnings on unchanged and final source. Full Sphinx warnings-as-errors builds pass on both.

The supported CPU environment is Python 3.12.14, Torch 2.7.1+cpu, NumPy 2.3.5, Pillow 10.4.0 and Open3D 0.19.0. The default parallel configuration is unvalidated locally: the four-worker run finished 93 passed / 1 crashed training worker, and serial pytest with the default data workers timed out after the local kernel refused multiprocessing FD-sharing sockets. No IPC transport or security setting was changed. The full development extra was not installed; optional generative, projectaria and related imports remain warnings. CUDA and standalone hardware-training integrations were not run.

Latest Pillow's unrelated private encoder failure is already tracked in #3782/#3783; no Pillow change is included here. Current Open3D 0.20 annotation errors also remain outside this patch.

@Afloat16

Afloat16 commented Oct 8, 2026 •

Copy link
Copy Markdown
Author

Core Tests stops at Pyright before running pytest: https://github.com/nerfstudio-project/nerfstudio/actions/runs/37783706179/job/113332953320.

A local baseline comparison with Pyright 1.1.331 and the official Open3D 0.20.0 package gives the same 19 errors and 18 warnings on both unchanged base 50e0e3c and this PR's head 98a459e. All 19 hosted error file/line/column locations match that reproduction, in eight files unchanged by this PR; neither changed file has an error. The hosted job has two warnings, and its installed Open3D version remains unverified, inferred only from the matching error signature.

Reproduction from either checkout, starting with the declared runtime environment and Pyright 1.1.331:
uv pip install --python "$(command -v python)" --no-deps --target /tmp/ns-open3d020 open3d==0.20.0
PYTHONPATH=/tmp/ns-open3d020 pyright --pythonpath "$(command -v python)" --outputjson

The local reproduction uses Python 3.12.14 and NumPy 2.3.5; it does not reproduce the complete hosted dev environment. With supported Open3D 0.19.0, both local checkouts give zero errors and the same 18 warnings. No dependency pin, CI configuration or unrelated adapter was changed to hide this baseline incompatibility. Core CI remains failed, and remote pytest is unrun.

Docker CI is also terminal failed: https://github.com/nerfstudio-project/nerfstudio/actions/runs/37783706180/job/113332953452. Pinned Tiny-CUDA-NN b3473c8 fails its PEP517 build-requirements hook with ModuleNotFoundError: pkg_resources in pip's isolated setuptools overlay. The unchanged Dockerfile dependency block fails before Nerfstudio source is copied or installed, so the SceneContraction change is not executed there. This is separate from the Pyright failure above; the isolated setuptools version remains unverified. No Docker rerun, GPU/runtime validation or unrelated dependency/CI edit was performed. The PR workflow disables image pushing and attestation.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant