Skip to content

panic when importing exported .ply with sh-degree=4 — slice index out of range #349

@iamnotszp

Description

@iamnotszp

Description:
I encountered a panic when trying to load an exported .ply file after training with sh-degree=4. The training itself completes without errors, but importing the resulting .ply crashes with a slice index out of range error.

Steps to reproduce:

  1. Train a model with SH degree 4:

    brush_app.exe .\output\ --sh-degree 4

    Training runs successfully for 30k steps (~32 minutes), no errors.

  2. Try to load the exported .ply with the viewer:

    brush_app.exe .\export_30000.ply --with-viewer
  3. The GUI opens but remains empty, and the following panic occurs in the terminal:

    thread 'tokio-runtime-worker' panicked at D:\a\brush\brush\crates\brush-serde\src\import.rs:259:44:
    range end index 46 out of range for slice of length 45
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    
Image

Expected behavior:
The viewer should load and display the trained model without errors.

Actual behavior:
The viewer opens but shows no content, and the command line reports a panic due to a slice index out of range.

Additional information:

  • This only happens with sh-degree=4. Training and loading work fine with sh-degree=2 or 3.
  • The issue reproduces across multiple custom datasets prepared with COLMAP.
  • Using the precompiled Windows release from v0.3.0
  • System: Windows 11, AMD Ryzen R6800H, NVIDIA RTX 3060 Laptop (6GB VRAM), 16GB RAM.

Possible cause:
The panic occurs at brush-serde/src/import.rs:259:44, suggesting a mismatch in expected vs. actual slice length when reading SH coefficients for degree 4. This may be a serialization/deserialization bug specific to higher SH degrees.

Workaround:
For now, training with sh-degree=3 or lower works without issues.

Let me know if you need further details or testing. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions