Repository navigation
refactor(rustlantis): clarify ProjectionIter traversal invariant - #1157
Conversation
Signed-off-by: Raul Estrada <[email protected]>
ba0ee33 to
a1c644f
Compare
|
This PR is not blocked by a dependency or by the pointer-contract refactor; it remains open in normal review.
The exact-head evidence requirements are described in the Discord acceptance criteria. |
|
Verified the documented invariant on main, and it holds:
So cycles can't be re-entered, the FIXME was stale, and the debug_assert sits at the single point any future violating writer must pass. Upstream rustlantis still carries the same FIXME, so documenting it in the vendored copy is right. Closes #1156. One thing I added at landing: a |
Inject a Deref edge into a place node's subfield_edges (violating the invariant documented on ProjectionIter) and drive the iterator across it, checking that the debug_assert at the consumption point fires with its message. Verified the test stops panicking when the assert is neutered, so it exercises the guard itself. Signed-off-by: nihalpasham <[email protected]>
nihalpasham
left a comment
There was a problem hiding this comment.
Invariant verified on main, guard test added and neuter-checked; CI green. Merging.
Closes #1156
Summary
Replace a stale
ProjectionIterreference-cycle FIXME with documentation ofthe traversal invariant that currently prevents the problem.
ProjectionIter::new()may start from any outgoing projection of the root,including
Deref, but subsequent traversal follows onlyPlaceNode::subfield_edges.subfield_edgescontains structural projections created byadd_place().Reference edges created by
set_ref()are added to the graph but are not addedto
subfield_edges.Therefore, reference cycles in
PlaceGraphcannot currently be re-entered byProjectionIter.Changes
traversal invariant.
subfield_edgesdo not containDerefprojections.Testing
All Rustlantis workspace tests pass.