Skip to content

Non-deterministic task ordering in KinematicsSolver #34

Description

@imwhocodes

KinematicsSolver stores tasks and constraints in:

std::set<Task*> tasks;
std::set<Constraint*> constraints;

Since these sets are ordered by pointer value, iteration order can differ between processes or executions even when tasks are created in the same logical order.

This ordering propagates to QP construction.

I observed this while running identical IK requests in multiple worker processes: the final results differed slightly depending on which PID performed the solve. The difference was small (around 1e-8 after many iterations), and appears consistent with numerical differences caused by different QP assembly order.

It would be useful for task/constraint iteration, and therefore QP construction, to be deterministic independently of memory allocation addresses.

Thank you for this amazing project,
Luca

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions