Nudging after a first realization fails can cause a panic #100

Open
opened 2025-07-18 21:05:58 +00:00 by Vectornaut · 1 comment
Member

Behavior

Nudging an assembly after its first realization attempt has failed can cause a panic.

Reproduction steps

Commit: 4cb3262 (main branch at pull request #91).

  1. Load the Empty test assembly.
  2. Add a sphere and a point.
    • The point appears at the center of the sphere.
  3. Constrain the point to lie on the sphere.
    1. Select the sphere and the point by shift-clicking in the outline view.
    2. Add an inversive distance regulator.
    3. Set the inversive distance between the point and the sphere to zero.
      • Realization fails, with the console log message "Failed to reach target accuracy."
  4. Nudge the sphere.
    1. Select the sphere by clicking it in the display view.
    2. Press one of the keys A/D/S/W.

Possible explanation

I suspect that the way we're handling realization failure can break invariant (1) or (2) in the assembly module.

### Behavior Nudging an assembly after its first realization attempt has failed can cause a panic. ### Reproduction steps **Commit:** 4cb3262 (main branch at pull request #91). 1. Load the *Empty* test assembly. 2. Add a sphere and a point. - *The point appears at the center of the sphere.* 3. Constrain the point to lie on the sphere. 1. Select the sphere and the point by shift-clicking in the outline view. 2. Add an inversive distance regulator. 3. Set the inversive distance between the point and the sphere to zero. - *Realization fails, with the console log message "Failed to reach target accuracy."* 4. Nudge the sphere. 1. Select the sphere by clicking it in the display view. 2. Press one of the keys **A**/**D**/**S**/**W**. - *The app panics at the [`column_mut` call](src/commit/4cb32625556743de30b49eed4b6bfce8ab9190dc/app-proto/src/assembly.rs#L776) in `Assembly::deform`.* ### Possible explanation I suspect that the way we're handling realization failure can break invariant [(1)](src/assembly.rs#L537-L546) or [(2)](src/commit/4cb32625556743de30b49eed4b6bfce8ab9190dc/app-proto/src/assembly.rs#L720-L727) in the `assembly` module.
Vectornaut added the
bug
label 2025-07-18 21:05:58 +00:00
Author
Member

This may have been fixed by pull request #105. In particular, the reproduction steps work on commit 0801200 (main branch at pull request #103), but not on the subsequent commit 2eba80f (main branch at pull request #105). This is probably because pull request #105 triggers a realization whenever you add an element, so the dimension of the tangent space stays more in sync with the number of column-indexed elements. I'm leaving the issue open until we get a chance to investigate further.

This may have been fixed by pull request #105. In particular, the reproduction steps work on commit 0801200 (main branch at pull request #103), but not on the subsequent commit 2eba80f (main branch at pull request #105). This is probably because pull request #105 triggers a realization whenever you add an element, so the dimension of the tangent space stays more in sync with the number of column-indexed elements. I'm leaving the issue open until we get a chance to investigate further.
Sign in to join this conversation.
No description provided.