NeRF Ray Sampling Bug
NeRF: Representing Scenes as Neural Radiance Fields (Mildenhall et al., 2020)
Problem
Novel view synthesis produced blurry artifacts at object boundaries. Training metrics looked correct but visual quality degraded at inference.
Root Cause
The open-source implementation sampled rays uniformly instead of using stratified sampling with the hierarchical refinement described in Section 5.2. Additionally, the near/far bounds were hardcoded instead of being scene-adaptive.
Fix
Implemented proper stratified sampling with coarse-to-fine hierarchy. Added dynamic near/far bound computation based on scene bounding box. Added a regression test comparing ray sample distributions against the paper's Figure 5.
Impact
PSNR improved from 26.3 to 31.1 on the Blender dataset, matching paper-reported results.