-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug when joining cleared optional components #3726
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, but I'm nervous we still have the bug for splats!
let is_empty = component.map_or(true, |c| c.is_empty()); | ||
|
||
if let (Some(component), false) = (component, is_empty) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please motivate this with a comment, i.e. why only non-empty components?
And does the code handle splat components (length=1) correctly?
@@ -357,6 +359,15 @@ impl<A: Archetype> ArchetypeView<A> { | |||
// - If the data isn't the same, the cost of the comparison will be dwarfed by the cost | |||
// of the join anyway. | |||
if self.required_comp().instance_keys == component.instance_keys { | |||
// This fast iterator is assumed to match the length of the primary component | |||
// We shouldn't hit this if since the store should enforce matched lengths for | |||
// non-empty components, and the outer if-guard should keep us from reaching this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, I don't think this is true for splats, e.g. Points3D(positions=[a,b,c,d], colors=[rgba])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Splats are currently split into their own rows. See: #1893 -- adding a TODO linking to that issue though.
Good call on splats. We technically don't have a problem (yet) because splats are currently logged to a separate row, but I will add a unit test to make sure we don't regress on that front when we change that assumption. |
What
Resolves the second issue identified from:
log_line_strips_3d
with nostroke_widths
argument shows no lines #3711Even with the fix from:
log_line_strip_Xd
andlog_obbs
#3720We could still reproduce an error with code such as:
Which would still display no lines.
It turns out the single-row joining iterator introduced a bug when a component is cleared. This yields an empty cell for the component, but still passes the key-based check that was being done, and then subsequently yields no items.
This PR adds a unit-test reproing the issue, a debug_assertion where we were previously violating an assumption, and now guards against the condition.
Checklist