Skip to content

A posed rigid model is edited in place - #177

Merged
yujiaxu-ops merged 11 commits into
mainfrom
rigid-edits
Nov 20, 2026
Merged

yujiaxu-ops merged 11 commits into
mainfrom
rigid-edits

Conversation

@yujiaxu-ops

@yujiaxu-ops yujiaxu-ops commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

After #173 a posed rigid model is instances of its parts' meshes. This makes it one an edit can change in place, as a mesh and a still model are.

  • Hidden and shown. Hidden, its parts are instances no ray sees, their emitters at no weight; it is posed and moved on. Shown, it is placed where it stands.
  • Removed. Its instances are no object's; what an edit placed goes back to the room.
  • Placed again. One the scene has is an instance of each of its parts' meshes, a part a record of the room, with its emitters.
  • Posed in place under software traversal. The pose update goes through what is above the instances under either traversal (the TLAS, or the units' top tree). A new pose or a move was a rebuild's there.

An edit places an instance by one function now (its rows, its emitters, its record, its place above the triangles), for a mesh, a still model and a rigid model's part alike. With it a still model whose mesh emits is placed again in place, where that was a rebuild's.

A fault of #173's, fixed here

A placed rigid model's parts were the nodes the clip it was built with moves. Given another clip, or (since #175) a pose that names another node, it was posed in place with those parts: the nodes the new pose moves stayed in the part merged for the old one, a wrong picture. Found by reading; the test of it failed before the fix.

  • Its parts are the nodes any clip of the file moves, and the nodes its pose names. Another clip is posed in place, and placements that play different clips share their meshes. A file with one clip, as both of the big animated scenes here are, is built as before.
  • A pose that names other nodes than the last is a rebuild's. The model remembers the nodes its parts were made for.

Still a rebuild: a rigid model with triangles flattened beside its parts hidden, removed or placed again; a pose that names other nodes; a model hidden when the scene was built, shown; a skinned model added, hidden or removed; a model the scene has not, added.

Measured

Software traversal, an interior of 7,300 nodes whose clip plays (4,181 units), 1280 x 720 at half scale:

before now
frames that rebuilt the scene every one none
a frame 2.9 s 19 ms
of it the commit 2.9 s 1.2 ms

The paths a frame takes are not touched. GPU time a frame at 1080p on twelve scenes, alternated pairs against main after a run thrown away, four pairs over two heads: all within 0.8 %. The quality figures against the offline references are main's.

Checks

  • 205 unit tests, natively and under software traversal. New: a posed rigid model hidden, posed and moved while hidden, shown, removed (one that moved, one that never did); a still and a posed rigid model with emitters placed again, the latter then posed, moved, hidden, shown and removed, its records and rows the next one's; one with flattened triangles (hidden, removed, placed again) by a rebuild; one given another clip of its file, in place (tests/render/data/two-clips.glb); one whose pose names a node no clip moves, by a rebuild, then posed on in place, a second placed with the same node named in place. A placed model's row of the object table against a build's (the review's finding: its pivot went to another object's row). Each against a build's light list and picture. A posed rigid model is its parts' instances #173's two tests of posing and moving run under software traversal too.
  • 264 render tests natively. Under software traversal the ones that fail on main, and no other.
  • 32 mutations of the new logic against the unit tests: 31 fail a test natively, the 32nd (a unit's record at a new pose) under software traversal. Five did not at first, and the tests were made to see them: the fixture's moved node is a few pixels, under the picture threshold, so what the rays see and where each part stands are asserted directly; nothing looked at a hidden instance's emitters' areas; both removals were of a model that had moved; nothing placed a model with flattened triangles again.
  • Not run on Vulkan yet.

🤖 Generated with Claude Code

yujiaxu-ops and others added 8 commits November 20, 2026 12:54
…in place under software traversal

Hidden, its parts are instances no ray sees and it is posed and moved on; shown, it is placed where it stands;
removed, its instances are no object's. Its pose update goes through what is above the instances under either
traversal (the TLAS, or the units' top tree), where it needed the TLAS.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…osed rigid one as its parts' instances

The placement of one instance is a function of its own (its rows, its emitters, its record, its place above the
triangles): a mesh's, a still model's, and each part of a posed rigid model, whose records are a run of the room.
A still model whose mesh emits was a rebuild's to place again: its emitters are made as a mesh's are.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…y a rebuild; one made visible in the commit that adds it

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…idden emitters' areas, a model that never moved removed, parts where a build places them, one with flattened triangles placed again

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ngles

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…e build's do

After the merge of main: a pose may name nodes beside its clip, and they move too.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@yujiaxu-ops
yujiaxu-ops marked this pull request as ready for review November 20, 2026 10:03

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 4c704e4. Configure here.

rigid.instances.push((node, (record + j) as u32));
}
}
scene::Draw::Rigid(rigid)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit-placed rigid model corrupts object pivot

Medium Severity

An in-place placement of a posed rigid model builds RigidModel from Default, so rest.object stays 0. The build path sets that field to the object's table index. A later pose or move in repose_rigid then writes the new pivot into objects[0] instead of this model's row, leaving the model's own pivot at spawn and overwriting whichever object owns the first entry.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4c704e4. Configure here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Real: a model placed by an edit kept the default row, so its next pose or move wrote its pivot into the first object's row. Fixed in b830519; the placed-again test compares each model's row of the object table with a build's now (it failed before the fix).

yujiaxu-ops and others added 3 commits November 20, 2026 18:11
… pose that names other nodes is a rebuild

A placed rigid model given another clip, or a pose that named another node, was posed in place with the parts made
for the first pose: the nodes the new one moves stayed in the part merged for the old one. Its parts do not depend
on the clip that plays now, so another clip is posed in place; it remembers the nodes its pose named, and a pose
that names others rebuilds.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A new pose or a move wrote its pivot into the first object's row (the review's finding). The test compares each
model's row with a build's now.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@yujiaxu-ops
yujiaxu-ops merged commit 7d1dfc3 into main Nov 20, 2026
9 checks passed
@yujiaxu-ops
yujiaxu-ops deleted the rigid-edits branch November 20, 2026 10:52
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